Ask Your Question
0

Opencv 2.4.3 linker errors, using visual studio.

asked 2013-01-24 08:10:49 -0600

paul23 gravatar image

Basically I get 100s of linker errors when I try to load a simple test, I included the include directory correctly as well as the library (\build\x86\vc10\staticlib directory. However I get these errors:

1>main.obj : warning LNK4217: locally defined symbol ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@N@Z (public: class std::basic_ostream<char,struct std::char_traits<char=""> > & __thiscall std::basic_ostream<char,struct std::char_traits<char=""> >::operator<<(double)) imported in function _main 1>main.obj : warning LNK4217: locally defined symbol ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@H@Z (public: class std::basic_ostream<char,struct std::char_traits<char=""> > & __thiscall std::basic_ostream<char,struct std::char_traits<char=""> >::operator<<(int)) imported in function _main 1>opencv_core243d.lib(dxt.obj) : error LNK2001: unresolved external symbol ___security_cookie 1>opencv_imgproc243d.lib(color.obj) : error LNK2001: unresolved external symbol ___security_cookie

(and so on till I get fatal error LNK1120: 318 unresolved externals). The actual library list I imported into the project is:

opencv_calib3d243d.lib
opencv_contrib243d.lib
opencv_core243d.lib
opencv_features2d243d.lib
opencv_flann243d.lib
opencv_gpu243d.lib
opencv_haartraining_engined.lib
opencv_highgui243d.lib
opencv_imgproc243d.lib
opencv_legacy243d.lib
opencv_ml243d.lib
opencv_nonfree243d.lib
opencv_objdetect243d.lib
opencv_photo243d.lib
opencv_stitching243d.lib
opencv_ts243d.lib
opencv_video243d.lib
opencv_videostab243d.lib

What goes wrong? What step am I missing to include?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2013-01-24 09:18:59 -0600

unxnut gravatar image

Did you specify the location of the library?

edit flag offensive delete link more

Comments

yes, as I said I included the staticlib path in the library folder: $(OPENCV_DIR)\x86\vc10\staticlib; (where opencv_dir goes upto the /build/ directory).

paul23 gravatar imagepaul23 ( 2013-01-24 09:25:28 -0600 )edit

This does not seem right. Are the libraries that you included found in here? I would think that the library location is just called lib; possibly $(OPENCV_DIR)/lib or $(OPENCV_DIR)/install/lib. Can you verify on your install?

unxnut gravatar imageunxnut ( 2013-01-24 13:57:33 -0600 )edit

@unxnut Hmm went through it all over again and now it "works". (well apart from that I now discovered the standard build options opencv uses the static runtime, and I'm using for my application dynamic runtime already - so now I've got to manually build the libraries anyways).

paul23 gravatar imagepaul23 ( 2013-01-26 17:14:52 -0600 )edit

I also noticed that you have linked almost all the libraries that are provided by OpenCV. You probably need to check what is it that you actually need and link only those libraries.

unxnut gravatar imageunxnut ( 2013-01-26 22:24:45 -0600 )edit

Question Tools

Stats

Asked: 2013-01-24 08:10:49 -0600

Seen: 1,512 times

Last updated: Jan 24 '13