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?
Here's the code to Main.cpp:
#include "system/App.hpp"
#include "graphics/2d/Sprite.hpp"
#include "game/2d/Entity2D.hpp"
#include <iostream>
using namespace Survive::System;
using namespace Survive::Graphics;
using namespace Survive::Graphics::TwoD;
using namespace Survive::Game::TwoD;
int main(int argc, char* argv[]) {
App *theApp = AppSingleton::instance();
Entity2D entity;
Graphics2D *gr = entity.create(100, 100);
if (gr) {
gr->beginDrawing();
gr->pixelRGB(50, 50, 255, 1, 1);
gr->endDrawing();
}
entity.setPosition(20, 20);
theApp->addEntity(entity);
return theApp->onExecute();
}
Some additional details:
Any suggestions on how to fix this?
Note: I have no idea where this might originate, so if further code is necessary to find what's causing this, please tell me.
Thanks in advance!