Symbol Lookup Error When Executing Main

Started by
4 comments, last by fireshadow4126 11 years, 10 months ago
Hello,

I'm working on my game framework in C++. It is composed of a shared library containing all the features and an executable used to test the features (The executable will eventually become a working game).

The library and executable both compile and link fine, but when I try to execute it, I get this error:


main/bin/debug/main: symbol lookup error: main/bin/debug/main: undefined symbol: _ZN7Survive8Graphics4TwoD6SpriteC1Ev


Survive::Graphics::TwoD::Sprite is a sprite class for 2D images.

I'm wondering, what would cause this error?

Sprite and Graphics2D, a class used to draw to a given Sprite, are both defined in Sprite.hpp and implemented in their respective .cpp files. Could this be a cause of the problem?

Otherwise, what would cause this?

Thanks in advance!
"Welcome to the desert of the real." -- Morpheus, The Matrix.
Advertisement
Are you positive you've included all the appropriate .cpp modules in your shared library? Do you in fact have a definition for [font=courier new,courier,monospace]Survive::Graphics::TwoD::Sprite::Sprite()[/font] in the appropriate .cpp file?

Stephen M. Webb
Professional Free Software Developer

Yes, I use premake to generate my make files, and I generated them again, so all .cpp modules are included in the shared library.

And yes, there is a constructor for Sprite that takes no arguments defined in Sprite.cpp.
"Welcome to the desert of the real." -- Morpheus, The Matrix.
(Sigh). I think this might be the wrong forum for this, I'll try General Programming.

EDIT: Scratch that, I didn't know you couldn't "double post."
"Welcome to the desert of the real." -- Morpheus, The Matrix.
Make sure that the executable and shared library are in the same directory, and that you are running the executable manually, and not through the IDE.
I'm on Ubuntu and I use the command line. I've been able to run the executable with the shared library before, and I haven't changed the locations of either, I just added the Sprite, Graphics2D, etc to the library. So the locations of the executable and the shared library aren't the problem.
"Welcome to the desert of the real." -- Morpheus, The Matrix.

This topic is closed to new replies.

Advertisement