Re: C++ Linkerproblem: undefined symbols
Re: C++ Linkerproblem: undefined symbols
- Subject: Re: C++ Linkerproblem: undefined symbols
- From: Michael Zehetleitner <email@hidden>
- Date: Wed, 10 May 2006 17:46:18 +0200
That fixed it. Thank you!
Mischa
On May 10, 2006, at 3:27 PM, Steve Baxter wrote:
Is super.cpp definitely in the target?
On 10 May 2006, at 14:08, Michael Zehetleitner wrote:
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
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40improvision.com
This email sent to email@hidden
Steve Baxter
Software Development Manager
Improvision
+44-2476-692229
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden