我将系统升级到Mac OS 10.9并花了整个周末来让我的软件正常运行。虽然没有取得多少成功......
我需要的一些工具需要提升,但之前我使用过boost 1.38,而这只是不能在Mavericks上编译。所以我决定使用自制软件来安装boost 1.55。安装没有任何问题,但是当我尝试编译我的工具集时,它会抛出这个错误:
Syntax error /usr/local/include/boost/exception/exception.hpp:343:
Error: void type variable can not be declared /usr/local/include/boost/smart_ptr/shared_ptr.hpp:243:
Error: void type variable can not be declared /usr/local/include/boost/smart_ptr/shared_ptr.hpp:245:
Error: Invalid type '>{typedef' in declaration of 'boost::exception_detail::error_info_base type;}' /usr/local/include/boost/smart_ptr/shared_ptr.hpp:78:
Error: class,struct,union or type element_type not defined /usr/local/include/boost/smart_ptr/shared_ptr.hpp:439:
Internal error: global function template arg type /usr/local/include/boost/smart_ptr/shared_ptr.hpp:439:
Error: Invalid type '>{typedef' in declaration of 'void type;}' /usr/local/include/boost/smart_ptr/shared_ptr.hpp:127:
Internal warning: >{typedef void type;} comment can not set /usr/local/include/boost/smart_ptr/shared_ptr.hpp:127:
Error: Invalid type '>{typedef' in declaration of 'void type;}' /usr/local/include/boost/smart_ptr/shared_ptr.hpp:152:
...
...
...
Warning: Error occurred during reading source files
Warning: Error occurred during dictionary source generation
Error: rootcint: error loading headers...
make[2]: *** [icetray/CMakeFiles/icetrayDict.cxx] Error 1
make[1]: *** [icetray/CMakeFiles/icetray.dir/all] Error 2
make: *** [all] Error 2
我不确定出了什么问题,并且不知道从哪里开始调试。谷歌没有回复任何有用的东西,所以我现在真的很挣扎。
头文件在/ usr / local / Cellar中正确安装并链接到/ usr / local / include。
顺便说一下。我开始使用全新的Mavericks安装(+ Xcode用于devtools),并且只使用brew来安装一些额外的软件包。
这是exception.hpp
中引用的代码:
340: struct large_size { char c[256]; };
341: large_size dispatch_boost_exception( exception const * );
343: struct small_size { };
344: small_size dispatch_boost_exception( void const * );
smpart_ptr
中第一个错误的相应代码:
239: #if !defined( BOOST_NO_SFINAE ) && !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION ) && !defined( BOOST_NO_AUTO_PTR )
241: // rvalue auto_ptr support based on a technique by Dave Abrahams
243: template< class T, class R > struct sp_enable_if_auto_ptr
244: {
245: };
247: template< class T, class R > struct sp_enable_if_auto_ptr< std::auto_ptr< T >, R >
248: {
249: typedef R type;
250: };
252: #endif
编译器标志:
C_FLAGS = -Wall -Wno-mismatched-tags -Wno-char-subscripts -Wno-unused
-Wunneeded-internal-declaration -Wno-parantheses-equality -g -fPIC -I/Users/tamasgal/Xapps/seatray/searecsim/trunk/src/cmake/tool-patches/common
-I/Users/tamasgal/Xapps/seatray/searecsim/trunk/src/icetray/public -I/Users/tamasgal/Xapps/seatray/searecsim/trunk/src/icetray/private -I/usr/local/Cellar/boost/1.55.0/include/boost -I/System/Library/Frameworks/Python.framework/Headers -I/Users/tamasgal/Xapps/i3/seaports/include/log4cplus-1.0.2 -I/Users/tamasgal/Xapps/i3/seaports/root-v5.34.12/include/root -fPIC -fno-strict-aliasing -include /Users/tamasgal/Xapps/seatray/searecsim/trunk/build_debug/CMakeFiles/I3.h
C_DEFINES = -DI3_USE_CINT -DI3_USE_ROOT -DPROJECT=icetray
-D_REEENTRANT
CXX_FLAGS = -Wall -Wno-non-virtual-dtor -Wno-mismatched-tags
-Wno-char-subscripts -Wno-unused -Wunneeded-internal-declaration -Wno-parantheses-equality -g -fPIC -I/Users/tamasgal/Xapps/seatray/searecsim/trunk/src/cmake/tool-patches/common
-I/Users/tamasgal/Xapps/seatray/searecsim/trunk/src/icetray/public -I/Users/tamasgal/Xapps/seatray/searecsim/trunk/src/icetray/private -I/usr/local/Cellar/boost/1.55.0/include/boost -I/System/Library/Frameworks/Python.framework/Headers -I/Users/tamasgal/Xapps/i3/seaports/include/log4cplus-1.0.2 -I/Users/tamasgal/Xapps/i3/seaports/root-v5.34.12/include/root -fPIC -fno-strict-aliasing -include /Users/tamasgal/Xapps/seatray/searecsim/trunk/build_debug/CMakeFiles/I3.h
CXX_DEFINES = -DI3_USE_CINT -DI3_USE_ROOT -DPROJECT=icetray
-D_REEENTRANT
rootcint构建命令:
cd /Users/tamasgal/Xapps/seatray/searecsim/trunk/build_debug/icetray && \
../env-shell.sh rootcint -f \
/Users/tamasgal/Xapps/seatray/searecsim/trunk/build_debug/icetray/CMakeFiles/icetrayDict.cxx -c -DI3_USE_ROOT -DI3_USE_CINT \
-I/Users/tamasgal/Xapps/seatray/searecsim/trunk/src/cmake/tool-patches/common \
-I/Users/tamasgal/Xapps/seatray/searecsim/trunk/src/icetray/public \
-I/Users/tamasgal/Xapps/seatray/searecsim/trunk/src/icetray/private \
-I/usr/local/Cellar/boost/1.55.0/include/boost \
-I/System/Library/Frameworks/Python.framework/Headers \
-I/Users/tamasgal/Xapps/i3/seaports/include/log4cplus-1.0.2 \
-I/Users/tamasgal/Xapps/i3/seaports/root-v5.34.12/include/root \
-I/Users/tamasgal/Xapps/seatray/searecsim/trunk/src/icetray/public \
-p /Users/tamasgal/Xapps/seatray/searecsim/trunk/build_debug/CMakeFiles/I3.h \
/Users/tamasgal/Xapps/seatray/searecsim/trunk/src/icetray/public/icetray/I3FrameObject.h \
/Users/tamasgal/Xapps/seatray/searecsim/trunk/src/icetray/LinkDef.h
来自I3.h
的相关代码部分:
#define BOOST_NO_WREGEX
#ifdef I3_OPTIMIZE
#define BOOST_DISABLE_ASSERTS
#endif
#include <boost/version.hpp>
#include <boost/shared_ptr.hpp>
using boost::shared_ptr;
using boost::dynamic_pointer_cast;
// workaround for braindead rootcint. doesn't recognize the using
// boost::shared_ptr. I can just see this popping up to cause us
// unspeakable aggravation in the future...
#ifdef __CINT__
template <typename T>
struct shared_ptr : boost::shared_ptr<T> { };