ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> cpp-sig
cpp-sig
[C++-sig] wrap global variable (def not work)
by Zhang Le other posts by this author
Jun 4 2003 7:19AM messages near this date
[C++-sig] Re: Compile times using Boost::python. | Re: [C++-sig] wrap global variable (def not work)
Hello, 
  I want to wrap a single int variable to python model but failed:
  the code is:
  int verbose = 1;
  BOOST_PYTHON_MODULE(foo)
  {
      def("verbose", &verbose);
  }

  Error message:
  ...
  /usr/local/include/boost/python/make_function.hpp: In function
 `boost::python::api::object boost::python::make_function(F) [with F
 = int*]':
    /usr/local/include/boost/python/def.hpp:81:   instantiated from
    `boost::python::api::object
    boost::python::detail::make_function1(T,  ...) [with T = int*]'
    /usr/local/include/boost/python/def.hpp:90:   instantiated from
    `void boost::python::def(const char*,  Fn) [with Fn = int*]'
    foo.cpp:50:   instantiated from here
    /usr/local/include/boost/python/make_function.hpp:76: no
    matching function for
       call to `get_signature(int*&)'
    ...

    It seems def can only be used on class members. Any tips?
-- 
                                     Sincerely yours,
                                            Zhang Le

_______________________________________________
C++-sig mailing list
C++-sig@[...].org
http://mail.python.org/mailman/listinfo/c++-sig
Thread:
Zhang Le
Nicodemus

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved