Cannot export etext or undefined reference to `WinMain@16'

lhall@pop.ma.ultranet.com lhall@pop.ma.ultranet.com
Mon Oct 28 20:01:00 GMT 2002


See the FAQ entry:

Why the undefined reference to `WinMain@16'?
http://cygwin.com/faq/faq_4.html#SEC92

Larry

Original Message:
-----------------
From: Yingping Zhang yzhang@hum.capsl.udel.edu
Date: Mon, 28 Oct 2002 19:18:41 -0500 (EST)
To: cygwin@cygwin.com
Subject: "Cannot export etext" or undefined reference to `WinMain@16'



Hello all,

When I tried to port a compiler, which is ported from Pro64, from Linux to
Cygwin, I encountered some stinking problems. Please help me to beat them.

At first, when I got all *.o files and tried to build be.so, I got a error
report:

Cannot export etext: symbol not found
collect2: ld returned 1 exit status

I used such options:
-----------------------------------------------------------------------

g++-2 -D_SGI_SOURCE -D_LANGUAGE_C_PLUS_PLUS -Wformat -funsigned-char
-D__GNU_BUG_WORKAROUND -D_NOTHREADS  -D_LEGO_CLONER -DBACK_END -Dlonglong
-DSTD_MONGOOSE_LOC='"/usr/lib32/cmplrs"' -DMONGOOSE_BE -D_LONGLONG
-D_SVR4_SOURCE -D_NEW_SYMTAB -D__MIPS_AND_IA64_ELF_H -I../../be/com
-I../../be/com/arm -I../../be/region ......(omit) -DTARG_ARM
-fwritable-strings  -I../include -O0 -D_MIPSEL -D_LONGLONG
-D_MIPS_SZINT=32 -D_MIPS_SZPTR=32 -D_MIPS_SZLONG=32 -MD  -elf -shared
-o be.so ti_init.o ti_res.o ti_rese.o ......(omit)  config_targ.o
config_elf_targ.o targ_const.o targ_sim.o instr_reader.o  \
        ../targ_info/libtarginfo.a arm.so \
        -o be.so -ldl -lm

-------------------------------------------------------------------------
Next, If I removed the option -shared from above, then the "Cannot export
etext" would not be reported any more, but it will report a new error:

/usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-10/../../../../i686-pc-cygwin/bin/ld:
warning: cannot find entry symbol lf; defaulting to 00401000
/usr/lib/libcygwin.a(libcmain.o)(.text+0x7c): undefined reference to
`WinMain@16'

Anyone has suggestions?
Thanks in advance.

Yvonne




--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


--------------------------------------------------------------------
mail2web - Check your email from the web at
http://mail2web.com/ .



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/



More information about the Cygwin mailing list