Boost logo

Boost Users :

Subject: Re: [Boost-users] Problem compiling
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2011-10-28 19:17:17


AMDG

On 10/28/2011 12:25 PM, Matteo wrote:
> Hi guys,
> I am writing a class that include gboy's libraries (
> http://gobysoft.com/#/software/goby) but I have a problem with boost
> libraries.
>
> The code is:
> (from gobymodule.cc)
>
> <snip>
> ///////////////////////////////////////
> // THE PROBLEM IS HERE
> /////////////////////////////////////
> function_pointer = &handle_data_receive;
> goby::acomms::connect(&driver->signal_receive, function_pointer);
>
> <snip>
>
> (from gobyModule.h)
>
> class GobyModule:
> {
> public:
> void function(str::string);
> }
>
> void (*function_pointer)(const
> goby::acomms::protobuf::ModemTransmission & data_msg, GobyModule* foo);
>
> void handle_data_receive(const
> goby::acomms::protobuf::ModemTransmission & data_msg, GobyModule* foo)
> {
> foo->payload_parser(str.str());
> }
>
>
> The problem, compiling, is:
>
> <snip>
> /usr/local/include/goby/acomms/connect.h:35:11: instantiated from ‘void
> goby::acomms::connect(Signal*, Slot) [with Signal = boost::signal<void(const
> goby::acomms::protobuf::ModemTransmission&)>, Slot = void (*)(const
> goby::acomms::protobuf::ModemTransmission&, GobyModule*)]’
> gobyModule.cc:404:66: instantiated from here
> /usr/include/boost/function/function_template.hpp:112:11: error: too few
> arguments to function
>

The signature doesn't match. You probably need
to use bind.

In Christ,
Steven Watanabe


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net