ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Hello World from Windows - Errors in Visual Studio

asked 2016-08-09 20:50:19 -0500

doullylogo gravatar image

updated 2016-08-09 21:26:59 -0500

Hello, I am having trouble running the code from Hello World from Windows - ROS.

I'm using Visual Studio 2015 on Windows 7. I followed the step-by-step guide, but get the following errors when Building Solution rosserial_hello_world.cpp:

1>------ Build started: Project: rosserial_hello_world, Configuration: Debug Win32 ------  1>  rosserial_hello_world.cpp  1>rosserial_hello_world.obj : error LNK2019: unresolved external symbol "public: __thiscall WindowsSocket::WindowsSocket(void)" (??0WindowsSocket@@QAE@XZ) referenced in function "public: __thiscall ros::NodeHandle_<class WindowsSocket,25,25,512,512>::NodeHandle_<class WindowsSocket,25,25,512,512>(void)" (??0?$NodeHandle_@VWindowsSocket@@$0BJ@$0BJ@$0CAA@$0CAA@@ros@@QAE@XZ)  1>rosserial_hello_world.obj : error LNK2019: unresolved external symbol "public: int __thiscall WindowsSocket::read(void)" (?read@WindowsSocket@@QAEHXZ) referenced in function "public: virtual int __thiscall ros::NodeHandle_<class WindowsSocket,25,25,512,512>::spinOnce(void)" (?spinOnce@?$NodeHandle_@VWindowsSocket@@$0BJ@$0BJ@$0CAA@$0CAA@@ros@@UAEHXZ)  1>rosserial_hello_world.obj : error LNK2019: unresolved external symbol "public: void __thiscall WindowsSocket::write(unsigned char const *,int)" (?write@WindowsSocket@@QAEXPBEH@Z) referenced in function "public: virtual int __thiscall ros::NodeHandle_<class WindowsSocket,25,25,512,512>::publish(int,class ros::Msg const *)" (?publish@?$NodeHandle_@VWindowsSocket@@$0BJ@$0BJ@$0CAA@$0CAA@@ros@@UAEHHPBVMsg@2@@Z)  1>rosserial_hello_world.obj : error LNK2019: unresolved external symbol "public: unsigned long __thiscall WindowsSocket::time(void)" (?time@WindowsSocket@@QAEKXZ) referenced in function "public: void __thiscall ros::NodeHandle_<class WindowsSocket,25,25,512,512>::requestSyncTime(void)" (?requestSyncTime@?$NodeHandle_@VWindowsSocket@@$0BJ@$0BJ@$0CAA@$0CAA@@ros@@QAEXXZ)  1>rosserial_hello_world.obj : error LNK2019: unresolved external symbol "void __cdecl ros::normalizeSecNSec(unsigned int &,unsigned int &)" (?normalizeSecNSec@ros@@YAXAAI0@Z) referenced in function "public: void __thiscall ros::NodeHandle_<class WindowsSocket,25,25,512,512>::setNow(class ros::Time &)" (?setNow@?$NodeHandle_@VWindowsSocket@@$0BJ@$0BJ@$0CAA@$0CAA@@ros@@QAEXAAVTime@2@@Z)  1>C:\Users\doullylogo\Desktop\rosserial_hello_world\Debug\rosserial_hello_world.exe : fatal error LNK1120: 5 unresolved externals  ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2016-08-09 21:30:45 -0500

doullylogo gravatar image

updated 2016-08-09 21:31:45 -0500

There was ambiguity in 3.3 Add ros_lib to project. I was mistaken by confusing 'project' with 'project folder'

It was suggested that I (in Visual Studio 2015): right-click Header Files, Add -> Existing Item..., and Add all of the files in the ros_lib folder that aren't in subfolders to your project..

In other words: include the header files.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2016-08-09 20:50:19 -0500

Seen: 602 times

Last updated: Aug 09 '16