在CMakeLIsts.txt中不要乱加教程中给的代码
只需要把已经注释的代码取消注释就可以
target_link_libraries(${PROJECT_NAME}_node
${catkin_LIBRARIES}
)
add_executable(${PROJECT_NAME}_node src/hello_node.cpp)
只需要把这两句取消注释,注意第二句的hello_node.cpp必须和你的包下面的src中的.cpp文件同名
在CMakeLIsts.txt中不要乱加教程中给的代码
只需要把已经注释的代码取消注释就可以
target_link_libraries(${PROJECT_NAME}_node
${catkin_LIBRARIES}
)
add_executable(${PROJECT_NAME}_node src/hello_node.cpp)
只需要把这两句取消注释,注意第二句的hello_node.cpp必须和你的包下面的src中的.cpp文件同名