Jump to content
Sign in to follow this  
nathan

Building GemRB 0.8.4 on Windows 7

Recommended Posts

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.dll
CMakeFiles\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 here
CMakeFiles\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 here
CMakeFiles\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' follow
CMakeFiles\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

Share this post


Link to post

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 ...

Share this post


Link to post

@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.dll
CMakeFiles\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 here
CMakeFiles\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 here
collect2.exe: error: ld returned 1 exit status
gemrb\plugins\GUIScript\CMakeFiles\GUIScript.dir\build.make:125: recipe for target 'gemrb/plugins/GUIScript.dll' failed
mingw32-make[2]: *** [gemrb/plugins/GUIScript.dll] Error 1
CMakeFiles\Makefile2:1298: recipe for target 'gemrb/plugins/GUIScript/CMakeFiles/GUIScript.dir/all' failed
mingw32-make[1]: *** [gemrb/plugins/GUIScript/CMakeFiles/GUIScript.dir/all] Error 2
Makefile:126: recipe for target 'all' failed
mingw32-make: *** [all] Error 2
ERROR: 2

Again looks Python related and fails on the same file (GUIScript.dll)

 

Thanks

 

Nathan

Share this post


Link to post

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.

Share this post


Link to post

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.

Share this post


Link to post

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.

Edited by lynx

Share this post


Link to post
Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...