S3rgeus
Emperor
Has anyone had any success compiling the DLL with any newer versions of the Visual Studio compiler? I'm not familiar enough with how compiled native binaries interact to say for sure it's possible to do this, since the existing third party libs (FireWorks etc) were built using the older compiler.
So, from a simple "press the button VS gives you" approach, I (strangely) get just one compiler error compiling the BNW DLL with the VS2013 toolchain. The error is an "unable to convert all arguments" in the CvLuaPlayer::lGetTeam function (it can't work out what to do with that call to BasicLuaMethod). I'm not sure why just that one doesn't work, but it's an easy enough fix to change the code to get the team manually like this:
Then it compiles (with many more warnings than the VS2008 compiler gave me) but I get a bunch of linker errors about unresolved external symbols in FireWorks (and some other dependencies). This is what makes me think it might not be possible to do this in the first place, but thought I'd check to see if anyone else has had any success.
The full text of the linker errors:
So, from a simple "press the button VS gives you" approach, I (strangely) get just one compiler error compiling the BNW DLL with the VS2013 toolchain. The error is an "unable to convert all arguments" in the CvLuaPlayer::lGetTeam function (it can't work out what to do with that call to BasicLuaMethod). I'm not sure why just that one doesn't work, but it's an easy enough fix to change the code to get the team manually like this:
Code:
auto* pkPlayer = GetInstance(L);
lua_pushinteger(L, pkPlayer->getTeam());
return 1;
Then it compiles (with many more warnings than the VS2008 compiler gave me) but I get a bunch of linker errors about unresolved external symbols in FireWorks (and some other dependencies). This is what makes me think it might not be possible to do this in the first place, but thought I'd check to see if anyone else has had any success.
The full text of the linker errors:
Spoiler :
Code:
Error 2 error LNK2001: unresolved external symbol "__declspec(dllimport) void __cdecl std::_Throw(class stdext::exception const &)" (__imp_?_Throw@std@@YAXABVexception@stdext@@@Z) E:\Documents\Coding\CivMods\DLL\CvGameCoreDLL_Expansion2\CvWorldBuilderMapWin32.lib(CvWorldBuilderMap.obj) CvGameCoreDLL_Expansion2
Error 3 error LNK2001: unresolved external symbol "__declspec(dllimport) protected: char const * __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::_Myptr(void)const " (__imp_?_Myptr@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@IBEPBDXZ) E:\Documents\Coding\CivMods\DLL\CvGameCoreDLL_Expansion2\CvWorldBuilderMapWin32.lib(CvWorldBuilderMap.obj) CvGameCoreDLL_Expansion2
Error 4 error LNK2001: unresolved external symbol "__declspec(dllimport) public: class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > & __thiscall std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> >::operator=(wchar_t const *)" (__imp_??4?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEAAV01@PB_W@Z) E:\Documents\Coding\CivMods\DLL\CvGameCoreDLL_Expansion2\CvGameCoreDLLUtilWin32.lib(CvStringUtils.obj) CvGameCoreDLL_Expansion2
Error 5 error LNK2001: unresolved external symbol "__declspec(dllimport) public: unsigned int __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::size(void)const " (__imp_?size@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIXZ) E:\Documents\Coding\CivMods\DLL\CvGameCoreDLL_Expansion2\CvGameCoreDLLUtilWin32.lib(CvStringUtils.obj) CvGameCoreDLL_Expansion2
Error 6 error LNK2001: unresolved external symbol "__declspec(dllimport) public: unsigned int __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::size(void)const " (__imp_?size@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIXZ) E:\Documents\Coding\CivMods\DLL\CvGameCoreDLL_Expansion2\FireWorksWin32.lib(FDataStream.obj) CvGameCoreDLL_Expansion2
Error 7 error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> >::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> >(void)" (__imp_??0?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAE@XZ) E:\Documents\Coding\CivMods\DLL\CvGameCoreDLL_Expansion2\CvGameCoreDLLUtilWin32.lib(CvStringUtils.obj) CvGameCoreDLL_Expansion2
Error 8 error LNK2001: unresolved external symbol "__declspec(dllimport) public: wchar_t const * __thiscall std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> >::c_str(void)const " (__imp_?c_str@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QBEPB_WXZ) E:\Documents\Coding\CivMods\DLL\CvGameCoreDLL_Expansion2\CvGameCoreDLLUtilWin32.lib(CvStringUtils.obj) CvGameCoreDLL_Expansion2
Error 9 error LNK2001: unresolved external symbol "__declspec(dllimport) public: wchar_t const * __thiscall std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> >::c_str(void)const " (__imp_?c_str@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QBEPB_WXZ) E:\Documents\Coding\CivMods\DLL\CvGameCoreDLL_Expansion2\FireWorksWin32.lib(FDataStream.obj) CvGameCoreDLL_Expansion2
Error 10 error LNK2001: unresolved external symbol "__declspec(dllimport) public: unsigned int __thiscall std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> >::size(void)const " (__imp_?size@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QBEIXZ) E:\Documents\Coding\CivMods\DLL\CvGameCoreDLL_Expansion2\CvGameCoreDLLUtilWin32.lib(CvStringUtils.obj) CvGameCoreDLL_Expansion2
Error 11 error LNK2001: unresolved external symbol "__declspec(dllimport) public: unsigned int __thiscall std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> >::size(void)const " (__imp_?size@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QBEIXZ) E:\Documents\Coding\CivMods\DLL\CvGameCoreDLL_Expansion2\FireWorksWin32.lib(FDataStream.obj) CvGameCoreDLL_Expansion2
Error 12 error LNK2001: unresolved external symbol "__declspec(dllimport) protected: wchar_t const * __thiscall std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> >::_Myptr(void)const " (__imp_?_Myptr@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@IBEPB_WXZ) E:\Documents\Coding\CivMods\DLL\CvGameCoreDLL_Expansion2\FireWorksWin32.lib(FDataStream.obj) CvGameCoreDLL_Expansion2
Error 13 error LNK2001: unresolved external symbol "__declspec(dllimport) public: class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > & __thiscall std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> >::assign(wchar_t const *,unsigned int)" (__imp_?assign@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEAAV12@PB_WI@Z) E:\Documents\Coding\CivMods\DLL\CvGameCoreDLL_Expansion2\FireWorksWin32.lib(FDataStream.obj) CvGameCoreDLL_Expansion2
Error 14 error LNK2001: unresolved external symbol "__declspec(dllimport) public: wchar_t const * __thiscall std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> >::data(void)const " (__imp_?data@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QBEPB_WXZ) E:\Documents\Coding\CivMods\DLL\CvGameCoreDLL_Expansion2\FireWorksWin32.lib(FDataStream.obj) CvGameCoreDLL_Expansion2
Error 15 error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __thiscall std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> >::clear(void)" (__imp_?clear@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEXXZ) E:\Documents\Coding\CivMods\DLL\CvGameCoreDLL_Expansion2\FireWorksWin32.lib(FDataStream.obj) CvGameCoreDLL_Expansion2
Error 16 error LNK2001: unresolved external symbol "__declspec(dllimport) public: char const * __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::data(void)const " (__imp_?data@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEPBDXZ) E:\Documents\Coding\CivMods\DLL\CvGameCoreDLL_Expansion2\FireWorksWin32.lib(FDataStream.obj) CvGameCoreDLL_Expansion2
Error 17 error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::clear(void)" (__imp_?clear@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXXZ) E:\Documents\Coding\CivMods\DLL\CvGameCoreDLL_Expansion2\FireWorksWin32.lib(FDataStream.obj) CvGameCoreDLL_Expansion2
Error 18 error LNK2001: unresolved external symbol "__declspec(dllimport) bool __cdecl std::operator==<char,struct std::char_traits<char>,class std::allocator<char> >(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_??$?8DU?$char_traits@D@std@@V?$allocator@D@1@@std@@YA_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@0@Z) E:\Documents\Coding\CivMods\DLL\CvGameCoreDLL_Expansion2\FireWorksWin32.lib(FAutoArchive.obj) CvGameCoreDLL_Expansion2
Error 19 error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::push_back(char)" (__imp_?push_back@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXD@Z) E:\Documents\Coding\CivMods\DLL\CvGameCoreDLL_Expansion2\FireWorksWin32.lib(FStlContainerSerialization.obj) CvGameCoreDLL_Expansion2
Error 20 error LNK2001: unresolved external symbol "__declspec(dllimport) public: class std::_String_const_iterator<char,struct std::char_traits<char>,class std::allocator<char> > __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::end(void)const " (__imp_?end@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBE?AV?$_String_const_iterator@DU?$char_traits@D@std@@V?$allocator@D@2@@2@XZ) E:\Documents\Coding\CivMods\DLL\CvGameCoreDLL_Expansion2\FireWorksWin32.lib(FStlContainerSerialization.obj) CvGameCoreDLL_Expansion2
Error 21 error LNK2001: unresolved external symbol "__declspec(dllimport) public: class std::_String_const_iterator<char,struct std::char_traits<char>,class std::allocator<char> > __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::begin(void)const " (__imp_?begin@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBE?AV?$_String_const_iterator@DU?$char_traits@D@std@@V?$allocator@D@2@@2@XZ) E:\Documents\Coding\CivMods\DLL\CvGameCoreDLL_Expansion2\FireWorksWin32.lib(FStlContainerSerialization.obj) CvGameCoreDLL_Expansion2
Error 22 error LNK1120: 17 unresolved externals E:\Documents\Coding\CivMods\DLL\\BuildOutput\VS2013_ModDebugWin32\\CvGameCore_Expansion2.dll CvGameCoreDLL_Expansion2