linker error VC++
I tried to compile the code in this example
http://wiki.ros.org/ROS/Tutorials/Wri... (actually integrating it in a program I'm writing where i want to set up a node and, at certain points in time, i want to publish a trigger message).
I'm using visual studio 19 + ros noetic on windows 10. I set up the project properties to use the include directory that in my case is "C:\opt\ros\noetic\x64\include" (i followed the instructions from http://wiki.ros.org/Installation/Windows for installation), this makes the two #include statements work properly:
#include <ros/ros.h>
#include <std_msgs/String.h>
the error is thrown by the linker as the functions
ros::init(argc, argv, "Platform");
ros::NodeHandle n;
ros::Publisher chatter_pub = n.advertise<std_msgs::String>("trigger", 1000);
seem not to be defined although they are declared, e.g.:
Error LNK2019 unresolved external symbol "void __cdecl ros::init(int &,char * *,class std::basic_string<char,struct std::char_traits<char="">,class std::allocator<char> > const &,unsigned int)" (?init@ros@@YAXAAHPAPADABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@I@Z) referenced in function _main TablePhyPos_CPP_Comtest D:\GitHub\COMTEST\PLATFORM\TablePhyPos_CPPComtest\main.obj
Any idea about what am I missing to link the definitions? thanks in advance for any advice, I apologize in case the problem happens to be caused by the fact that I'm clumsy with visual studio...