Re: getting undefined symbol when I do not initialize global variable
Re: getting undefined symbol when I do not initialize global variable
- Subject: Re: getting undefined symbol when I do not initialize global variable
- From: Jens Alfke <email@hidden>
- Date: Mon, 19 Oct 2009 07:46:41 -0700
On Oct 19, 2009, at 1:18 AM, rohan a wrote:
There are a set of global variables used. When these are not
initialized I get the linking error : Undefined symbols
What do you mean by "not initialized"? If you have a definition of the
variable, just with no value:
int gFoo;
then the link error is definitely unexpected. (Is that source file in
your target?)
But if you don't have any non-extern declaration of the variable, then
the linker is correct. Extern declarations are just a promise that you
will actually define the variable somewhere else.
—Jens
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden