ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

Compilation error /usr/bin/ld: cannot find -l& [closed]

asked 2014-07-30 08:00:51 -0600

chiongsterx gravatar image

updated 2014-07-30 08:02:17 -0600

This is the error i received when compiling and i am not sure how to fix this error.

[100%] Building CXX object vision/CMakeFiles/vision1.dir/src/vision.cpp.o
Linking CXX executable /home/chiongsterx/catkin_ws/devel/lib/vision/vision1
/usr/bin/ld: cannot find -l&
collect2: ld returned 1 exit status
make[2]: *** [/home/chiongsterx/catkin_ws/devel/lib/vision/vision1] Error 1
make[1]: *** [vision/CMakeFiles/vision1.dir/all] Error 2
make: *** [all] Error 2
Invoking "make" failed

This is my cmakelists. Not sure whethere package is placed correctly

find_package(catkin REQUIRED COMPONENTS

find_package(OpenCV REQUIRED

add_executable(vision1 src/vision.cpp)
   ${catkin_LIBRARIES} & ${OpenCV_LIBRARIES}
edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by chiongsterx
close date 2014-08-05 04:01:27.024387

1 Answer

Sort by ยป oldest newest most voted

answered 2014-07-30 12:26:48 -0600

ahendrix gravatar image

You've specified an ampersand character ( & ) in your include directories and as a library to link to - the linker is simply informing you that it can't find a library named &

You don't need to use the & as a separator when specifying multiple include directories or libraries in CMake - whitespace is sufficient.

(If any of the documentation suggests that you should use & in this fashion, it is wrong and should be corrected)

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2014-07-30 08:00:51 -0600

Seen: 1,436 times

Last updated: Jul 30 '14