Boost logo

Boost Users :

Subject: [Boost-users] Problem compiling
From: Matteo (superteodj_at_[hidden])
Date: 2011-10-28 15:25:06


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<R, T1>::assign_to(Functor) [with Functor = void
(*)(const goby::acomms::protobuf::ModemTransmission&, GobyModule*), R =
void, T0 = const goby::acomms::protobuf::ModemTransmission&]’
/usr/include/boost/function/function_template.hpp:722:7: instantiated from
‘boost::function1<R, T1>::function1(Functor, typename
boost::enable_if_c<boost::type_traits::ice_not<boost::is_integral<Functor>::value>::value,
int>::type) [with Functor = void (*)(const
goby::acomms::protobuf::ModemTransmission&, GobyModule*), R = void, T0 =
const goby::acomms::protobuf::ModemTransmission&, typename
boost::enable_if_c<boost::type_traits::ice_not<boost::is_integral<Functor>::value>::value,
int>::type = int]’
/usr/include/boost/function/function_template.hpp:1064:16: instantiated
from ‘boost::function<R(T0)>::function(Functor, typename
boost::enable_if_c<boost::type_traits::ice_not<boost::is_integral<Functor>::value>::value,
int>::type) [with Functor = void (*)(const
goby::acomms::protobuf::ModemTransmission&, GobyModule*), R = void, T0 =
const goby::acomms::protobuf::ModemTransmission&, typename
boost::enable_if_c<boost::type_traits::ice_not<boost::is_integral<Functor>::value>::value,
int>::type = int]’
/usr/include/boost/signals/slot.hpp:111:122: instantiated from
‘boost::slot<SlotFunction>::slot(const F&) [with F = void (*)(const
goby::acomms::protobuf::ModemTransmission&, GobyModule*), SlotFunction =
boost::function<void(const goby::acomms::protobuf::ModemTransmission&)>]’
/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

Thank you so much,

Matteo



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