Hi there,
my problem has boiled down to an xcode problem, because the code I wrote works e.g. on Visual Studio.
I wrote a very simple class: Super with one attribute one getter, one setter method and a constructor. Just creating one instance of Super causes a linker: undefined Symbol Super::Super() error. I checked the same code on visual studio and it works there.
Unfortunately I'm new to C++ programming and xCode, so I will consult this mailing list. Help is appreciated.
Take care, Mischa
This is the main code: #include "Super.h" #include<iostream> using namespace std;
int main(){ Super sup; return(0); }
This is the Super.h:
class Super{ public: int getX() const; void setX(int); Super();
private: int x;
};
This is the Super.cpp: #include "Super.h" using namespace std;
int Super::getX() const {return x;} void Super::setX(int X){x = X;}
Super::Super(){ x = 0; }
Finally: this is my build result:
/usr/bin/ld: Undefined symbols: Super::Super() collect2: ld returned 1 exit status /usr/bin/ld: Undefined symbols: Super::Super() collect2: ld returned 1 exit status |