我正在尝试在 MacOSX 10.6 上使用 gcc 4.7 构建一个名为 Ogre3d v1.8 的库。我尝试从 MacPorts 和 gFortran 网页安装 gcc 版本。两者都有相同的问题,我在互联网上找不到太多关于此的信息。
我的问题是我收到此错误:
Scanning dependencies of target OgreMain
[ 0%] Building CXX object OgreMain/CMakeFiles/OgreMain.dir/src/OgreAlignedAllocator.cpp.o
In file included from /usr/local/gcc-4-7-svn/lib/gcc/x86_64-apple-darwin10/4.7.0/include/c++/bits/postypes.h:42:0,
from /usr/local/gcc-4-7-svn/lib/gcc/x86_64-apple-darwin10/4.7.0/include/c++/bits/char_traits.h:42,
from /usr/local/gcc-4-7-svn/lib/gcc/x86_64-apple-darwin10/4.7.0/include/c++/string:42,
from /Users/parwrange/Desktop/ogre/ogre_src_v1-8-1/OgreMain/include/OgrePrerequisites.h:33,
from /Users/parwrange/Desktop/ogre/ogre_src_v1-8-1/OgreMain/include/OgreArchive.h:31,
from /Users/parwrange/Desktop/ogre/ogre_src_v1-8-1/OgreMain/include/OgreStableHeaders.h:41,
from /Users/parwrange/Desktop/ogre/ogre_src_v1-8-1/OgreMain/src/OgreAlignedAllocator.cpp:28:
/usr/local/gcc-4-7-svn/lib/gcc/x86_64-apple-darwin10/4.7.0/include/c++/cwchar:46:19: fatal error: wchar.h: No such file or directory
compilation terminated.
make[2]: *** [OgreMain/CMakeFiles/OgreMain.dir/src/OgreAlignedAllocator.cpp.o] Error 1
make[1]: *** [OgreMain/CMakeFiles/OgreMain.dir/all] Error 2
make: *** [all] Error 2
换句话说,看起来头文件 wchar.h 丢失了。
我已经能够使用 gcc 4.7 安装构建其他库。所以我猜这是Ogre3d v1.8特有的东西。也许与包含顺序有关。但由于我在寻找其他有此问题的人时遇到问题,我希望这里有人对如何做有一些好的建议。