nathan Posted July 18, 2016 Share Posted July 18, 2016 Hi all, After some issues with the widescreen mod that I never did manage to solve, I've decided to take another crack at GemRB (again, the lure of some of the GemRB specific mods is too great!) I've hit some issues trying to build GemRB 0.8.4 on Windows 7 64 bit. I'm following the guide here: http://www.gemrb.org/wiki/doku.php?id=install:windows All steps have been fine except for step 8; the build doesn't complete successfully, always producing errors when trying to link GuiScript.dll. There's a bunch of undefined errors to what look like Python variables / functions. I've included several of them here (they go on for a while before the build fails): Scanning dependencies of target GUIScript[ 74%] Building CXX object gemrb/plugins/GUIScript/CMakeFiles/GUIScript.dir/GUIScript.cpp.obj[ 74%] Linking CXX shared module ..\GUIScript.dllCMakeFiles\GUIScript.dir/objects.a(PythonHelpers.cpp.obj): In function `ZN5GemRB20PythonObjectCallbackINS_7ControlEEclEPS1_':C:/Users/Nathan.Burns/gemrb_source/gemrb/gemrb/plugins/GUIScript/PythonHelpers.cpp:56: multiple definition of `GemRB::PythonObjectCallback<GemRB::Control>::operator()(GemRB::Control*)'CMakeFiles\GUIScript.dir/objects.a(GUIScript.cpp.obj):C:/Users/Nathan.Burns/gemrb_source/gemrb/gemrb/plugins/GUIScript/PythonHelpers.h:166: first defined hereCMakeFiles\GUIScript.dir/objects.a(PythonHelpers.cpp.obj): In function `ZN5GemRB20PythonObjectCallbackINS_14WindowKeyPressEEclEPS1_':C:/Users/Nathan.Burns/gemrb_source/gemrb/gemrb/plugins/GUIScript/PythonHelpers.cpp:103: multiple definition of `GemRB::PythonObjectCallback<GemRB::WindowKeyPress>::operator()(GemRB::WindowKeyPress*)'CMakeFiles\GUIScript.dir/objects.a(GUIScript.cpp.obj):C:/Users/Nathan.Burns/gemrb_source/gemrb/gemrb/plugins/GUIScript/GUIScript.cpp:593: first defined hereCMakeFiles\GUIScript.dir/objects.a(GUIScript.cpp.obj): In function `GemRB_EnterGame':C:/Users/Nathan.Burns/gemrb_source/gemrb/gemrb/plugins/GUIScript/GUIScript.cpp:594: undefined reference to `_imp___Py_NoneStruct'CMakeFiles\GUIScript.dir/objects.a(GUIScript.cpp.obj): In function `GemRB_QuitGame':C:/Users/Nathan.Burns/gemrb_source/gemrb/gemrb/plugins/GUIScript/GUIScript.cpp:617: undefined reference to `_imp___Py_NoneStruct'CMakeFiles\GUIScript.dir/objects.a(GUIScript.cpp.obj): In function `GemRB_Log':C:/Users/Nathan.Burns/gemrb_source/gemrb/gemrb/plugins/GUIScript/GUIScript.cpp:15240: undefined reference to `_imp___Py_NoneStruct'CMakeFiles\GUIScript.dir/objects.a(GUIScript.cpp.obj): In function `GemRB_Quit':C:/Users/Nathan.Burns/gemrb_source/gemrb/gemrb/plugins/GUIScript/GUIScript.cpp:5687: undefined reference to `_imp___Py_NoneStruct'CMakeFiles\GUIScript.dir/objects.a(GUIScript.cpp.obj): In function `GemRB_UpdateMusicVolume':C:/Users/Nathan.Burns/gemrb_source/gemrb/gemrb/plugins/GUIScript/GUIScript.cpp:9863: undefined reference to `_imp___Py_NoneStruct'CMakeFiles\GUIScript.dir/objects.a(GUIScript.cpp.obj):C:/Users/Nathan.Burns/gemrb_source/gemrb/gemrb/plugins/GUIScript/GUIScript.cpp:9882: more undefined references to `_imp___Py_NoneStruct' followCMakeFiles\GUIScript.dir/objects.a(GUIScript.cpp.obj): In function `AttributeError':C:/Users/Nathan.Burns/gemrb_source/gemrb/gemrb/plugins/GUIScript/GUIScript.cpp:184: undefined reference to `_imp__PyExc_AttributeError'CMakeFiles\GUIScript.dir/objects.a(GUIScript.cpp.obj): In function `GemRB_SetMasterScript':C:/Users/Nathan.Burns/gemrb_source/gemrb/gemrb/plugins/GUIScript/GUIScript.cpp:2407: undefined reference to `_imp___Py_NoneStruct'CMakeFiles\GUIScript.dir/objects.a(GUIScript.cpp.obj): In function `GemRB_SetTooltipDelay':C:/Users/Nathan.Burns/gemrb_source/gemrb/gemrb/plugins/GUIScript/GUIScript.cpp:13938: undefined reference to `_imp___Py_NoneStruct'CMakeFiles\GUIScript.dir/objects.a(GUIScript.cpp.obj): In function `RuntimeError':C:/Users/Nathan.Burns/gemrb_source/gemrb/gemrb/plugins/GUIScript/GUIScript.cpp:169: undefined reference to `_imp__PyExc_RuntimeError' The process seems to find the Python files OK (it gives a different error about not being able to find python.h if I do anything with my C:\Python27 folder), so I'm not sure what the problem is. Any ideas on what's causing this? I've tried with both Python 2.6 and Python 2.7, and tried the fixes suggested here around renaming Python libraries to debug files: http://stackoverflow.com/questions/1236060/compiling-python-modules-whith-debug-defined-on-msvc Thanks Nathan Link to comment
lynx Posted July 18, 2016 Share Posted July 18, 2016 So are you using mingw or msvc? How old? You could try building a debug build. Change the cmake call from: cmake ..\gemrb -G "MinGW Makefiles" ... to cmake ..\gemrb -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Debug ... Link to comment
nathan Posted July 18, 2016 Author Share Posted July 18, 2016 @lynx great quick response, appreciate it. I'm using MinGW, fresh install yesterday from the automated installer here: http://sourceforge.net/projects/mingw/files/Automated%20MinGW%20Installer/mingw-get-inst/ Running cmake in debug gave a slightly different set of errors: [ 74%] Linking CXX shared module ..\GUIScript.dllCMakeFiles\GUIScript.dir/objects.a(PythonHelpers.cpp.obj): In function `ZN5GemRB20PythonObjectCallbackINS_7ControlEEclEPS1_':C:/Users/Nathan.Burns/gemrb_source/gemrb/gemrb/plugins/GUIScript/PythonHelpers.cpp:55: multiple definition of `GemRB::PythonObjectCallback<GemRB::Control>::operator()(GemRB::Control*)'CMakeFiles\GUIScript.dir/objects.a(GUIScript.cpp.obj):C:/Users/Nathan.Burns/gemrb_source/gemrb/gemrb/plugins/GUIScript/PythonHelpers.h:164: first defined hereCMakeFiles\GUIScript.dir/objects.a(PythonHelpers.cpp.obj): In function `ZN5GemRB20PythonObjectCallbackINS_14WindowKeyPressEEclEPS1_':C:/Users/Nathan.Burns/gemrb_source/gemrb/gemrb/plugins/GUIScript/PythonHelpers.cpp:102: multiple definition of `GemRB::PythonObjectCallback<GemRB::WindowKeyPress>::operator()(GemRB::WindowKeyPress*)'CMakeFiles\GUIScript.dir/objects.a(GUIScript.cpp.obj):C:/Users/Nathan.Burns/gemrb_source/gemrb/gemrb/plugins/GUIScript/GUIScript.cpp:167: first defined herecollect2.exe: error: ld returned 1 exit statusgemrb\plugins\GUIScript\CMakeFiles\GUIScript.dir\build.make:125: recipe for target 'gemrb/plugins/GUIScript.dll' failedmingw32-make[2]: *** [gemrb/plugins/GUIScript.dll] Error 1CMakeFiles\Makefile2:1298: recipe for target 'gemrb/plugins/GUIScript/CMakeFiles/GUIScript.dir/all' failedmingw32-make[1]: *** [gemrb/plugins/GUIScript/CMakeFiles/GUIScript.dir/all] Error 2Makefile:126: recipe for target 'all' failedmingw32-make: *** [all] Error 2ERROR: 2 Again looks Python related and fails on the same file (GUIScript.dll) Thanks Nathan Link to comment
lynx Posted July 18, 2016 Share Posted July 18, 2016 Don't see why, but you can try removing the problematic definitions at the end of gemrb/plugins/GUIScript/PythonHelpers.h . Will check on this in a few days, just leaving the country. Link to comment
SyntaxError Posted July 18, 2016 Share Posted July 18, 2016 Seems like the windows build might be including/linking things more than once. moving the template specializations from the .cpp to the .h file and declaring _all_ the specializations with the inline keyword should fix it. Link to comment
lynx Posted August 4, 2016 Share Posted August 4, 2016 msvc13 hits this too. Is there no cleaner way to make it happen? That'd be a lot of code for a header file. Do you use it more in the subviews branch? In master nothing relies on the non-specialised ones. edit: forward declaration was enough. Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.