• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
C++ Linkerproblem: undefined symbols
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

C++ Linkerproblem: undefined symbols


  • Subject: C++ Linkerproblem: undefined symbols
  • From: Michael Zehetleitner <email@hidden>
  • Date: Wed, 10 May 2006 15:08:56 +0200

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:

This email sent to email@hidden

  • Follow-Ups:
    • Re: C++ Linkerproblem: undefined symbols
      • From: Steve Baxter <email@hidden>
  • Prev by Date: Re: Still having problems with Undefined symbols
  • Next by Date: Re: C++ Linkerproblem: undefined symbols
  • Previous by thread: More on Still cannot get it to link - please help.
  • Next by thread: Re: C++ Linkerproblem: undefined symbols
  • Index(es):
    • Date
    • Thread