[Solved] Visual Studio question
Posted: Thu Apr 29, 2010 8:42 pm
I've run into a bit of a snag.
To date, I've been working on my tile engine and this has been going pretty well. I'm at the point now where I'd like to build out the map editor so I can stop fiddling bits in map files by hand. Seems straight forward and I thought I had a good game plan.
I'm trying to write the engine following OOP methods as much as possible. So far I've only strayed from that goal when I got too carried away.
I'm using Visual C++ 2008 Express. I have one solution file. In that solution I have my engine project. (I cheated and put the game code in the engine project as well.) Now that I can fire up SDL and get the map and tiles loaded, and can move my player around the screen under camera control, I've decided to work the map editor.
So, I added a project to my solution file. Since I want to use the code base from my engine to drive portions of the map editor (rather than code from scratch), I've #included the necessary headers to my map editor. I can get the bare main() to compile. But I get link errors (LNK2019 specifically). I know why... the linker can't find the obj code needed by my engine.init_engine() call and so on.
But how the hell do I tell it where to find them? I don't have that stuff in a .lib or .dll or anything like that, but those are the only "solutions" I found on my google explorations.
Any suggestions are greatly appreciated!
-captjack
To date, I've been working on my tile engine and this has been going pretty well. I'm at the point now where I'd like to build out the map editor so I can stop fiddling bits in map files by hand. Seems straight forward and I thought I had a good game plan.
I'm trying to write the engine following OOP methods as much as possible. So far I've only strayed from that goal when I got too carried away.
I'm using Visual C++ 2008 Express. I have one solution file. In that solution I have my engine project. (I cheated and put the game code in the engine project as well.) Now that I can fire up SDL and get the map and tiles loaded, and can move my player around the screen under camera control, I've decided to work the map editor.
So, I added a project to my solution file. Since I want to use the code base from my engine to drive portions of the map editor (rather than code from scratch), I've #included the necessary headers to my map editor. I can get the bare main() to compile. But I get link errors (LNK2019 specifically). I know why... the linker can't find the obj code needed by my engine.init_engine() call and so on.
Code: Select all
#include "../sword/SwordEngine.h"
#include "../sword/Common.h"
int main(int argc, char* argv[])
{
CSwordEngine engine(ENGINE_MAX_X, ENGINE_MAX_Y, ENGINE_BPP);
engine.init_engine();
engine.set_window_title("Map Editor");
engine.start_main_loop();
return 0;
}
Code: Select all
1>main.obj : error LNK2019: unresolved external symbol "public: void __thiscall CEngine::start_main_loop(void)" (?start_main_loop@CEngine@@QAEXXZ) referenced in function _SDL_main
snip snip snip
1>C:\Visual Studio\Projects\sword\Debug\mapedit.exe : fatal error LNK1120: 5 unresolved externals
Any suggestions are greatly appreciated!
-captjack