Package can't be build
Hello all ! I can't build the package. First i created the package. and then modified CMakelist.txt and Package.xml files. as required. At the time of typing catkin_make
command, the following error appears.
CMake Error at ros_tutorials_topic/CMakeLists.txt:143 (add_executable):
Cannot find source file:
src/ros_tutorials_topic_node.cpp
Tried extensions .c .C .c++ .cc .cpp .cxx .m .M .mm .h .hh .h++ .hm .hpp
.hxx .in .txx
CMake Error: CMake can not determine linker language for target: ros_tutorials_topic
CMake Error: Cannot determine link language for target "ros_tutorials_topic".
CMake Error: CMake can not determine linker language for target: ros_tutorials_topic_node
CMake Error: Cannot determine link language for target "ros_tutorials_topic_node".
-- Generating done
-- Build files have been written to: /home/ibrahim/catkin_ws/build
Makefile:1690: recipe for target 'cmake_check_build_system' failed
make: *** [cmake_check_build_system] Error 1
Invoking "make cmake_check_build_system" failed
It refers to this line in CMakelists.txt file
## Declare a C++ executable
## With catkin_make all packages are built within a single CMake context
## The recommended prefix ensures that target names across packages don't collide
How to fix this problem. Please
add_executable(${PROJECT_NAME}_node src/ros_tutorials_topic_node.cpp)
Does the file
ros_tutorials_topic/src/ros_tutorials_topic_node.cpp
(relative to your catkin workspace) actually exists? Check for typos in the filename (or dols ros_tutorials_topic/src/ros_tutorials_topic_node.cpp
).Sir this is exactly the problem that when i build
test_pkg
in ROS by default, then that CPP file is there. but when i make a package of my own then it gives me this error.Can you post the full CMakeLists.txt and tell us which files are actually present (e.g. the output of the
tree
command)? Without that information, it's more or less impossible to see what's going on.thanks sir, i solved it. bundle of thanks
Maybe it is interesting for future visitors to tell what the problem was.
actually sir the problem was not so complicated but as i am new so it looks difficult to me. i just removed this line from XML file.
add_executable(${PROJECT_NAME}_node src/ros_tutorials_topic_node.cpp)