Linkage Problem


17-03-2010 00:23:14

Hi guys,

I am new to MyGUI been using CEGUI for a while and it seems like a good choice.

I am getting a linkage error and unsure what is causing it

1>LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library
1>CTitleGameScreen.obj : error LNK2001: unresolved external symbol "public: __thiscall MyGUI::OgreRenderManager::OgreRenderManager(void)" (??0OgreRenderManager@MyGUI@@QAE@XZ)
1>CTitleGameScreen.obj : error LNK2001: unresolved external symbol "public: __thiscall MyGUI::OgreDataManager::OgreDataManager(void)" (??0OgreDataManager@MyGUI@@QAE@XZ)
1>C:\Development\MobAttack\Release\MobAttackClient.exe : fatal error LNK1120: 2 unresolved externals

It happens when i use this code.

//set the scene manager and camera here.
SceneManager *sceneMgr = CMobAttackClientApplication::GetInstance()->GetRoot()->createSceneManager(Ogre::ST_GENERIC);
Camera *mainCam = sceneMgr->createCamera("MainCam");
mViewport = CMobAttackClientApplication::GetInstance()->GetRenderWindow()->addViewport(mainCam);

//testing using mygui.
MyGUI::Gui * mGUI;

MyGUI::OgrePlatform* mPlatform = new MyGUI::OgrePlatform();

Looks like something simple like i forgot to include the library but I did not.
I am linking to MyGUIEngine.lib, and i tested the header files to make sure the compiler is finding them.

I have

#include "MyGUI.h"
#include "MyGUI_OgrePlatform.h"

at the top so i know they are working correctly atleast.

I am using version 3.0 with ogre 1.7.

Hopefully this is something simple that i am overlooking.

Thanks for your help!


17-03-2010 00:46:02

You also need to link MyGUI.OgrePlatform.lib to your application.


17-03-2010 01:07:27

ahh thanks i will try that :)