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

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



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

Seen: 1,932 times

Last updated: Jun 19 '17