我在链接windows的blender时遇到问题。我正在使用CMake和mimgw编译器(mingw32-g++.exe c++编译器)和(mingw32-gcc.exe c编译器)创建我的makefile。
我正在从
获取来源https://svn.blender.org/svnroot/bf-blender/trunk/blender
https://svn.blender.org/svnroot/bf-blender/trunk/lib/windows
如
中所述http://wiki.blender.org/index.php/Dev:2.5/Doc/Building_Blender/Windows/MinGW/CMake
所有链接错误都与lib\windows\gcc有关
以下是其中的几个:
lib\windows\gcc\tif\lib/libtif.a(tif_pixarlog.o):(.text+0x172d):未定义对`deflateInit_'的引用
lib\windows\gcc\openimageio\lib/libOpenImageIO.a(sysutil.cpp.obj):sysutil.cpp:(.text+0x32):对的未定义引用`GetProcessMemoryInfo@12'
lib\windows\gcc\openimageio\lb/libOpenImageIO.a(socketinput.cpp.obj):socketinput.cpp:(.text+0x45c2):对的未定义引用`WSASetLastError@4'
在我的lib\windows\gcc\openimageio中有一个批处理文件(oiiobuild.bat),我猜这是由CMake 生成的
cmake ..oiiosrc -G "MinGW Makefiles" ^
-DBUILDSTATIC=1 ^
-DBOOST_CUSTOM=0 ^
-DBOOST_ROOT=..libwindowsgccboost ^
-DBoost_USE_STATIC_RUNTIME=ON ^
-DLINKSTATIC=ON ^
-DILMBASE_HALF_LIBRARIES=..libwindowsgccopenexrliblibHalf.a ^
-DILMBASE_IMATH_LIBRARIES=..libwindowsgccopenexrliblibImath.a ^
-DILMBASE_ILMTHREAD_LIBRARIES=..libwindowsgccopenexrliblibIlmThread.a ^
-DILMBASE_IEX_LIBRARIES=..libwindowsgccopenexrliblibIex.a ^
-DOPENEXR_ILMIMF_LIBRARIES=..libwindowsgccopenexrliblibIlmImf.a ^
-DILMBASE_INCLUDE_DIR=..libwindowsgccopenexrinclude ^
-DOPENEXR_INCLUDE_DIR=..libwindowsgccopenexrinclude ^
-DZLIB_INCLUDE_DIR=..libwindowszlibinclude ^
-DZLIB_LIBRARY=..libwindowszlibliblibz.a ^
-DPNG_LIBRARY=..libwindowspngliblibpng.a ^
-DPNG_PNG_INCLUDE_DIR=..libwindowspnginclude ^
-DJPEG_LIBRARY=..libwindowsjpegliblibjpeg.lib ^
-DJPEG_INCLUDE_DIR=..libwindowsjpeginclude ^
-DTIFF_LIBRARY=..libwindowstiffliblibtiff.lib ^
-DTIFF_INCLUDE_DIR=..libwindowstiffinclude ^
-DCMAKE_INSTALL_PREFIX=..libwindowsgccopenimageio ^
-DUSE_OPENGL=OFF ^
-DUSE_TBB=OFF ^
-DUSE_FIELD3D=OFF ^
-DUSE_QT=OFF ^
-DUSE_PYTHON=OFF ^
-DCMAKE_BUILD_TYPE=Release
mingw32-make install
原来lib\windows\gcc\oiio不存在。
编辑:试图用scons编译blender 2.71,我发现如果我不从blender文件夹运行python,我会得到*找不到SContruct文件。错误
所以
使用python26\python.exe scons/scons.py我得到
ValueError: zero length field name in format:
File "D:blender-sourceblenderSConstruct", line 54:
EnsureSConsVersion(1,0,0)
File "D:blender-sourceblendersconsscons-localSConsScriptSConscript.py", line 607:
env = self.factory()
File "D:blender-sourceblendersconsscons-localSConsScriptSConscript.py", line 587:
default_env = SCons.Defaults.DefaultEnvironment()
File "D:blender-sourceblendersconsscons-localSConsDefaults.py", line 88:
_default_env = SCons.Environment.Environment(*args, **kw)
File "D:blender-sourceblendersconsscons-localSConsEnvironment.py", line 1003:
apply_tools(self, tools, toolpath)
File "D:blender-sourceblendersconsscons-localSConsEnvironment.py", line 107:
env.Tool(tool)
File "D:blender-sourceblendersconsscons-localSConsEnvironment.py", line 1787:
tool(self)
File "D:blender-sourceblendersconsscons-localSConsTool__init__.py", line 183:
self.generate(env, *args, **kw)
File "D:blender-sourceblendersconsscons-localSConsTooldefault.py", line 41:
SCons.Tool.Tool(t)(env)
File "D:blender-sourceblendersconsscons-localSConsTool__init__.py", line 183:
self.generate(env, *args, **kw)
File "D:blender-sourceblendersconsscons-localSConsTooldmd.py", line 131:
env['DLIBCOM'] = '$DLIB $_DLIBFLAGS {} $TARGET $SOURCES $_DLIBFLAGS'.format('-c' if env['PLATFORM'] == 'win32' else '')
使用python27\python.exe scons/scons.py我得到
scons: warning: VC version 12.0 not installed. C/C++ compilers are most likely not set correctly.
Installed versions are: ['9.0']
File "D:blender-sourceblenderSConstruct", line 143, in <module>
WindowsError: [Error 2] The system cannot find the file specified:
File "D:blender-sourceblenderSConstruct", line 207:
opts.Update(env)
File "D:blender-sourceblendersconsscons-localSConsVariables__init__.py", line 173:
exec open(filename, 'rU').read() in {}, values
File "<string>", line 3:
None
File "c:python27libsubprocess.py", line 710:
errread, errwrite)
File "c:python27libsubprocess.py", line 958:
startupinfo)
CMake+Mingw32已经很长时间没有经过测试了,但SCons+Mingw64确实有效,因为Blender构建机器人也使用它进行夜间构建:http://builder.blender.org/buildslaves/mingw64_scons_anthony
从buildslave列表中,您可以看到没有mingw32 slave,我不确定在不久的将来是否会有。
无论如何,使用SCons和Mingw64,您应该有一种直接的方式来运行编译过程。只需确保安装了Mingw64和Python 2.6或Python 2.7。然后查看搅拌机来源和lib/mingw64。在Blender源根目录中使用C:\Python27\python.exe scons\scons.py启动编译过程。这应该是开箱即用的。