delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/06/07/01:23:00

Mime-Version: 1.0
To: Kbwms AT aol DOT com
From: Nate Eldredge <nate AT cartsys DOT com>
Subject: Re: Need Help Compiling Code with Templates
Cc: djgpp AT delorie DOT com
Date: Sat, 6 Jun 1998 22:18:30 -0700
Message-ID: <19980607051814.AAE17825@ppp124.cartsys.com>

At 10:31  6/6/1998 EDT, Kbwms AT aol DOT com wrote:
>Dear Nate Eldredge,
>
>Thanks for your response.
>
>On 06-05-98 at 19:31:23 EST you wrote:
>> CC:	djgpp AT delorie DOT com
>>
>> At 08:42  6/3/1998 EDT, Kbwms AT aol DOT com wrote:
>>
>> >A possible explanation is that the external generated by the compiler is
>> >"_main" whereas the undefined reference is to "main."  I see that this is
>> >true for other programs that I have compiled but they don't use templates.
>>
>> Oh! Yes, on closer inspection it looks like `crt0.o' is somehow trying to
>> reference `main' instead of `_main', which is wrong. Are you using the stock
>> crt0.o, or have you rebuilt it or something?
>>
>> Post the output of `nm lib/crt0.o', and perhaps its size and date stamp as
>> well.
>>
>
>To repeat the error report from gcc:
>
>c:/djgpp.v2/lib/crt0.o(.data+0x92):crt0.s: undefined reference to `main'
>c:/djgpp.v2/lib/libc.a(crt1.o)(.text+0x346):crt1.c: undefined reference to
>`main'
>
>Herewith are three pieces of data - date/size stamp for crt0.o and two
>name searches, the first for crt0.o, and the second for crt1.o from libc.a. 
>I don't see a reference to 'main' anywhere - just '_main' and '___main'.

Me neither, so apparently something else is wrong. Okay, post these:

Full output of a failed compile, with `-v' switch added, and exact args again.
Assembly output of a *small* compile which fails. Presumably "int main() {
return 0; }" will accomplish that. (Compile with `-S' and post foo.s).

Nate Eldredge
nate AT cartsys DOT com



- Raw text -


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