Linking Errors with C++ in Xcode

Filed under Programming on Tuesday, 5 August, 2008 1:57 am

If you’re programming C++ classes and happen to get a linking error similar to this:

ld: symbol(s) not found
collect2: ld returned 1 exit status
“RTSUserInterface::UserInterface::UserInterface()”, referenced from:
RTSnamespace::MainMenu::MainMenu()in mainMenu.o
RTSnamespace::MainMenu::MainMenu()in mainMenu.o
“RTSUserInterface::UserInterface::~UserInterface()”, referenced from:
RTSnamespace::MainMenu::MainMenu()in mainMenu.o
RTSnamespace::MainMenu::MainMenu()in mainMenu.o
RTSnamespace::MainMenu::~MainMenu()in mainMenu.o
RTSnamespace::MainMenu::~MainMenu()in mainMenu.o
RTSnamespace::MainMenu::~MainMenu()in mainMenu.o
RTSnamespace::MainMenu::~MainMenu()in mainMenu.o
RTSnamespace::MainMenu::~MainMenu()in mainMenu.o
RTSnamespace::MainMenu::~MainMenu()in mainMenu.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
Build failed (2 errors)

The problem is that you haven’t written the body for your class constructors and destructors in your implemenation (.cpp) file. I consider this a reminder.

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a comment

You must be logged in to post a comment.