Sign in to follow this  
kloffy

Unity [Py++] Error when including boost::shared_ptr

Recommended Posts

kloffy    1318
A while a go I was fiddling around with manually writing Boost Python wrappers. Being the lazy guy that I am, I wanted to try out Py++ for automatically generating such wrappers. For testing purposes, I created a header containing a single class and started playing around. Everything worked pretty well until I added a "#include <boost/smart_ptr.hpp>" statement. I got this error, which I haven't been able to get rid of so far:
Error occured during code generation process!
Error:
Error occured while running GCC-XML: In file included from C:/Program Files/Microsoft Visual Studio 9.0/VC/include/xfwrap1:222,
                 from C:/Program Files/Microsoft Visual Studio 9.0/VC/include/xfwrap:20,
                 from C:/Program Files/Microsoft Visual Studio 9.0/VC/include/xrefwrap:44,
                 from C:/Program Files/Microsoft Visual Studio 9.0/VC/include/functional:874,
                 from C:/Program Files/boost/boost_1_39/boost/smart_ptr/detail/shared_count.hpp:37,
                 from C:/Program Files/boost/boost_1_39/boost/smart_ptr/shared_ptr.hpp:32,
                 from C:/Program Files/boost/boost_1_39/boost/shared_ptr.hpp:17,
                 from C:/Program Files/boost/boost_1_39/boost/smart_ptr.hpp:18,
                 from D:/Projects/PyTest/test.h:4:
C:/Program Files/Microsoft Visual Studio 9.0/VC/include/xxresult:102: error: redefinition of 'struct std::tr1::_Result_of1<_Rx (_Arg0::*)(), _Farg0&>'
C:/Program Files/Microsoft Visual Studio 9.0/VC/include/xxresult:94: error: previous definition of 'struct std::tr1::_Result_of1<_Rx (_Arg0::*)(), _Farg0&>'
C:/Program Files/Microsoft Visual Studio 9.0/VC/include/xxresult:111: error: redefinition of 'struct std::tr1::_Result_of1<_Rx (_Arg0::*)(), _Farg0&>'
C:/Program Files/Microsoft Visual Studio 9.0/VC/include/xxresult:94: error: previous definition of 'struct std::tr1::_Result_of1<_Rx (_Arg0::*)(), _Farg0&>'
C:/Program Files/Microsoft Visual Studio 9.0/VC/include/xxresult:121: error: redefinition of 'struct std::tr1::_Result_of1<_Rx (_Arg0::*)(), _Farg0&>'
C:/Program Files/Microsoft Visual Studio 9.0/VC/include/xxresult:94: error: previous definition of 'struct std::tr1::_Result_of1<_Rx (_Arg0::*)(), _Farg0&>'
C:/Program Files/Microsoft Visual Studio 9.0/VC/include/xxresult:154: error: redefinition of 'struct std::tr1::_Result_of1<_Rx (_Arg0::*)()const, _Farg0&>'
C:/Program Files/Microsoft Visual Studio 9.0/VC/include/xxresult:146: error: previous definition of 'struct std::tr1::_Result_of1<_Rx (_Arg0::*)()const, _Farg0&>'
C:/Program Files/Microsoft Visual Studio 9.0/VC/include/xxresult:163: error: redefinition of 'struct std::tr1::_Result_of1<_Rx (_Arg0::*)()const, _Farg0&>'
C:/Program Files/Microsoft Visual Studio 9.0/VC/include/xxresult:146: error: previous definition of 'struct std::tr1::_Result_of1<_Rx (_Arg0::*)()const, _Farg0&>'
C:/Program Files/Microsoft Visual Studio 9.0/VC/include/xxresult:173: error: redefinition of 'struct std::tr1::_Result_of1<_Rx (_Arg0::*)()const, _Farg0&>'
C:/Program Files/Microsoft Visual Studio 9.0/VC/include/xxresult:146: error: previous definition of 'struct std::tr1::_Result_of1<_Rx (_Arg0::*)()const, _Farg0&>'
C:/Program Files/Microsoft Visual Studio 9.0/VC/include/xxresult:206: error: redefinition of 'struct std::tr1::_Result_of1<_Rx (_Arg0::*)()volatile, _Farg0&>'
C:/Program Files/Microsoft Visual Studio 9.0/VC/include/xxresult:198: error: previous definition of 'struct std::tr1::_Result_of1<_Rx (_Arg0::*)()volatile, _Farg0&>'
C:/Program Files/Microsoft Visual Studio 9.0/VC/include/xxresult:215: error: redefinition of 'struct std::tr1::_Result_of1<_Rx (_Arg0::*)()volatile, _Farg0&>'
C:/Program Files/Microsoft Visual Studio 9.0/VC/include/xxresult:198: error: previous definition of 'struct std::tr1::_Result_of1<_Rx (_Arg0::*)()volatile, _Farg0&>'
C:/Program Files/Microsoft Visual Studio 9.0/VC/include/xxresult:225: error: redefinition of 'struct std::tr1::_Result_of1<_Rx (_Arg0::*)()volatile, _Farg0&>'
C:/Program Files/Microsoft Visual Studio 9.0/VC/include/xxresult:198: error: previous definition of 'struct std::tr1::_Result_of1<_Rx (_Arg0::*)()volatile, _Farg0&>'
C:/Program Files/Microsoft Visual Studio 9.0/VC/include/xxresult:258: error: redefinition of 'struct std::tr1::_Result_of1<_Rx (_Arg0::*)()const volatile, _Farg0&>'
C:/Program Files/Microsoft Visual Studio 9.0/VC/include/xxresult:250: error: previous definition of 'struct std::tr1::_Result_of1<_Rx (_Arg0::*)()const volatile, _Farg0&>'
C:/Program Files/Microsoft Visual Studio 9.0/VC/include/xxresult:267: error: redefinition of 'struct std::tr1::_Result_of1<_Rx (_Arg0::*)()const volatile, _Farg0&>'
C:/Program Files/Microsoft Visual Studio 9.0/VC/include/xxresult:250: error: previous definition of 'struct std::tr1::_Result_of1<_Rx (_Arg0::*)()const volatile, _Farg0&>'
C:/Program Files/Microsoft Visual Studio 9.0/VC/include/xxresult:277: error: redefinition of 'struct std::tr1::_Result_of1<_Rx (_Arg0::*)()const volatile, _Farg0&>'
C:/Program Files/Microsoft Visual Studio 9.0/VC/include/xxresult:250: error: previous definition of 'struct std::tr1::_Result_of1<_Rx (_Arg0::*)()const volatile, _Farg0&>'
C:/Program Files/Microsoft Visual Studio 9.0/VC/include/xxresult:310: error: redefinition of 'struct std::tr1::_Result_of1<_Rx (_Arg0::* const)(), _Farg0&>'
C:/Program Files/Microsoft Visual Studio 9.0/VC/include/xxresult:302: error: previous definition of 'struct std::tr1::_Result_of1<_Rx (_Arg0::* const)(), _Farg0&>'
C:/Program Files/Microsoft Visual Studio 9.0/VC/include/xxresult:319: error: redefinition of 'struct std::tr1::_Result_of1<_Rx (_Arg0::* const)(), _Farg0&>'
C:/Program Files/Microsoft Visual Studio 9.0/VC/include/xxresult:302: error: previous definition of 'struct std::tr1::_Result_of1<_Rx (_Arg0::* const)(), _Farg0&>'
C:/Program Files/Microsoft Visual Studio 9.0/VC/include/xxresult:329: error: redefinition of 'struct std::tr1::_Result_of1<_Rx (_Arg0::* const)(), _Farg0&>'
C:/Program Files/Microsoft Visual Studio 9.0/VC/include/xxresult:302: error: previous definition of 'struct std::tr1::_Result_of1<_Rx (_Arg0::* const)(), _Farg0&>'
C:/Program Files/Microsoft Visual Studio 9.0/VC/include/xxresult:362: error: redefinition of 'struct std::tr1::_Result_of1<_Rx (_Arg0::* const)()const, _Farg0&>'
C:/Program Files/Microsoft Visual Studio 9.0/VC/include/xxresult:354: error: previous definition of 'struct std::tr1::_Result_of1<_Rx (_Arg0::* const)()const, _Farg0&>'
C:/Program Files/Microsoft Visual Studio 9.0/VC/include/xxresult:371: error: redefinition of 'struct std::tr1::_Result_of1<_Rx (_Arg0::* const)()const, _Farg0&>'
C:/Program Files/Microsoft Visual Studio 9.0/VC/include/xxresult:354: error: previous definition of 'struct std::tr1::_Result_of1<_Rx (_Arg0::* const)()const, _Farg0&>'
C:/Program Files/Microsoft Visual Studio 9.0/VC/include/xxresult:381: error: redefinition of 'struct std::tr1::_Result_of1<_Rx (_Arg0::* const)()const, _Farg0&>'
C:/Program Files/Microsoft Visual Studio 9.0/VC/include/xxresult:354: error: previous definition of 'struct std::tr1::_Result_of1<_Rx (_Arg0::* const)()const, _Farg0&>'
C:/Program Files/Microsoft Visual Studio 9.0/VC/include/xxresult:414: error: redefinition of 'struct std::tr1::_Result_of1<_Rx (_Arg0::* const)()volatile, _Farg0&>'
C:/Program Files/Microsoft Visual Studio 9.0/VC/include/xxresult:406: error: previous definition of 'struct std::tr1::_Result_of1<_Rx (_Arg0::* const)()volatile, _Farg0&>'
C:/Program Files/Microsoft Visual Studio 9.0/VC/include/xxresult:423: error: redefinition of 'struct std::tr1::_Result_of1<_Rx (_Arg0::* const)()volatile, _Farg0&>'
C:/Program Files/Microsoft Visual Studio 9.0/VC/include/xxresult:406: error: previous definition of 'struct std::tr1::_Result_of1<_Rx (_Arg0::* const)()volatile, _Farg0&>'
C:/Program Files/Microsoft Visual Studio 9.0/VC/include/xxresult:433: error: redefinition of 'struct std::tr1::_Result_of1<_Rx (_Arg0::* const)()volatile, _Farg0&>'
C:/Program Files/Microsoft Visual Studio 9.0/VC/include/xxresult:406: error: previous definition of 'struct std::tr1::_Result_of1<_Rx (_Arg0::* const)()volatile, _Farg0&>'
C:/Program Files/Microsoft Visual Studio 9.0/VC/include/xxresult:466: error: redefinition of 'struct std::tr1::_Result_of1<_Rx (_Arg0::* const)()const volatile, _Farg0&>'
C:/Program Files/Microsoft Visual Studio 9.0/VC/include/xxresult:458: error: previous definition of 'struct std::tr1::_Result_of1<_Rx (_Arg0::* const)()const volatile, _Farg0&>'
C:/Program Files/Microsoft Visual Studio 9.0/VC/include/xxresult:475: error: redefinition of 'struct std::tr1::_Result_of1<_Rx (_Arg0::* const)()const volatile, _Farg0&>'
C:/Program Files/Microsoft Visual Studio 9.0/VC/include/xxresult:458: error: previous definition of 'struct std::tr1::_Result_of1<_Rx (_Arg0::* const)()const volatile, _Farg0&>'
C:/Program Files/Microsoft Visual Studio 9.0/VC/include/xxresult:485: error: redefinition of 'struct std::tr1::_Result_of1<_Rx (_Arg0::* const)()const volatile, _Farg0&>'
C:/Program Files/Microsoft Visual Studio 9.0/VC/include/xxresult:458: error: previous definition of 'struct std::tr1::_Result_of1<_Rx (_Arg0::* const)()const volatile, _Farg0&>'

I'm using boost 1.39 and I have downloaded Py++-1.0.0, pygccxml-1.0.0 and gccxml-0.9 from SourceForge. Any ideas what could be going on?

Share this post


Link to post
Share on other sites
kloffy    1318
Quote:
Page linked by mattd
I found out, that the source of errors is TR1 implementation.Passing
-D"_HAS_TR1=0" to gccxml.exe solves the problem.
...it sure does. Thank you, I bow before your superior Google skills!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this