Jump to content

  • Log In with Google      Sign In   
  • Create Account

Symbol Lookup Error When Executing Main


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
5 replies to this topic

#1 fireshadow4126   Members   -  Reputation: 113

Like
0Likes
Like

Posted 20 June 2012 - 10:51 AM

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.

Sponsor:

#2 Bregma   Crossbones+   -  Reputation: 5133

Like
0Likes
Like

Posted 20 June 2012 - 11:05 AM

Are you positive you've included all the appropriate .cpp modules in your shared library? Do you in fact have a definition for Survive::Graphics::TwoD::Sprite::Sprite() in the appropriate .cpp file?
Stephen M. Webb
Professional Free Software Developer

#3 fireshadow4126   Members   -  Reputation: 113

Like
0Likes
Like

Posted 20 June 2012 - 11:08 AM

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.

#4 fireshadow4126   Members   -  Reputation: 113

Like
0Likes
Like

Posted 21 June 2012 - 10:33 AM

(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."

Edited by fireshadow4126, 21 June 2012 - 10:51 AM.

"Welcome to the desert of the real." -- Morpheus, The Matrix.

#5 turch   Members   -  Reputation: 590

Like
0Likes
Like

Posted 22 June 2012 - 08:02 AM

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.

#6 fireshadow4126   Members   -  Reputation: 113

Like
0Likes
Like

Posted 22 June 2012 - 08:52 AM

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.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS