Sign in to follow this  
Toadhead

Linking errors after changeing directory structure

Recommended Posts

Toadhead    244
I added a few folders in my source directory to keep things clean. I haven't changed anything in the source code except updating the
#include statements for my intern header files. Can someone explain how this can lead to linking errors?

Here are the errors that I get, the source is a little bit too big to post here so I hope this won't be nessacary

[code]
1>------ Build started: Project: Block Rain, Configuration: Debug Win32 ------
1> State_Startup.cpp
1> Generating Code...
1> Compiling...
1> main.cpp
1> StateManager.cpp
1> Generating Code...
1>State_Startup.obj : error LNK2019: unresolved external symbol "public: class GraphicsManager * __thiscall GameEngine::graphicsManager(void)" (?graphicsManager@GameEngine@@QAEPAVGraphicsManager@@XZ) referenced in function "private: virtual void __thiscall State_Startup::Update(class GameEngine *)" (?Update@State_Startup@@EAEXPAVGameEngine@@@Z)
1>main.obj : error LNK2019: unresolved external symbol "public: __thiscall GameEngine::~GameEngine(void)" (??1GameEngine@@QAE@XZ) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "public: void __thiscall GameEngine::Close(void)" (?Close@GameEngine@@QAEXXZ) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "public: bool __thiscall GameEngine::IsRunning(void)" (?IsRunning@GameEngine@@QAE_NXZ) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "public: void __thiscall GameEngine::Init(void)" (?Init@GameEngine@@QAEXXZ) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "public: class EventManager * __thiscall GameEngine::eventManager(void)" (?eventManager@GameEngine@@QAEPAVEventManager@@XZ) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "public: __thiscall GameEngine::GameEngine(void)" (??0GameEngine@@QAE@XZ) referenced in function _main
1>..\Test\Block Rain.exe : fatal error LNK1120: 7 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

[/code]


I think I had something simular in the past, and fixed it by starting a new project and included all source files. Could it be a bug in VS?
Even if the above works, it would be quite alot work to set everything correctly again in the new project file.

EDIT: Guess I'm an idiot, it seems to forgot to add the GameEngine.cpp file to the project.
I doubt there's any learning value for others in this post so it can be deleted by a mod if desired.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this