gcc linking question
gcc linking question
- Subject: gcc linking question
- From: mothra <email@hidden>
- Date: Fri, 2 Nov 2007 16:09:33 -0500
Hi all,
Have searched around for clues to this, but to no avail. The following code used
to compile with older versions of gcc (eg, with Panther). It still compiles with
gcc 4.1.1 on my Fedora system, but appears broken on the current Xcode for 10.4:
--------------------------------------------------------------------------------
#include <iostream>
class Merp{
public:
void Print(){std::cout << Merp::Thing << std::endl;}
private:
const static double Thing = 1.00;
};
int main(){
Merp asdf;
asdf.Print();
}
--------------------------------------------------------------------------------
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!
- Lowell
_______________________________________________
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