I’m trying to build a project using ofxLibRocket (https://github.com/underdoeg/ofxLibRocket) in Visual Studio 2010 but keep running into issues.
I’ve followed the general structure for including addons - create an “ofxLibRocket” filter under the “addons” filter and add the “src” and “libs” directories. For the “libs” directory, I’ve only added the directories within the “include” sub-directory.
I’ve got all of the ofxLibRocket\libs\libRocket\include directories as part of my Additional Include Directories and have the included .lib files under ofxLibRocket\libs\libRocket\lib\vs2010 set as Additional Dependencies in my linker.
However, I get the following types of errors when compiling:
2>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(19): error C2039: 'acosf' : is not a member of '`global namespace''
2>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(19): error C2873: 'acosf' : symbol cannot be used in a using-declaration
2>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(19): error C2039: 'asinf' : is not a member of '`global namespace''
2>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(19): error C2873: 'asinf' : symbol cannot be used in a using-declaration
2>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(20): error C2039: 'atanf' : is not a member of '`global namespace''
2>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(20): error C2873: 'atanf' : symbol cannot be used in a using-declaration
2>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(20): error C2039: 'atan2f' : is not a member of '`global namespace''
2>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(20): error C2873: 'atan2f' : symbol cannot be used in a using-declaration
2>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(20): error C2039: 'ceilf' : is not a member of '`global namespace''
2>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(20): error C2873: 'ceilf' : symbol cannot be used in a using-declaration
2>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(21): error C2039: 'cosf' : is not a member of '`global namespace''
2>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(21): error C2873: 'cosf' : symbol cannot be used in a using-declaration
2>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(21): error C2039: 'coshf' : is not a member of '`global namespace''
2>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(21): error C2873: 'coshf' : symbol cannot be used in a using-declaration
2>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(21): error C2039: 'expf' : is not a member of '`global namespace''
2>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(21): error C2873: 'expf' : symbol cannot be used in a using-declaration
2>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(22): error C2039: 'fabsf' : is not a member of '`global namespace''
2>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(22): error C2873: 'fabsf' : symbol cannot be used in a using-declaration
2>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(22): error C2039: 'floorf' : is not a member of '`global namespace''
2>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(22): error C2873: 'floorf' : symbol cannot be used in a using-declaration
I thought that this may be an issue because ofxLibRocket library contains a file called Math.h and I thought the compiler was getting confused. However, when I removed the references to the “libs” directory, I get the following errors:
1> Generating Code...
1> Creating library bin\emptyExample_debug.lib and object bin\emptyExample_debug.exp
1>MSVCRTD.lib(cinitexe.obj) : warning LNK4098: defaultlib 'msvcrt.lib' conflicts with use of other libs; use /NODEFAULTLIB:library
1>ofxLibRocketControls.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: bool __thiscall Rocket::Core::StringBase<char>::operator==(char const *)const " (__imp_??8?$StringBase@D@Core@Rocket@@QBE_NPBD@Z) referenced in function "private: virtual void __thiscall ofxLibRocketButton::ProcessRocketEvent(class Rocket::Core::Event &)" (?ProcessRocketEvent@ofxLibRocketButton@@EAEXAAVEvent@Core@Rocket@@@Z)
1>ofxLibRocketElement.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: bool __thiscall Rocket::Core::StringBase<char>::operator==(char const *)const " (__imp_??8?$StringBase@D@Core@Rocket@@QBE_NPBD@Z)
1>ofxLibRocketControls.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: bool __thiscall Rocket::Core::StringBase<char>::operator<(char const *)const " (__imp_??M?$StringBase@D@Core@Rocket@@QBE_NPBD@Z) referenced in function "public: bool __thiscall Rocket::Core::StringBase<char>::operator<(class Rocket::Core::StringBase<char> const &)const " (??M?$StringBase@D@Core@Rocket@@QBE_NABV012@@Z)
1>ofxLibRocketElement.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: bool __thiscall Rocket::Core::StringBase<char>::operator<(char const *)const " (__imp_??M?$StringBase@D@Core@Rocket@@QBE_NPBD@Z)
1>ofxLibRocketCustomElement.obj : error LNK2001: unresolved external symbol "protected: virtual bool __thiscall Rocket::Core::Element::IsLayoutDirty(void)" (?IsLayoutDirty@Element@Core@Rocket@@MAE_NXZ)
1>ofxLibRocketCustomElement.obj : error LNK2001: unresolved external symbol "protected: virtual void __thiscall Rocket::Core::Element::LockLayout(bool)" (?LockLayout@Element@Core@Rocket@@MAEX_N@Z)
1>bin\emptyExample_debug.exe : fatal error LNK1120: 4 unresolved externals
But those make me think that the “libs” directory is needed - so the viscous cycle continues. If anyone has been able to successfully build a project using ofxLibRocket, could you please help me out?
Thanks!