From: scottc@net-community.com (Scott Christley)
Subject: Redefining main()
11 Dec 1996 22:06:18 -0800
Sender: daemon@cygnus.com
Approved: cygnus.gnu-win32@cygnus.com
Distribution: cygnus
Message-ID: <199612111729.JAA12039.cygnus.gnu-win32@stetson.net-community.com>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
X-Sender: scottc@net-community.com
X-Mailer: Windows Eudora Light Version 1.5.2
Original-To: Cygnus GNU-WIN32 Discussion <gnu-win32@cygnus.com>
Original-Sender: owner-gnu-win32@cygnus.com


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
"gnu-win32-request@cygnus.com" with one line of text: "help".
