delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1996/12/11/22:06:18

From: scottc AT net-community DOT com (Scott Christley)
Subject: Redefining main()
11 Dec 1996 22:06:18 -0800 :
Sender: daemon AT cygnus DOT com
Approved: cygnus DOT gnu-win32 AT cygnus DOT com
Distribution: cygnus
Message-ID: <199612111729.JAA12039.cygnus.gnu-win32@stetson.net-community.com>
Mime-Version: 1.0
X-Sender: scottc AT net-community DOT com
X-Mailer: Windows Eudora Light Version 1.5.2
Original-To: Cygnus GNU-WIN32 Discussion <gnu-win32 AT cygnus DOT com>
Original-Sender: owner-gnu-win32 AT cygnus DOT 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 AT 16'
make: *** [nsarray] Error 1

thanks
Scott

-
For help on using this list, send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019