[OpenCv 2.3.1] Linking error

794 views
Skip to first unread message

muktoshuvro

unread,
Apr 21, 2012, 5:29:36 PM4/21/12
to android...@googlegroups.com
Hello everyone,

Need a big hand in following regards.If someone can point me out what should I do in this circumstances.The thing is I want run a sample program of opencv 2.2 in my setup opencv 2.3.1 with visual studio 2010. Actually for some wired reason it says it has linking error even though I do configured in project directories. I also tried by changing version in VS 2008 and using opencv 2.1,2.2,2.3,2.4. Seems like I am in no where to find why this shit is happening with me !! 

Errors are : 

1>main.obj : error LNK2019: unresolved external symbol “void __cdecl cv::imshow(class std::basic_string<char,struct std::char_traits,class std::allocator > const &,class cv::Mat const &)” (?imshow@cv@@YAXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@ABVMat@1@@Z) referenced in function “public: void __thiscall App::run(void)” (?run@App@@QAEXXZ)

1>main.obj : error LNK2019: unresolved external symbol “public: virtual void __thiscall cv::HOGDescriptor::detectMultiScale(class cv::Mat const &,class std::vector<class cv::Rect_,class std::allocator<class cv::Rect_ > > &,double,class cv::Size_,class cv::Size_,double,int)const ” (?detectMultiScale@HOGDescriptor@cv@@UBEXABVMat@2@AAV?$vector@V?$Rect_@H@cv@@V?$allocator@V?$Rect_@H@cv@@@std@@@std@@NV?$Size_@H@2@2NH@Z) referenced in function “public: void __thiscall App::run(void)” (?run@App@@QAEXXZ)
1>main.obj : error LNK2019: unresolved external symbol “public: void __thiscall cv::Mat::copyTo(class cv::Mat &)const ” (?copyTo@Mat@cv@@QBEXAAV12@@Z) referenced in function “public: void __thiscall App::run(void)” (?run@App@@QAEXXZ)

1>main.obj : error LNK2019: unresolved external symbol “void __cdecl cv::cvtColor(class cv::Mat const &,class cv::Mat &,int,int)” (?cvtColor@cv@@YAXABVMat@1@AAV21@HH@Z) referenced in function “public: void __thiscall App::run(void)” (?run@App@@QAEXXZ)

1>main.obj : error LNK2019: unresolved external symbol “void __cdecl cv::resize(class cv::Mat const &,class cv::Mat &,class cv::Size_,double,double,int)” (?resize@cv@@YAXABVMat@1@AAV21@V?$Size_@H@1@NNH@Z) referenced in function “public: void __thiscall App::run(void)” (?run@App@@QAEXXZ)

1>main.obj : error LNK2001: unresolved external symbol “public: virtual void __thiscall cv::HOGDescriptor::setSVMDe

Christian Haake

unread,
Apr 22, 2012, 5:28:05 AM4/22/12
to android...@googlegroups.com
Actually this is an OpenCV for Android mailing list.
I for myself do not know anything about VS 2010. But it looks like VS does not find the OpenCV library while compiling. You should have a look where to set the linker flags within VS. Also make sure OpenCV paths are set correctly within your OS and OpenCV is installed correctly.
Greetz

peppschmier

unread,
Apr 23, 2012, 2:37:47 AM4/23/12
to android...@googlegroups.com
Altough this is not an android question, i could have a hint:

I got similar error messages when I tried to do OpenCV with Visual Studio. If you followed the ToDos correctly (as I did) - there was one trap:
If you compile your OpenCV library for x64 you have to change your project settings in VS to x64, otherwise you get those linking errors.
As I mentioned, that COULD be one reason...
Reply all
Reply to author
Forward
0 new messages