Ask Your Question
0

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
 roscpp
 rospy
 std_msgs
 cv_bridge
 image_geometry

)
find_package(OpenCV REQUIRED

)
include_directories(
${catkin_INCLUDE_DIRS} & ${OpenCV_INCLUDE_DIRS}
)
add_executable(vision1 src/vision.cpp)
target_link_libraries(vision1
   ${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
2

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

Stats

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

Seen: 1,175 times

Last updated: Jul 30 '14