delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2007/07/18/09:44:57

X-Spam-Check-By: sourceware.org
From: "Dave Korn" <dave DOT korn AT artimi DOT com>
To: <cygwin AT cygwin DOT com>
References: <20070718100058 DOT 203680 AT gmx DOT net> <20070718105312 DOT 83940 AT gmx DOT net> <026a01c7c932$4cae0810$2e08a8c0 AT CAM DOT ARTIMI DOT COM> <20070718121556 DOT 83920 AT gmx DOT net> <026e01c7c936$bad581c0$2e08a8c0 AT CAM DOT ARTIMI DOT COM> <20070718133420 DOT 83920 AT gmx DOT net>
Subject: RE: Own Compiled Program Immediately Crashes on Startup
Date: Wed, 18 Jul 2007 14:44:34 +0100
Message-ID: <027901c7c941$c6e51e70$2e08a8c0@CAM.ARTIMI.COM>
MIME-Version: 1.0
X-Mailer: Microsoft Office Outlook 11
In-Reply-To: <20070718133420.83920@gmx.net>
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT 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

On 18 July 2007 14:34, Hans Streibel wrote:

>>> How can this link order be changed so that the cygwin dll
>>> is linked in first?
>> 
>> Well, for a start, you'd need to link against the cygwin dll directly,
>> and it would need to be first on the linker command line.
> 
> How can I link to a dll directly? It is a dynamic library so
> as far as I know there is nothing the linker could do here.

  You specify "-l<libname>", and the compiler and linker find the import stub
library (.dll.a) for you.  That's all I meant by the phrase. 


>> It could also be a problem with the link stage.  Make sure the
>> makefile is using 'gcc' to link the application and not trying to invoke
>> 'ld' directly.
> 
> It is using gcc to link the application. See the attachment.

  Yes, so I see; everything looks correct in that linker commandline.

>> One thing, though, by "*my* cygwin Makefile", do you mean the project
>> doesn't come with its own makefile and you had to put one together
>> yourself?
> 
> The package does not come with a makefile for cygwin.
> But there is a README for cygwin and there is a generic Unix
> makefile with lots of comments on what to change for cygwin.
> 
> Thus I copied that Unix makefile and made the necessary
> adjustments in within the copy.
> 
>> Or is it just the one that the project came with or autogenerated using
>> configure or some similar script?
> 
> It is an old package. No "configure". You have to do necessary
> adjustments directly in the makefile.

  Heh, how quaint!

  Anyway, I guess the next thing to try is invoke the executable under gdb and
see if that shows you any more useful information about where it's gotten to
when it crashes.


    cheers,
      DaveK
-- 
Can't think of a witty .sigline today....


--
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