🔒 Locked
🤖 Godot
Can't compile Ogre3D code
Advertisement
Original Post
Hi there! Well it's my first time using Ogre3D and I got stuck right on the beginning XD I can't compile the test code shown at http://www.ogre3d.org/wiki/index.php/SettingUpAnApplication I followed the whole properties setting for Visual C++ Express and got the following mistakes: 1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static class OIS::InputManager * __cdecl OIS::InputManager::createInputSystem(class std::multimap,class std::allocator >,class std::basic_string,class std::allocator >,struct std::less,class std::allocator > >,class std::allocator,class std::allocator > const ,class std::basic_string,class std::allocator > > > > &)" (__imp_?createInputSystem@InputManager@OIS@@SAPAV12@AAV?$multimap@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V12@U?$less@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@V?$allocator@U?$pair@$$CBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V12@@std@@@2@@std@@@Z) referenced in function "public: __thiscall ExampleFrameListener::ExampleFrameListener(class Ogre::RenderWindow *,class Ogre::Camera *,bool,bool,bool)" (??0ExampleFrameListener@@QAE@PAVRenderWindow@Ogre@@PAVCamera@2@_N22@Z) 1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: struct OIS::MouseState const & __thiscall OIS::Mouse::getMouseState(void)const " (__imp_?getMouseState@Mouse@OIS@@QBEABUMouseState@2@XZ) referenced in function "public: virtual void __thiscall ExampleFrameListener::windowResized(class Ogre::RenderWindow *)" (?windowResized@ExampleFrameListener@@UAEXPAVRenderWindow@Ogre@@@Z) 1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static void __cdecl OIS::InputManager::destroyInputSystem(class OIS::InputManager *)" (__imp_?destroyInputSystem@InputManager@OIS@@SAXPAV12@@Z) referenced in function "public: virtual void __thiscall ExampleFrameListener::windowClosed(class Ogre::RenderWindow *)" (?windowClosed@ExampleFrameListener@@UAEXPAVRenderWindow@Ogre@@@Z) 1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: bool __thiscall OIS::MouseState::buttonDown(enum OIS::MouseButtonID)const " (__imp_?buttonDown@MouseState@OIS@@QBE_NW4MouseButtonID@2@@Z) referenced in function "public: bool __thiscall ExampleFrameListener::processUnbufferedMouseInput(struct Ogre::FrameEvent const &)" (?processUnbufferedMouseInput@ExampleFrameListener@@QAE_NABUFrameEvent@Ogre@@@Z) 1>C:\Documents and Settings\carol\Meus documentos\Visual Studio 2005\Projects\Ogre3D_Test\Ogre3D_Test\bin\debug\Ogre3D_Test.exe : fatal error LNK1120: 4 unresolved externals It´s a big mess but in fact only 5 errors >.> I believe I´m not linking stuff properly though I did exactly what the tutorial said. So if someone could help, that would be appreciated =) Thanks in advance, Carol
Are you using Eihort (ogre 1.4)? Those errors are from OIS, which is the native input system in 1.4. Did you already compile OIS and import the libs? If you're new to ogre you also might want to start with version 1.2.5 (Dagon) since much of the wiki is for the current version. I haven't tried Eihort yet, but I've had almost no issues with 1.2.5 (aside from the usual 'duh!' mistakes).
Yeah, I´m using Eihort. But since I downloaded the pre-built SDK and it installed itself, I shoudn't worry about compiling, right? And I set all properties exactly like it is said in the Wiki:
Configure your project with the following settings. All of these are for the Debug configuration. To set up the Release configuration just change the directories from '\Debug\' to '\Release\'. Select "project properties" and under "configuration properties" add the following:
Debugging : Working Directory = ..\bin\Debug
C/C++ : Preprocessor : Preprocessor Definitions += _STLP_DEBUG (only in Debug mode, not needed for .Net 2003 and 2005)
C/C++ : Code Generation : Use runtime library = Multithreaded Debug DLL (Multithreaded DLL in Release)
Linker : General : Output File = ..\bin\Debug\[appname].exe
Linker : Input : Additional Dependencies += OgreMain_d.lib (OgreMain.lib in Release)
And, for those using the SDK:
C/C++ : General : Additional Include Directories = ..\include;$(OGRE_HOME)\include;$(OGRE_HOME)\samples\include
Linker : General : Additional Library Directories = $(OGRE_HOME)\lib
Configure your project with the following settings. All of these are for the Debug configuration. To set up the Release configuration just change the directories from '\Debug\' to '\Release\'. Select "project properties" and under "configuration properties" add the following:
Debugging : Working Directory = ..\bin\Debug
C/C++ : Preprocessor : Preprocessor Definitions += _STLP_DEBUG (only in Debug mode, not needed for .Net 2003 and 2005)
C/C++ : Code Generation : Use runtime library = Multithreaded Debug DLL (Multithreaded DLL in Release)
Linker : General : Output File = ..\bin\Debug\[appname].exe
Linker : Input : Additional Dependencies += OgreMain_d.lib (OgreMain.lib in Release)
And, for those using the SDK:
C/C++ : General : Additional Include Directories = ..\include;$(OGRE_HOME)\include;$(OGRE_HOME)\samples\include
Linker : General : Additional Library Directories = $(OGRE_HOME)\lib
This is why I use Irrlicht instead. It is missing features but is much easier to compile. But I have understood that when you finally can get Ogre3d to work, it is the best engine out there for graphics and price. Irrlicht is easier to use, but at least at this point, it isn't as capable as ogre3d.
It looks like you didn't import the OIS library. You need this in there:
linker->general->additional library directories: $(OIS_HOME)\lib
linker->input->additional dependencies: OIS.lib
Make sure 'OIS_HOME' is a valid environmental variable (or just use whatever directory the OIS.lib file is on your computer). Also, have you successfully compiled the demos that come with the SDK? This should help you make sure the environment is configured correctly before you write your own code. Ogre can have somewhat of a learning curve due to all the dependencies it has for various features. After you get over that, its actually a very nice engine to work with. If that still doesn't fix the problem you might want to do a search on the ogre forums, I'm sure theres a thread on there somewhere that could help.
linker->general->additional library directories: $(OIS_HOME)\lib
linker->input->additional dependencies: OIS.lib
Make sure 'OIS_HOME' is a valid environmental variable (or just use whatever directory the OIS.lib file is on your computer). Also, have you successfully compiled the demos that come with the SDK? This should help you make sure the environment is configured correctly before you write your own code. Ogre can have somewhat of a learning curve due to all the dependencies it has for various features. After you get over that, its actually a very nice engine to work with. If that still doesn't fix the problem you might want to do a search on the ogre forums, I'm sure theres a thread on there somewhere that could help.
Well, the test code compiled after I included OIS.lib. BUT when I try to execute it a window pops up saying the application could not be initialized, followed by a weird hex number (0xc150002). The same happens to all sample applications that came with the SDK, though I could properly compile all of them. What should I do? o.O''
Thanks,
Carol
Thanks,
Carol
Quote:
Original post by Carolina
Just as a side note, I decided to change to Irrlicht and indeed it works very well, even with .NET stuff. So no Ogre3D for me now, I guess.
Irrlicht has a pretty good community in its forums(not saying Ogre doesn't), so feel free to visit. Also, PM me if you need any help and I'll see what I can do.
Try using MinGW. VS may have slightly different headers.
Hi Carolina,
I am exactly in the same situation, I can compile but I get a fatal error (hex error) when I execute my .exe file.
I want to work with Ogre, does somebody has a solution?
Thanks,
WonderKetchup
I am exactly in the same situation, I can compile but I get a fatal error (hex error) when I execute my .exe file.
I want to work with Ogre, does somebody has a solution?
Thanks,
WonderKetchup
You need Visual studio service pack 1, that's why it won't run.
It's stated at the download page that 1.4 (eihort) requires that, install the service pack and it will work. As for the OIS library problem, my guess is that you used the appwizard for Ogre 1.2 (dagon), Which doesn't include OIS, as OIS was added in 1.4.
Ogre isn't that complicated to install and use, the community support is amazing too. give it a shot, but read and follow the instructions.
Best Regards and good luck.
EDIT:
btw. Looking at the wiki page you posted a link to, you will find this:
And, for those using Ogre3D 1.4.x
Linker : Input : Additional Dependencies += OIS_d.lib (OIS.lib in Release)
It's stated at the download page that 1.4 (eihort) requires that, install the service pack and it will work. As for the OIS library problem, my guess is that you used the appwizard for Ogre 1.2 (dagon), Which doesn't include OIS, as OIS was added in 1.4.
Ogre isn't that complicated to install and use, the community support is amazing too. give it a shot, but read and follow the instructions.
Best Regards and good luck.
EDIT:
btw. Looking at the wiki page you posted a link to, you will find this:
And, for those using Ogre3D 1.4.x
Linker : Input : Additional Dependencies += OIS_d.lib (OIS.lib in Release)
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement