Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6222227
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T08:16:38+00:00 2026-05-24T08:16:38+00:00

I get some compile time errors and I can’t understand why that is. The

  • 0

I get some compile time errors and I can’t understand why that is. The following code will refuse to compile, giving me the following errors:

error C2664: ‘void (PyObject *,const char *,boost::type *)’ : cannot convert parameter 1 from ‘const char *’ to ‘PyObject *’
error C2664: ‘void (PyObject *,const char *,boost::type *)’ : cannot convert parameter 3 from ‘boost::shared_ptr’ to ‘boost::type *’

PyObject* self = ...;
const char* fname = "...";
boost::function<void (boost::shared_ptr<Event>)> func;
func = boost::bind(boost::python::call_method<void>, self, fname, _1);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T08:16:39+00:00Added an answer on May 24, 2026 at 8:16 am

    boost::python::call_method consists of several overloaded functions that take a different number of arguments, defined like this:

    template <class R>
    R call_method(PyObject* self, char const* method);
    template <class R, class A1>
    R call_method(PyObject* self, char const* method, A1 const&);
    template <class R, class A1, class A2>
    R call_method(PyObject* self, char const* method, A1 const&, A2 const&);
    ...
    

    When you call it directly (e.g. call_method<void>(self, name, arg1, arg2)), the compiler can choose the correct overload and templated argument types automatically. But when you pass a function pointer to call_method into bind, you need to manually specify the overload and argument types, by using:

    call_method<ReturnType, Arg1Type, Arg2Type, ...>
    

    Or in this case:

    call_method<void, boost::shared_ptr<Event> >
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In some C++ code, I am encountering a compile-time error that seems like it
I'm trying to port some Visual C++ (VS2005) code so that it will compile
I'm trying to get some code working that a previous developer has written. Yep,
Can I get some constructive feedback about the following architecture? Simplified Architecture Summary: Return
I'm porting some open source code so that it can build on another c++
Where can I get some decent looking free ASP.Net or CSS themes?
I need to get some information that is contained in the MFT on a
Could I get some confirmations from the community that I'm not going mad, and
So I'm working with some older code I wrote some time ago. I was
I'm getting two compile errors: /home/sater/projects/MotionManager/videoProcess.cpp:11:1: error: a function-definition is not allowed here before

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.