Re: gcc linking question
Re: gcc linking question
- Subject: Re: gcc linking question
- From: Steve Checkoway <email@hidden>
- Date: Sat, 3 Nov 2007 00:54:33 -0700
On Nov 2, 2007, at 2:09 PM, mothra wrote:
I get lip from the linker when I do this - it claims that Thing is
an undefined
symbol. Is there a trick to assigning values to variables within the
class
declaration with the gcc that ships with Xcode 2.4 etc? Thanks for
any help!
I believe that the linker is correct here. For once, I don't feel like
digging through the standard, but you declare the static variables in
the class declaration and then in some source file, you define it. E.g.,
// In Merp.h
class Merp
{
// ...
static const double Thing;
};
// In Merp.cpp
const double Merp::Thing = 1.0;
--
Steve Checkoway
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
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