I am trying to compile a ROS package in Windows. I follow the procedure to set the ROS environment described here http://wiki.ros.org/Installation/Windows . I want to compile a ROS package tested and working on ROS in Linux. This package has to use a static library (.lib) compiled with Visual Studio 2019. I add the dependency in My CMakeList.txt as follow:
add_library(name STATIC IMPORTED)
set_property(TARGET name PROPERTY IMPORTED_LOCATION ${PROJECT_SOURCE_DIR}/api/lib/name_of_lib.lib)
target_link_library(node_name
PUBLIC
${catkin_LIBRARIES}
name)
After running the command catkin_make from the Visual Studio shell i received the error LNK2019 for a function defined in the .lib file. The error is: “CMakeFiles.....\manifest.res failed (exit code 1120) with the following output: communication_handler.cpp.obj:error LNK2019: unresolved external symbol ..... “
The .lib file Was generated on the same computer With the same VisualStudio version of the developer command prompt. Can anyone help me?