I try to use the OpenCV Interface of Raspicam (Version 0.1.3).
A minimal example won't compile:
Contents ofmain.cpp
#include <raspicam/raspicam_cv.h>
using namespace std;
int main ( int argc,char **argv ) {
raspicam::RaspiCam_Cv Camera;
return 0;
}
Minimal command to compile and link:
g++ main.cpp -o main -I/usr/local/include/ -lraspicam -lraspicam_cv
Throws this errors:
//usr/local/lib/libraspicam_cv.so: undefined reference to `raspicam::_private::Private_Impl_Still::getContrast()'
//usr/local/lib/libraspicam_cv.so: undefined reference to `raspicam::_private::Private_Impl::setExposure(raspicam::RASPICAM_EXPOSURE)'
//usr/local/lib/libraspicam_cv.so: undefined reference to `raspicam::_private::Private_Impl_Still::getId[abi:cxx11]() const'
//usr/local/lib/libraspicam_cv.so: undefined reference to `raspicam::_private::Private_Impl::setISO(int)'
//usr/local/lib/libraspicam_cv.so: undefined reference to `raspicam::_private::Private_Impl::grab()'
//usr/local/lib/libraspicam_cv.so: undefined reference to `raspicam::_private::Private_Impl::~Private_Impl()'
//usr/local/lib/libraspicam_cv.so: undefined reference to `raspicam::_private::Private_Impl::setHeight(unsigned int)'
//usr/local/lib/libraspicam_cv.so: undefined reference to `raspicam::_private::Private_Impl_Still::setWidth(unsigned int)'
//usr/local/lib/libraspicam_cv.so: undefined reference to `raspicam::_private::Private_Impl::setShutterSpeed(unsigned int)'
//usr/local/lib/libraspicam_cv.so: undefined reference to `raspicam::_private::Private_Impl::setAWB(raspicam::RASPICAM_AWB)'
//usr/local/lib/libraspicam_cv.so: undefined reference to `raspicam::_private::Private_Impl_Still::setDefaults()'
//usr/local/lib/libraspicam_cv.so: undefined reference to `raspicam::_private::Private_Impl_Still::initialize()'
//usr/local/lib/libraspicam_cv.so: undefined reference to `raspicam::_private::Private_Impl_Still::setVerticalFlip(bool)'
//usr/local/lib/libraspicam_cv.so: undefined reference to `raspicam::_private::Private_Impl::setAWB_RB(float, float)'
//usr/local/lib/libraspicam_cv.so: undefined reference to `raspicam::_private::Private_Impl::getId[abi:cxx11]() const'
//usr/local/lib/libraspicam_cv.so: undefined reference to `raspicam::_private::Private_Impl::Private_Impl()'
//usr/local/lib/libraspicam_cv.so: undefined reference to `raspicam::_private::Private_Impl_Still::setHeight(unsigned int)'
//usr/local/lib/libraspicam_cv.so: undefined reference to `raspicam::_private::Private_Impl_Still::getISO()'
//usr/local/lib/libraspicam_cv.so: undefined reference to `raspicam::_private::Private_Impl::setContrast(int)'
//usr/local/lib/libraspicam_cv.so: undefined reference to `raspicam::_private::Private_Impl::setBrightness(unsigned int)'
//usr/local/lib/libraspicam_cv.so: undefined reference to `raspicam::_private::Private_Impl::setSaturation(int)'
//usr/local/lib/libraspicam_cv.so: undefined reference to `raspicam::_private::Private_Impl::setWidth(unsigned int)'
//usr/local/lib/libraspicam_cv.so: undefined reference to `raspicam::_private::Private_Impl::release()'
//usr/local/lib/libraspicam_cv.so: undefined reference to `raspicam::_private::Private_Impl_Still::getSaturation()'
//usr/local/lib/libraspicam_cv.so: undefined reference to `raspicam::_private::Private_Impl_Still::getHeight()'
//usr/local/lib/libraspicam_cv.so: undefined reference to `raspicam::_private::Private_Impl_Still::setEncoding(raspicam::RASPICAM_ENCODING)'
//usr/local/lib/libraspicam_cv.so: undefined reference to `raspicam::_private::Private_Impl_Still::getImageBufferSize() const'
//usr/local/lib/libraspicam_cv.so: undefined reference to `raspicam::_private::Private_Impl_Still::getBrightness()'
//usr/local/lib/libraspicam_cv.so: undefined reference to `raspicam::_private::Private_Impl_Still::getWidth()'
//usr/local/lib/libraspicam_cv.so: undefined reference to `raspicam::_private::Private_Impl::retrieve(unsigned char*, raspicam::RASPICAM_FORMAT)'
//usr/local/lib/libraspicam_cv.so: undefined reference to `raspicam::_private::Private_Impl_Still::setBrightness(unsigned int)'
//usr/local/lib/libraspicam_cv.so: undefined reference to `raspicam::_private::Private_Impl::open(bool)'
//usr/local/lib/libraspicam_cv.so: undefined reference to `raspicam::_private::Private_Impl_Still::setContrast(int)'
//usr/local/lib/libraspicam_cv.so: undefined reference to `raspicam::_private::Private_Impl_Still::setSaturation(int)'
//usr/local/lib/libraspicam_cv.so: undefined reference to `raspicam::_private::Private_Impl_Still::setISO(int)'
//usr/local/lib/libraspicam_cv.so: undefined reference to `raspicam::_private::Private_Impl_Still::takePicture(unsigned char*, unsigned int)'
//usr/local/lib/libraspicam_cv.so: undefined reference to `raspicam::_private::Private_Impl::setFormat(raspicam::RASPICAM_FORMAT)'
collect2: error: ld returned 1 exit status
What is the problem? How do I solve it?