Trouble In running a new algorithm I've added to OpenCV

asked 2014-03-17 09:58:28 -0500


I've added a new algorithm for feautures2d. I've edited the features2d.hpp file and added a new cpp file to the features2d module.

I've built the project INSTALL to create a new folder containing the new hpp files and new lib files. The folder is named "C:\OpenCV_2_4_5 for gil\opencv\BuildedLib\install".

I've created a new solution and project to test the new algorithm. I've include the hpp files from "C:\OpenCV_2_4_5 for gil\opencv\BuildedLib\install\include" and linked to the libs under "C:\OpenCV_2_4_5 for gil\opencv\BuildedLib\install\lib", but I'm getting the following linker errors:

1>OIM2.obj : error LNK2019: unresolved external symbol "public: virtual __cdecl cv::Algorithm::~Algorithm(void)" ([email protected]@@[email protected]) referenced in function "public: void __cdecl cv::BriefDescriptorExtractor::`vbase destructor'(void)" ([email protected]@@QEAAXXZ)
1>OIM2.obj : error LNK2019: unresolved external symbol "public: virtual __cdecl cv::DescriptorExtractor::~DescriptorExtractor(void)" ([email protected]@@[email protected]) referenced in function "public: virtual __cdecl cv::BriefDescriptorExtractor::~BriefDescriptorExtractor(void)" ([email protected]@@[email protected])
1>OIM2.obj : error LNK2019: unresolved external symbol "public: __cdecl cv::BriefDescriptorExtractor::BriefDescriptorExtractor(int)" ([email protected]@@[email protected]@Z) referenced in function main

Here is my (very simple) code:

#include "cv.h" 
#include "opencv2/core/core_c.h"
#include "opencv2/core/core.hpp"
#include "opencv2/flann/miniflann.hpp"
#include "opencv2/imgproc/imgproc_c.h"
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/photo/photo.hpp"
#include "opencv2/video/video.hpp"
#include "opencv2/features2d/features2d.hpp"
#include "opencv2/objdetect/objdetect.hpp"
#include "opencv2/calib3d/calib3d.hpp"
#include "opencv2/ml/ml.hpp"
#include "opencv2/highgui/highgui_c.h"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/contrib/contrib.hpp"

using namespace cv;

int main( int argc, char** argv )
    BriefDescriptorExtractor Brief(32);


Can someone please help me resolve this errors? I would like to contribute the algorithm to OpenCv, but first, I need to get it working :)



edit retag flag offensive close merge delete


Hi Gil. This may not be a real solution but I tested your code with VS 2012, OpenCV 2.4.8 (prebuilt) and did not have any problem, in both Release and Debug build mode. May be OpenCV 2.4.8 is a worthy trying.

tuannhtn gravatar imagetuannhtn ( 2014-03-17 11:09:11 -0500 )edit

Hi @tuannhtn, I you use the pre-build opencv folders then it also works, but I'm trying to get it working using the new libs I produced when building the OpenCV solution. Thanks!!

GilLevi gravatar imageGilLevi ( 2014-03-17 12:00:08 -0500 )edit

solved it ?

berak gravatar imageberak ( 2014-03-19 10:40:30 -0500 )edit

Unfortunately not, I'll try to clear and rebuild and update you if it worked.

GilLevi gravatar imageGilLevi ( 2014-03-19 10:56:45 -0500 )edit

ah shame.

if you need 'testers' later on, just say so ....

berak gravatar imageberak ( 2014-03-19 11:04:57 -0500 )edit

Thanks @berak !

GilLevi gravatar imageGilLevi ( 2014-03-19 11:20:32 -0500 )edit