# Link fails in 64bit Windows 10 and VS 2013

I'd like to use OpenCV for its Canny edge detector and Hough transform. I downloaded openCV-3.1.0.exe, followed the tutorials (for pre-built libraries) and attempted to compile and link code included in the tutorial. The system is Windows 10, X64 processor, VS 2013, and in vs the platform has been set to X64. I've made the properties settings as described in the tutorial for Windows.

If I try to run in debug mode, the demo has problems finding MSVCP140D.dll, CONCRT140D.dll, ucrtbased.dll, and VCRUNTIME140D.dll. Advice here somewhere suggested trying release mode. That generates 8 unresolved external symbols: cv::namedWindow, waitKey, fastFree, imread, Mat::deallocate, Strin::deallocate, String::allocate, and imshow (all of which means darn little to me, but I think it's enough detail to understand the error, if not I can provide the full text)

I have no idea what to try next. It is more important for me to run in debug mode than in release mode.

edit retag close merge delete

1

Hey man! The MSVCP140.dll and other 140's are the libraries from the visual studio 2015, so check if your additional linker paths point to [opencv install directory]/build/x64/vc12/lib

( 2016-12-07 01:30:39 -0500 )edit

Sort by » oldest newest most voted

you are trying with the wrong (vc14) set of libs, you need the vc12 ones for VS 2013

more

OK, thank you i had vc12 in some places, and vc14 in others - or in one, anyway. After correcting that, and making other changes, the demo "works" in debug mode, but not in release mode.

This is the current situation:

• Folder Structure (*)

• opencv is in C:\Program Files
• bin, lib and include are all in vc12 (C:\Program Files\opencv\build\x64\vc12) ("include" was in the build folder, which meant $(OPENCV_DIR)\include specified in prop pg would not exist) • opencv_world310.lib and opencv_world310d.lib are both in the lib directory. • opencv_world310.dll and opencv_world310d.dll are both in the bin directory. Environment Variables: • Global ev OPENCV_DIR = C:\Program Files\opencv\build\x64\vc12 • Local ev Path is ...;%OPENCV_DIR%\bin (This ( 2016-12-07 18:57:50 -0500 )edit • Local ev Path is ...;%OPENCV_DIR%\bin (This is the local user path, not the local admin path, which is easier to get to.) Property Page: • Configuation > Debugging > Command Arguments C:\Users\me\opencv-logo.png • C/C++ > General > Additional Include Directories:$(OPENCV_DIR)\include

Now the code "works" in debug mode. That is, the code opens a window displaying the png. (VS seems unhappy, though, that it cannot find a PDB file. I guess I don't care.)

BUT In Release mode, vs still cannot resolve symbols in the cv namespace. Odd that they are not underlined in the source-code window, and odd they they are defined in (I think) the same header files that debug sees.

Ultimat

( 2016-12-07 19:02:05 -0500 )edit

I was encountering such an error when using the VS2013 editor.. please follow these steps with the order

if you are using vs2013 Environment Varaibles C:\opencv\build\x64\vc12\bin Library Directories C:\opencv\build\x64\vc12\lib

else you are using vs2015 Environment Varaibles C:\opencv\build\x64\vc14\bin Library Directories C:\opencv\build\x64\vc14\lib

else vc15 .. ..

Environment Varaibles Control Panel -> System and Security -> System -> Advanced system settings Enviroment Varaibles -> System Varaibles -> Path Not: Restart computer after adding..

Library Directories Project solution -> properties -> Configuration Properties -> Linker -> General -> Additional Library Directories

more

Official site

GitHub

Wiki

Documentation