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)
void GobyModule::start()
{
//
// 1. Create and initialize MMDriver
//
// goby::acomms::ModemDriverBase* driver = 0;
goby::acomms::protobuf::DriverConfig cfg;
// set the serial port given on the command line
cfg.set_serial_port(serial_path);
using google::protobuf::uint32;
// set the source id of this modem
// uint32 our_id = goby::util::as<uint32>(argv[2]);
cfg.set_modem_id(ID);
goby::glog.set_name("WHIO Micromodem");
goby::glog.add_stream(goby::util::logger::DEBUG1, &std::clog);
// default to WHOI MicroModem
// if (!driver)
// {
std::cout << "Starting WHOI Micro-Modem MMDriver" << std::endl;
driver = new goby::acomms::MMDriver;
// turn data quality factor message on
// (example of setting NVRAM configuration)
cfg.AddExtension(micromodem::protobuf::Config::nvram_cfg, "DQF,1");
// }
///////////////////////////////////////
// THE PROBLEM IS HERE
/////////////////////////////////////
function_pointer = &handle_data_receive;
goby::acomms::connect(&driver->signal_receive, function_pointer);
//
// 2. Startup the driver
//
driver->startup(cfg);
}
(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:
In file included from
/usr/include/boost/function/detail/maybe_include.hpp:18:0,
from
/usr/include/boost/function/detail/function_iterate.hpp:14,
from
/usr/include/boost/preprocessor/iteration/detail/iter/forward1.hpp:52,
from /usr/include/boost/function.hpp:64,
from /usr/include/boost/thread/future.hpp:20,
from /usr/include/boost/thread.hpp:24,
from
/usr/local/include/goby/acomms/modemdriver/driver_base.h:23,
from /usr/local/include/goby/acomms/modem_driver.h:23,
from gobyModule.h:10,
from gobyModule.cc:1:
/usr/include/boost/function/function_template.hpp:913:60: instantiated
from ‘void boost::function1
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
, 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
participants (2)
-
Matteo
-
Steven Watanabe