0

我已经尝试编译 Ogre 好几个星期了,或者尝试使用预编译版本(这显然与构建它的同一编译器不兼容),现在我认为足够了。我在 Ogre 1.8.1 源上运行 CMake 2.8.11 以生成 Code::Blocks 12.11 项目。按 C::B 中的“编译”按钮给我以下信息:

构建日志:

-------------- Build: all in OGRE (compiler: GNU GCC Compiler)---------------

Running command: C:\MinGW\bin\mingw32-make.exe -f "C:/Users/Conscious Code/Desktop/ogre_src_v1-8-1/Makefile"  VERBOSE=1 all
"C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -H"C:\Users\Conscious Code\Desktop\ogre_src_v1-8-1" -B"C:\Users\Conscious Code\Desktop\ogre_src_v1-8-1" --check-build-system CMakeFiles\Makefile.cmake 0
"C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -E cmake_progress_start "C:\Users\Conscious Code\Desktop\ogre_src_v1-8-1\CMakeFiles" "C:\Users\Conscious Code\Desktop\ogre_src_v1-8-1\CMakeFiles\progress.marks"
C:/MinGW/bin/mingw32-make -f CMakeFiles\Makefile2 all
mingw32-make[1]: Entering directory `C:/Users/Conscious Code/Desktop/ogre_src_v1-8-1'
C:/MinGW/bin/mingw32-make -f OgreMain\CMakeFiles\OgreMain.dir\build.make OgreMain/CMakeFiles/OgreMain.dir/depend
mingw32-make[2]: Entering directory `C:/Users/Conscious Code/Desktop/ogre_src_v1-8-1'
"C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -E cmake_progress_report "C:\Users\Conscious Code\Desktop\ogre_src_v1-8-1\CMakeFiles" 
[  0%] 
Generating OgreWin32Resources.rc.obj
cd /d OgreMain && "C:\Program Files (x86)\CodeBlocks\MinGW\bin\windres.exe" "-IC:/Users/Conscious Code/Desktop/ogre_src_v1-8-1/OgreMain/src/WIN32" "-iC:/Users/Conscious Code/Desktop/ogre_src_v1-8-1/OgreMain/src/WIN32/OgreWin32Resources.rc" "-oC:/Users/Conscious Code/Desktop/ogre_src_v1-8-1/OgreMain/OgreWin32Resources.rc.obj"
'C:\Program' is not recognized as an internal or external command,
operable program or batch file.
C:\Program Files (x86)\CodeBlocks\MinGW\bin\windres.exe: preprocessing failed.
mingw32-make[2]: *** [OgreMain/OgreWin32Resources.rc.obj] Error 1
mingw32-make[1]: *** [OgreMain/CMakeFiles/OgreMain.dir/all] Error 2
mingw32-make: *** [all] Error 2
mingw32-make[2]: Leaving directory `C:/Users/Conscious Code/Desktop/ogre_src_v1-8-1'
mingw32-make[1]: Leaving directory `C:/Users/Conscious Code/Desktop/ogre_src_v1-8-1'
Process terminated with status 2 (0 minutes, 1 seconds)
1 errors, 0 warnings (0 minutes, 1 seconds)

构建消息:

=== OGRE, all ===
preprocessing failed.
=== Build finished: 1 errors, 0 warnings (0 minutes, 1 seconds) ===

从错误来看,windres 在生成 OgreWin32Resource.rc.obj 时似乎存在某种问题。我能做些什么来解决这个问题?

4

1 回答 1

0

原来这是项目路径中空格的组合问题(我之前曾尝试修复,但还是出现了错误)和 CXX_MAKE_COMPILER 设置不正确导致了“Program Files (x86)”文件夹(无论如何都是错误的,我在 C:\MinGW 中有一个更新的编译器)。解决了这个问题,编译时间稍微长了一点,然后遇到了依赖架构的问题。

在意识到 FreeImage 需要 Visual Studio 编译后,我认输并切换到 Irrlicht。使用 Irrlicht 编译库从未如此简单......

tl;dr:Irrlicht 更易于编译。食人魔会竭尽全力谋杀你。

于 2013-06-01T01:27:55.627 回答