Strange linker behavior with MyGUI at my project

Human Bug

02-03-2012 00:44:42

Hi,

at first I use MyGui 3.2.0 with Ogre 1.7.1 and Visual Studio C++ Express 2010.
I have a strange compile behavior at debug and a compile problem release.

I have do alle the steps from http://www.ogre3d.org/tikiwiki/MyGUI+quickstart till "create button and set callback:". Until this point everything its fine. It compile and run. But the next line of code MyGUI::ButtonPtr button = mGUI->createWidget<MyGUI::Button>("Button", 10, 10, 300, 26, MyGUI::Align::Default, "Main"); it doesn´t link at debug for the first try and end with this error messages
1>GuiWrapper.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall MyGUI::Align::Align(enum MyGUI::Align::Enum)" (__imp_??0Align@MyGUI@@QAE@W4Enum@01@@Z)
1>GuiWrapper.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class MyGUI::Widget * __thiscall MyGUI::Gui::createWidgetT(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,struct MyGUI::types::TCoord<int> const &,struct MyGUI::Align,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (__imp_?createWidgetT@Gui@MyGUI@@QAEPAVWidget@2@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@0ABU?$TCoord@H@types@2@UAlign@2@00@Z)
1>GuiWrapper.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const & __cdecl MyGUI::Button::getClassTypeName(void)" (__imp_?getClassTypeName@Button@MyGUI@@SAABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ)

If I try to build a second time it compile, run and I see the button. I think that is strange and its reproduce able. I can fix it by the linker option "Enable Incremental Linking: No (/Incremental:NO)".

At release i get every time "fatal error LNK1120: 230 unresolved externals" in the schematic
1>freetype2311.lib(type1.obj) : error LNK2001: unresolved external symbol @__security_check_cookie@4
...
1>MyGUIEngineStatic.lib(MyGUI_ComboBox.obj) : error LNK2001: unresolved external symbol "const type_info::`vftable'" (??_7type_info@@6B@)
...
1>MyGUIEngineStatic.lib(MyGUI_BackwardCompatibility.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) bool __cdecl std::uncaught_exception(void)" (__imp_?uncaught_exception@std@@YA_NXZ)
...


Anyone know what is my mistake?

Best
Human Bug

Altren

02-03-2012 09:36:12

Do you have SP1 installed? I had such problem, when I used Visual Studio C++ Express 2010 without SP1 for it.

Human Bug

02-03-2012 17:20:22

Yes, i have installed Microsoft Visual Studio 2010 Version 10.0.40219.1 SP1Rel.

Altren

02-03-2012 23:13:51

Try to clean and rebuild MyGUI's solution. May be there is something left from previous non-static build.

Human Bug

10-03-2012 13:05:15

Hi,

sorry for the late reply.
Now i have all rebuild and it´s work fine. In the release build it was definitely my mistake. I don´t know why but i have set 2 libraries at 'Ignore Specific Default Libraries".

Best
HumanBug