c++ - Mergevec.obj: 10 unresolved linking errors (OpenCV samples collection for haartraining) -


using this tutorial, i'm trying merge different vectors created using opencv_createsamples can haartraining.

i'm compiling mergevec.cpp using vs 2010 command line interface:

cl /ehsc mergevec.cpp 

but 10 unresolved externals errors, here:

/out:mergevec.exe mergevec.obj  mergevec.obj : error lnk2019: unresolved external symbol _cvfree_ referenced in function "void __cdecl icvappendvec(struct cvvecfile &,struct cvvecfile &,int *,int,int)" (?icvappendvec@@yaxaaucvvecfile@@0pahhh@z)  mergevec.obj : error lnk2019: unresolved external symbol _cvreleasemat referenced in function "void __cdecl icvappendvec(struct cvvecfile &,struct cvvecfile &,int *,int,int)" (?icvappendvec@@yaxaaucvvecfile@@0pahhh@z)  mergevec.obj : error lnk2019: unresolved external symbol _cvwaitkey referenced in function "void __cdecl icvappendvec(struct cvvecfile &,struct cvvecfile &,int*,int,int)" (?icvappendvec@@yaxaaucvvecfile@@0pahhh@z)  mergevec.obj : error lnk2019: unresolved external symbol _cvshowimage referenced in function "void __cdecl icvappendvec(struct cvvecfile &,struct cvvecfile &,int *,int,int)" (?icvappendvec@@yaxaaucvvecfile@@0pahhh@z)  mergevec.obj : error lnk2019: unresolved external symbol "void __cdecl icvwritevecsample(struct _iobuf *,void *)" (?icvwritevecsample@@yaxpau_iobuf@@pax@z) referenced in function "void __cdecl icvappendvec(struct cvvecfile &,struct cvvecfile &,int *,int,int)" (?icvappendvec@@yaxaaucvvecfile@@0pahhh@z)  mergevec.obj : error lnk2019: unresolved external symbol "int __cdecl icvgethaar trainindatafromveccallback(struct cvmat *,void *)" (?icvgethaartrainindatafromveccallback@@yahpaucvmat@@pax@z) referenced in function "void __cdecl icvappendvec (struct cvvecfile &,struct cvvecfile &,int *,int,int)" (?icvappendvec@@yaxaaucvv ecfile@@0pahhh@z)  mergevec.obj : error lnk2019: unresolved external symbol _cvcreatemat referenced in function "void __cdecl icvappendvec(struct cvvecfile &,struct cvvecfile &,int *,int,int)" (?icvappendvec@@yaxaaucvvecfile@@0pahhh@z)  mergevec.obj : error lnk2019: unresolved external symbol _cvalloc referenced in function "void __cdecl icvappendvec(struct cvvecfile &,struct cvvecfile &,int *, int,int)" (?icvappendvec@@yaxaaucvvecfile@@0pahhh@z)  mergevec.obj : error lnk2019: unresolved external symbol _cvnamedwindow referenced in function "void __cdecl icvappendvec(struct cvvecfile &,struct cvvecfile &,int *,int,int)" (?icvappendvec@@yaxaaucvvecfile@@0pahhh@z)  mergevec.obj : error lnk2019: unresolved external symbol "void __cdecl icvwritev echeader(struct _iobuf *,int,int,int)" (?icvwritevecheader@@yaxpau_iobuf@@hhh@z)  referenced in function "void __cdecl icvmergevecs(char *,char const *,int,int,int)" (?icvmergevecs@@yaxpadpbdhhh@z)  mergevec.exe : fatal error lnk1120: 10 unresolved externals 

how can fix these problems? need .dlls? i've been struggling getting mergevec work, on different machines, 2 days! problem old?

by way, changed references in code "cv.h" "opencv.h", since that's current header file's name.

i'm trying compile mergevec.cpp in folder following structure:

  opencv/   opencv2/  cmakelists.txt createsamples.cpp cvboost.cpp cvclassifier.h cvcommon.cpp cvhaarclassifier.cpp cvhaartraining.cpp cvhaartraining.h cvsamples.cpp cxcore.h cxmisc.h haartraining.cpp mergevec.cpp opencv.hpp performance.cpp _cvcommon.h _cvhaartraining.h 

the folder opencv2 has directories: core, highgui, flann, contrib etc etc.

edit

based on comments, i've changed command include libraries:

cl /ehsc mergevec.cpp  c:\opencv\build\x64\vc10\lib\opencv_core247d.lib  c:\opencv\build\x64\vc10\lib\opencv_highgui247d.lib  c:\opencv\build\x64\vc10\lib\opencv_flann247d.lib  c:\opencv\build\x64\vc10\lib\opencv_imgproc247d.lib 

but it's still showing same 10 unresolved externals. in desperation tried including every single library file, no difference.

visual studio doesn't seems find opencv library, seems pkg-config missing problem. check not sure how works on windows. have linked opencv library in project properties?

otherwise if still doesn't work on vs suggest compile under linux (wm or not). check post further informations.


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -