Mail Archives: djgpp/2002/11/08/13:45:03
Charles Wilkins <chas AT pcscs DOT com> wrote:
: On Fri, 08 Nov 2002 11:33:22 -0500, Charles Wilkins <chas AT pcscs DOT com>
: wrote:
:>Given the case for linux host crosscompiler i686-pc-msdosdjgpp-gcc..
:>
:>i686-pc-msdosdjgpp-gcc -Wl,--verbose
:>
:>(/usr/local/compiler/cross/djgpp/lib/gcc-lib/i686-pc-msdosdjgpp/3.2/../../../../i6/usr/local/compiler/cross/djgpp/lib/gcc-lib/i686-pc-msdosdjgpp/3.2/../../../../i686-pc-msdosdjgpp/lib/crt0.o(.data+0xc2):crt0.s:
:>undefined reference to `_main'
:>
:>/usr/local/compiler/cross/djgpp/lib/gcc-lib/i686-pc-msdosdjgpp/3.2/../../../../i686-pc-msdosdjgpp/lib/libc.a(crt1.o)(.text+0x404):crt1.c:
:>undefined reference to `_main'
:>
:>** Notice the mangled path above ~/../i6/usr/local/~
: ok it seems the output was simply piped out of order, but the question
: still remains as to what could be causing the undefined reference.
: I assume that the output should be read as:
: (/usr/local/compiler/cross/djgpp/lib/gcc-lib/i686-pc-msdosdjgpp/3.2/../../../../i686-pc-msdosdjgpp/lib/libc.a)fflush.o
: /usr/local/compiler/cross/djgpp/lib/gcc-lib/i686-pc-msdosdjgpp/3.2/../../../../i686-pc-msdosdjgpp/lib/crt0.o(.data+0xc2):crt0.s:
: undefined reference to `_main'
: /usr/local/compiler/cross/djgpp/lib/gcc-lib/i686-pc-msdosdjgpp/3.2/../../../../i686-pc-msdosdjgpp/lib/libc.a(crt1.o)(.text+0x404):crt1.c:
: undefined reference to `_main'
You didn't say what you are compiling. Giving us the command line that
resulted in this would be benificial.
As far as I can see whatever you're compiling/linking don't have a
main() function.
You might have the problem of not having an "_" in front of every C
identifier.
Find the .o where the main() is supposed to be and run "nm" on it. It
should say "<number> T _main" or some thing like that, not "<number> T
main".
Right,
MartinS
- Raw text -