Menu

#2 Error compiling simpletest_raspicam_cv.cpp

1.0
open
nobody
2015-09-08
2014-02-12
magnatag
No

Hello,

I'm excited about your raspicam_cv library! I think it has tremendous application, especially once the still capture feature gets introduced.

I've followed your instructions for the install (I'm installing on Raspberry Pi) and I've been having issues compiling the simpletest_raspicam_cv.cpp example that you have posted. My first compiling attempt was done using cmake and I got a notification that package "raspicam" could not be found.

CMakeLists.txt:

cmake_minimum_required (VERSION 2.8)
project (raspicam_test)
find_package(raspicam REQUIRED)
find_package(OpenCV)
IF ( OpenCV_FOUND AND raspicam_CV_FOUND)
MESSAGE(STATUS "COMPILING OPENCV TESTS")
add_executable (simpletest_raspicam_cv simpletest_raspicam_cv.cpp)
target_link_libraries (simpletest_raspicam_cv ${raspicam_CV_LIBS})
ELSE()
MESSAGE(FATAL_ERROR "OPENCV NOT FOUND IN YOUR SYSTEM")
ENDIF()

Error when run with "cmake .."

Could not find a package configuration file provided by "raspicam" with any of the following names:

raspicamConfig.cmake
raspicam-config.cmake

Add the installation prefix of "raspicam" to CMAKE_PREFIX_PATH or set "raspicam_DIR" to a directory containing one of the abouve files. If "raspicam" provides a separate development package or SDK, be sure it has been installed.

I'm not really sure what that means, as I've followed your installation instructions very carefully.

My 2nd compiling attempt was done using g++ based on what you had on your website. With g++ I got the following error:

/usr/bin/ld: cannot find -lmmal
/usr/bin/ld: cannot find -lmmal_core
/usr/bin/ld: cannot find -lmmal_util
collect2: ld returned 1 exit status

Now, I do have full openCV and userland libraries installed with RaspiCam_CV based on robidouille's work. (https://github.com/erget/robidouille/tree/master/raspicam_cv). I can make and compile files using his libraries but looking at specs, I can get better performance with your library. I am also looking for a way to use video AND stills with OpenCV.

Any kind of help would be greatly appreciated! Thanks!

Discussion

  • Erik Petrich

    Erik Petrich - 2014-02-26

    I ran into this problem as well. I'm not a cmake guru, so there may be a better way, but I was able to compile by adding this to the CMakeLists.txt:

    SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} /usr/local/lib/cmake/)

    The "/usr/local/lib/cmake/" is the location of the raspicamConfig.cmake file that it is looking for; adjust this accordingly if it's installed somewhere else on your system.

     
    • magnatag

      magnatag - 2014-02-26

      That makes sense. I'll give that a try. Thanks! You're more guru than me, that's for sure!

       

      Last edit: magnatag 2014-02-26
  • Jan Kucera

    Jan Kucera - 2015-09-08

    Erik, your solution is working for me! Thanks a lot!

     

Log in to post a comment.