I am trying to make a project for the Pi B+ using ROS, RaspiCam and OpenCV (in c++). I want to write my code in QTCreator in a Virtual Machine running Ubuntu 14.04, and then transfer the files to my Pi.

My test project (taking an image from the camera) builds and runs fine on the Pi, but when i include and use the "raspicam.h" in QTCreator in Ubuntu, it gives me multiple "undefined reference to ´raspicam::_private::Private_impl::[...]" errors ([...] being setISO(), grab(), setHeight() etc).

I know I can´t run the project in Ubuntu, but i was hoping that i still could compile the project to check for errors.

I am quite new to Linux (both Ubuntu and Raspbian)

  • I am using the same cpp and CMakeLists.txt files as on the Pi
  • I have installed Raspicam 0.1.3 on my Pi and in Ubuntu.
  • I have exported raspicam_DIR as the build directory in raspicam-0.1.3

In my CMakeLists.txt I do

find_package(raspicam REQUIRED)

find_package(OpenCV REQUIRED)

add_executable(image_reader src/image_reader.cpp)

target_link_libraries(image_reader ${catkin_LIBRARIES})

target_link_libraries(image_reader ${OpenCV_LIBS})

target_link_libraries(image_reader ${raspicam_CV_LIBS})

add_dependencies(image_reader image_tests_gencpp)

Did i miss something?

enter image description here


2 Answers 2


I just found my mistake, I had to add both ${raspicam_LIBS} AND ${raspicam_CV_LIBS}. Hope this helps someone


You should get the library from this link: https://github.com/cedricve/raspicam After that build all these source, the library will ready on your Raspi Finally, You add cmd -lraspicam -lraspicam_cv into your makefile

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.