Unable to compile example with __stdcall in Boost.Python

I am trying to wrap a function in Python using Boost.Python, and I ran into problems when using __stdcall. Here is an example:

#define BOOST_PYTHON_STATIC_LIB
#define BOOST_PYTHON_ENABLE_STDCALL
#include <boost/python.hpp>
#include <boost/python/signature.hpp>

void __stdcall f(void) 
{
    return;
}

using namespace boost::python;

BOOST_PYTHON_MODULE(MyPyDLL)
{
    def("func", f);
}

When I try to compile, I get more than 100 similar errors, but the first 2:

error C2780: "Increase :: MPL :: vector10 :: Type & T0, T1, T2, T3, T4, T5, T6, T7> boost :: python :: detail :: get_signature (RT (__thiscall ClassT :: *) (T0, T1, T2, T3, T4, T5, T6, T7) const, Target *) ': expects 2 arguments - 1 provided by C: \ boost \ boost_1_62_0_python \ boost \ python \ make_function.hpp 104

C2780:" :: MPL:: vector10:: & 0, 1, 2, 3, 4, 5, 6, 7 > boost:: python:: detail:: get_signature (RT (__thiscall ClassT:: * ) (T0, T1, T2, T3, T4, T5, T6, T7) volatile const, Target *) ': 2 - 1 C:\boost\boost_1_62_0_python\boost\python\make_function.hpp 104

, BOOST_PYTHON_ENABLE_STDCALL, :

.

- , ?

+4
1

, BOOST_PYTHON_ENABLE_STDCALL boost.

-1

Source: https://habr.com/ru/post/1661799/


All Articles