[C++-sig] boost::python and __declspec(align(16))

Simon Pickles sipickles at googlemail.com
Thu Jun 18 09:49:01 CEST 2009


Hi,

I think this is an MSVC problem caused by the bad STL implementation, 
but I wondered if there was a work around.

Both my client (Win32 MSVC8) and server (ubuntu GCC 4.2.3) share the 
same c++ code. It compiles and runs on GCC but fails on MSVC.

This uses the the bullet physics library and includes a type defined 
like this:

__declspec(align(16)) btVector3 {/*...*/};

When building my boost::python extension with:

class_<btVector3>("BtVector3", init<float, float, float>());

I get an error like this :

C:\boost_1_38_0\boost/python/converter/as_to_python_function.hpp(21) : 
error C2719: 'unnamed-parameter': formal parameter with 
__declspec(align('16')) won't be aligned
        C:\boost_1_38_0\boost/python/to_python_converter.hpp(88) : see 
reference to class template instantiation 
'boost::python::converter::as_to_python_function<T,ToPython>' being compiled
        with
        [
            T=btVector3,
            /* .... Huge call stack omitted for clarity.... */
        build.cpp(155) : see reference to class template instantiation 
'boost::python::class_<W>' being compiled
        with
        [
            W=btVector3
        ]

Is there a way to overcome this? switch to MinGW? :)

Thank you very much

Simon


More information about the Cplusplus-sig mailing list