Robotics StackExchange | Archived questions

CMake can not determine linker language

Hey guys,

I'm attempting to run the pclvisualizerdemo.cpp found here: http://pointclouds.org/documentation/tutorials/pcl_visualizer.php

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 pclvisualizer.cpp in the catkinws/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)

project(pcl_visualizer)

find_package(PCL 1.2 REQUIRED)

include_directories(${PCL_INCLUDE_DIRS})
link_directories(${PCL_LIBRARY_DIRS})
add_definitions(${PCL_DEFINITIONS})

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?

Asked by acollins on 2017-06-19 09:07:33 UTC

Comments

Answers

Maybe the CMakeList.txt code is lacked of

set_target_properties(XX PROPERTIES LINKER_LANGUAGE C++)

in the end of the file.

Asked by Huang Dingliang on 2021-04-18 10:44:20 UTC

Comments