Undefined reference to cv::solvePnP...
Hi,
I am using OpenCV on Windows. I develop on CodeBlocks. I linked the librairies, like you can see here :
I don't have any problem to use functions that are declared in opencv2/imgproc/imgproc.hpp
library. Thus, I can't use functions that are declared in opencv2/calib3d/calib3d.hpp
such as cv::solvePnP
and others. The compiler returns me this error :
undefined reference to `cv::solvePnP(cv::_InputArray const&, cv::_InputArray const&, cv::_InputArray const&, cv::_InputArray const&, cv::_OutputArray const&, cv::_OutputArray const&, bool, int)'
I guess that the origin of the problem is that there is no dynamic library for calib3d
that is linked. But I don't know how to add it.
Thanks for any help,
we cannot help you with "how to use your ide", but:
just add a similar line for opencv_calib3d341 there ?
Thanks for answer,
This is the error that occurs after doing that :
@Kamel, in this case you have to back at building the opencv libs (cmake, make), and try to find out, why it was not built/installed.
try, and report back.
you also have to build mingw libs with:
last: using mingw32-g++.exe will produce 32bit libs/executables. unless your os is 32bit only, that's a terrible choice. consider changing your compiler toolchain to latest mingw-64 (7.3.0)
@berak Thanks for answer,
I attempted to build mingw libs by this way :
An error occurs. Therefore, if I use existing libs, it works :
I read :
But there is still no calib3d library.
Concerning mingw version, I tried to set 64b version, but there is no change.
Regards,
you should start cmake from C:/opencv/build
maybe try to use cmake-gui instead, you get a better overview, what's on or off this way
@berak There is no problem when I run cmake. But when I do :
The installation continues until this line :
Here, errors are occuring :
And so ones. I think that the installation stop before calib3d library is installed. May be the problem is the MinGW version (6.3.0) ?
yes. it expects your compiler to have c++11 support here
I updated MinGW, now the version is the latest :
I ran cmake again, no problem. Then I tried to build opencv libraries with mingw :
It continued until this line :
Here, the program stopped and I read :
Thanks for any help,
that's not the actual error (which should be a few lines up)
@berak What do you mean ?