gnustep-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gnustep_base_user_main() question


From: Adrian Robert
Subject: Re: gnustep_base_user_main() question
Date: Fri, 08 Sep 2006 12:30:42 -0400


On Sep 8, 2006, at 11:33 AM, Jeremy Bettis wrote:

Adrian Robert wrote:
Hi,

I'm getting a linking error that I'm trying to track down:

/usr/local/GNUstep/System/Library/Libraries/libgnustep-base.so: undefined reference to `gnustep_base_user_main'

I find that gnustep_base_user_main() is *called* in NSProcessInfo.m, and sometimes when running in a debugger I've seen that the main() function in user code is somehow automagically mapped to this name. Since it seems like that is NOT happening in my case, I was wondering, HOW is this supposed to be done?

I'm not really an expert on the ins and outs of .o and executable file formats, loading, linking, and running, so a simple explanation would be appreciated. ;)
It varies by platform. If your platform doesn't have any better support for getting the arguments and env vars, then NSProcessInfo.h #define's main to gnustep_base_user_main. main is declared in NSProcessInfo.m (or nearby) and it calls your real main (gnustep_base_user_main).

It's messy and icky, and if your platform has a better way of dealing with it, then it should be implemented. As far as I know there are special cases for Linux (all glibc platforms maybe?), Solaris, & Win32 that do not #define main, but use some os specific hacks to get the argument list.

Thanks, that explains everything. (I had missed the #define occurs in GSConfig.h..)







reply via email to

[Prev in Thread] Current Thread [Next in Thread]