Subject: Redefining main()
From: [email-masked] (Scott Christley)

11 Dec 1996 22:06:18 -0800
Sender: [email-masked]
Approved: [email-masked]
Distribution: cygnus
Message-ID: <[email-masked]>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
X-Sender: [email-masked]
X-Mailer: Windows Eudora Light Version 1.5.2
Original-To: Cygnus GNU-WIN32 Discussion <[email-masked]>
Original-Sender: [email-masked]

I'm trying to compile the GNUstep Base Library with B17 and I've run into a
linking problem.  gnustep-base redefines main() for platforms which don't
support adding pre-main initializers (like you can with ELF); gnustep-base
does this:

#define main() gnustep_base_user_main()

Then it supplies its own main().  In this way it can do some processing
before main() is called and call the user's main when its done.  However, it
appears that the linker is taking the main() out of libcygwin.a instead of
the one in libgnustep-base.a; which cause the error below.  Does anybody
know how I can get this to work properly?

gnustep-base/gnustep-base-win32/checks# make nsarray
gcc -c -I../src -I../src/srcdir-include -I./../src  -DHAVE_CONFIG_H -Wall
-Wno-implicit -Wno-format -g -O -Wno-protocol nsarray.m -o nsarray.o
gcc -Wall -Wno-implicit -Wno-format -g -O nsarray.o -o nsarray  -L../src
-lgnustep-base  -lobjc  -lm
/MBCD/Production/Libraries/GNU-WIN32/libcygwin.a(libcmain.o): In function
`main': /pizza/mushroom/noer/beta17/src/winsup/libcmain.cc:30: undefined
reference to `WinMain@16'
make: *** [nsarray] Error 1

thanks
Scott

-
For help on using this list, send a message to
"[email-masked]" with one line of text: "help".