building dll of rosserial_windows

asked 2015-12-29 07:28:58 -0600

Morteza gravatar image

updated 2016-01-02 04:12:32 -0600

gvdhoorn gravatar image

Hi everyone,

I have used rosserial_windows to connect my laptop in windows to a pc in ubuntu and sending some sensor data from windows to linux. Now i need to build the .dll of the rosserial_windows and i used the below but i get the LNK error. i would appreciate any help.

extern "C"
{

ros::NodeHandle nh;
char *ros_master = "192.168.1.4";
std_msgs::Float32 roll_msg;
ros::Publisher roll_pub ("roll", &roll_msg);

  __declspec(dllexport) void InitRosPublish()
  {
    nh.initNode (ros_master);
    nh.advertise (roll_pub);
  }

  __declspec(dllexport) void PublishImuData(double roll, double pitch, double yaw)
  {
        roll_msg.data = roll;
        roll_pub.publish(&roll_msg);
        nh.spinOnce ();
        Sleep (10);
  }

  __declspec(dllexport) void Sum(double a, double b, double& c)
  {
      c = a + b;
  }
}

Edit: Actually i have to add that the first error is:

Error   2   error LNK2019: unresolved external symbol "public: void __thiscall WindowsSocket::init(char *)" (?init@WindowsSocket@@QAEXPAD@Z) referenced in function "public: void __thiscall ros::NodeHandle_<class WindowsSocket,25,25,512,512>::initNode(char
edit retag flag offensive close merge delete

Comments

Please just edit your original post using the edit link/button if you have any new information. I've already done it, but if you could do it for future updates, that would be appreciated. Thanks.

gvdhoorn gravatar image gvdhoorn  ( 2016-01-02 04:13:38 -0600 )edit