[C++-sig] boost, const and problems

anewtroll anewtroll at free.fr
Fri Sep 9 13:17:29 CEST 2005


    Hi !

       As a newbie to boost.python, I would like to know why the "const" 
argument (i.e. void function(const float t){ ... }) causes an error when 
using the bjam (VC++6)

------------------------------------------------------------
C:\test_09_net>bjam -sTOOLS=msvc
...found 1598 targets...
...updating 4 targets...
vc-C++ bin\test_09_net\nlib.pyd\msvc\debug\threading-multi\nlib.obj
nlib.cpp
C:\boost_1_33_0\boost/python/class.hpp(543) : error C2665: 
'get_signature' : none of the 4 overloads can convert parameter 1 from 
type 'bool (__thiscall ncell::*)(const float,const class ntype &)'
C:\boost_1_33_0\boost/python/class.hpp(237) : see reference to function 
template instantiation 'void __cdecl boost::python::class_<class 
ncell,struct boost::python::detail::not_specified,struct 
boost::python::detail::not_specified,struct 
boost::python::detail::not_specified>::def_impl(class ncell *,const char 
*,bool (__thiscall ncell::*)(const float,const class ntype &),const 
struct boost::python::detail::def_helper<char const *,struct 
boost::python::detail::not_specified,struct 
boost::python::detail::not_specified,struct 
boost::python::detail::not_specified> &,...)' being compiled
C:\boost_1_33_0\boost/python/class.hpp(544) : error C2780: 'class 
boost::python::api::object __cdecl boost::python::make_function(F,const 
CallPolicies &,const KeywordsOrSignature &)' : expects 3 arguments - 4 
provided

[...]

...skipped <@test_09_net\nlib.pyd\msvc\debug\threading-multi>nlib.CMD 
for lack of <@test_09_net\nlib.pyd\msvc\debug\threading-multi>nlib.obj...
...skipped <@test_09_net\nlib.pyd\msvc\debug\threading-multi>nlib.pyd 
for lack of <@test_09_net\nlib.pyd\msvc\debug\threading-multi>nlib.CMD...
...skipped <@test_09_net\nlib.pyd\msvc\debug\threading-multi>nlib.lib 
for lack of <@test_09_net\nlib.pyd\msvc\debug\threading-multi>nlib.CMD...
...failed updating 1 target...
...skipped 3 targets...
------------------------------------------------------------

       Whereas when const is omitted no problem occurs.

       I also would like to know how to modify the C++ compilation 
parameters when calling the bjam command (where is the bjam config file 
?). Thanks a lot !

          ANT.



More information about the Cplusplus-sig mailing list