delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2008/07/24/06:28:50

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Message-ID: <488858D0.A307DD96@dessent.net>
Date: Thu, 24 Jul 2008 03:26:24 -0700
From: Brian Dessent <brian AT dessent DOT net>
X-Mailer: Mozilla 4.79 [en] (Windows NT 5.0; U)
MIME-Version: 1.0
To: Nathan Thern <nthern AT gmail DOT com>
CC: cygwin AT cygwin DOT com
Subject: Re: .s file causing problems when linking
References: <a07c15f00807221329k544d2079ia14421e724fe6fd AT mail DOT gmail DOT com> <48864AB5 DOT 6D177B25 AT dessent DOT net> <a07c15f00807221617o20061c0dy135f955181472469 AT mail DOT gmail DOT com> <488678FD DOT 1F211496 AT dessent DOT net> <a07c15f00807231443i3ce6b0c2qf82f305b78213761 AT mail DOT gmail DOT com>
X-IsSubscribed: yes
Reply-To: cygwin AT cygwin DOT com
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

Nathan Thern wrote:

> That sounds great. However, I can't get it to work:
> "gcc -o scheme.exe *.o -Wl,--out-implib,scheme.dll.a" creates a
> working scheme.exe, but silently doesn't create scheme.dll.a
> and

For the last time, please read the link I gave.  Specifically this part:

>   However, keep in mind that the GNU linker's auto-export feature
> (which normally allows you to skip the practice of requiring
> __declspec(dllexport) when declaring symbols you want to export) does
> not apply when linking an executable.  Therefore, when linking an
> executable that exports symbols you need to do one of:
> 
> A) -Wl,--export-all-symbols
> B) declare the symbols to be exported with __declspec(dllexport)
> C) supply the .def file to the linker

> "gcc -shared -o scheme.exe *.o -Wl,--out-implib,scheme.dll.a" creates
> scheme.dll.a and creates a scheme.exe that dies with "-bash:
> scheme.exe: Permission denied" upon invocation.

-shared creates a dll.  You can't use that to link an executable.

Brian

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019