[C++-sig] Boost Python & __declspec(dllimport) int __stdcall

Jon Clements jon.clements at trgstrata.co.uk
Thu Feb 23 17:07:12 CET 2006


Hi All,

I've had a look for something regarding the above but couldn't find anything, so apologies if I'm digging up what's been buried.

I have a 3rd party header file which contains the declarations for a DLL. One of the lines is:-
    __declspec(dllimport) int __stdcall System_Startup(long);

I have the following attempting to wrap it: -

BOOST_PYTHON_MODULE(xxx)
{
def("startup",&System_Startup)
}

When compiling with VC++ 8 Express Edition, I get:-

1>C:\boost\boost_1_33_1\boost/python/make_function.hpp(104) : error C2780: 'boost::mpl::vector17<RT,most_derived<Target,ClassT>::type&,T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14> boost::python::detail::get_signature(RT (__thiscall ClassT::* )(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14) volatile const,Target *)' : expects 2 arguments - 1 provided
1> C:\boost\boost_1_33_1\boost/python/signature.hpp(164) : see declaration of 'boost::python::detail::get_signature'
1> C:\boost\boost_1_33_1\boost/python/def.hpp(82) : see reference to function template instantiation 'boost::python::api::object boost::python::make_function<int(__stdcall *)(long)>(F)' being compiled
1> with
1> [
1> F=int (__stdcall *)(long)
1> ]
1> C:\boost\boost_1_33_1\boost/python/def.hpp(91) : see reference to function template instantiation 'boost::python::api::object boost::python::detail::make_function1<int(__stdcall *)(long)>(T,...)' being compiled
1> with
1> [
1> T=int (__stdcall *)(long)
1> ]
1> .\stdafx.cpp(28) : see reference to function template instantiation 'void boost::python::def<int(__stdcall *)(long)>(const char *,Fn)' being compiled
1> with
1> [
1> Fn=int (__stdcall *)(long)
1> ]
1> C:\Program Files\Microsoft Visual Studio 8\VC\include\xstring(1202) : while compiling class template member function 'std::basic_string<_Elem,_Traits,_Ax> &std::basic_string<_Elem,_Traits,_Ax>::erase(__w64 unsigned int,__w64 unsigned int)'
1> with
1> [
1> _Elem=wchar_t,
1> _Traits=std::char_traits<wchar_t>,
1> _Ax=std::allocator<wchar_t>
1> ]
1> C:\Program Files\Microsoft Visual Studio 8\VC\include\xstring(2103) : see reference to class template instantiation 'std::basic_string<_Elem,_Traits,_Ax>' being compiled
1> with
1> [
1> _Elem=wchar_t,
1> _Traits=std::char_traits<wchar_t>,
1> _Ax=std::allocator<wchar_t>
1> ]
..... [snip] .......

1> C:\boost\boost_1_33_1\boost/python/signature.hpp(164) : see declaration of 'boost::python::detail::get_signature'
1>C:\boost\boost_1_33_1\boost/python/make_function.hpp(104) : error C2784: 'boost::mpl::vector6<RT,ClassT&,T0,T1,T2,T3> boost::python::detail::get_signature(RT (__thiscall ClassT::* )(T0,T1,T2,T3) volatile const)' : could not deduce template argument for 'RT (__thiscall ClassT::* )(T0,T1,T2,T3) volatile const' from 'int (__stdcall *)(long)'
1> C:\boost\boost_1_33_1\boost/python/signature.hpp(146) : see declaration of 'boost::python::detail::get_signature'
1>C:\boost\boost_1_33_1\boost/python/make_function.hpp(104) : fatal error C1003: error count exceeds 100; stopping compilation
    
I'm somewhat flummoxed as to where to even start looking - any tips?

Thanks in advance,

Jon.



________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________



More information about the Cplusplus-sig mailing list