Mail Archives: djgpp/1998/06/03/23:42:12
At 05:20 6/3/1998 EDT, Kbwms AT aol DOT com wrote:
>I am trying to compile and link some C++ code that uses templates.
>At link time I get the following diagnostics:
>
>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'
>
>To get this far I used the following command line:
>
>gcc -o chk.exe -Wall -fguiding-decls -fname-mangling-version-1 *.cpp
^^^^^^^^^^^^^^^^^^^^^^^^^
>
>I know that main is being compiled because I see some warning diagnostics
>regarding comparison between signed and unsigned.
>
>Please tell me what I am doing wrong and how to fix it.
Why do you need to use the special name mangling switch? I suspect that is
causing `main' to be mangled, and so the startup code can't link with it.
Nate Eldredge
nate AT cartsys DOT com
- Raw text -