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

CMake can not determine linker language

asked 2017-06-19 09:07:33 -0500

acollins gravatar image

updated 2017-06-19 09:09:58 -0500

Hey guys,

I'm attempting to run the pcl_visualizer_demo.cpp found here:

I have taken the _demo off the .cpp file and in the CMakeLists.txt.

I ran:

 catkin_create_pkg pcl_visualizer roscpp std_msgs rospy

I then placed the pcl_visualizer.cpp in the catkin_ws/src/pcl_visualizer/src folder

this is my full CMakeLists.txt file, as specified by the tutorial linked above, with only the _demo removed from the appropriate places. (note that I still get the same error even with _demo being included and the package being named appropriately for that as well).

cmake_minimum_required(VERSION 2.6 FATAL_ERROR)


find_package(PCL 1.2 REQUIRED)


add_executable (pcl_visualizer pcl_visualizer.cpp)
target_link_libraries (pcl_visualizer ${PCL_LIBRARIES})

When I run the catkin_make, I get this error:

CMake Error: CMake can not determine linker language for target: pcl_visualizer
CMake Error: Cannot determine link language for target "pcl_visualizer".

Does anyone have any suggestions as to what could be causing this?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2021-04-18 10:44:20 -0500

Maybe the CMakeList.txt code is lacked of

set_target_properties(XX PROPERTIES LINKER_LANGUAGE C++)

in the end of the file.

edit flag offensive delete link more

Question Tools



Asked: 2017-06-19 09:07:33 -0500

Seen: 3,316 times

Last updated: Jun 19 '17