I presume you used the tutorial on the OpenCV website to setup OpenCV. Once you run the command prompt and execute the command, it creates the environment variable for OpenCVbut it does not add it in the path. So if you go to the path and add the location of the bin in vc12 (vc14 for me), save it, and restart visual studio, it works.
After installing OpenCV version 3.4.1 for use with VS 2017 following these instructions, Visual Studio complained about missing opencv_world341d.dll. Even though I had added C:\opencv\build\x64\vc15\bin to the windows PATH, Visual Studio still couldn't find it as VS was already open when I modified the PATH. Restarting Visual Studio fixed the problem.
In visual studio 2019,TRY THISAdd missing file opencv_world430.dll or opencv_worldd.dll in the debug directory of the project where your project application exe file is there.copy & paste missing files in the debug folder
I just had the exact same problem using version 320.In my case my "Comodo Internet Security" was blocking a few things of the application itself and of OpenCV. Make sure to put them all on the "trusted" list by right clicking on them in your firewall.
Add the paths as everybody says and keep in mind to restart the Visual Studio. I added all the paths, even tried to copy all the opencv_world.dll in the same folder as the source file, all i had to do was to restart the Visual Studio after i added all the paths.
Basically when i do the building process, the opencv_worldXXX.dll isnt generated and I get an error when thying to built a program with Visual Studio. The steps that i have done are the following (same of the following video: =-GY2gT2umpk&t=296s)
When it ends, it creates path\build\install\x64\vc16\bin directory that only contains this file opencv_videoio_ffmpeg490_64.dll . Why isnt the opencv_world.dll generating, if i have checked the BUILD_opencv_world box? In the cmake GUI terminal also tells some things are missing, but I dont know if they are the source of my error:
-Could not find OpenBLAS include. Turning OpenBLAS_FOUND off
-Could not find OpenBLAS lib. Turning OpenBLAS_FOUND off
-Could NOT find BLAS (missing: BLAS_LIBRARIES)
-Could NOT find LAPACK (missing: LAPACK_LIBRARIES)
Reason given by package: LAPACK could not be found because dependency BLAS could not be found.
OpenCV modules:
To be built: aruco bgsegm bioinspired calib3d ccalib core cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev datasets dnn dnn_objdetect dnn_superres dpm face features2d flann fuzzy gapi hfs highgui img_hash imgcodecs imgproc intensity_transform line_descriptor mcc ml objdetect optflow phase_unwrapping photo plot quality rapid reg rgbd saliency shape signal stereo stitching structured_light superres surface_matching text tracking ts video videoio videostab wechat_qrcode world xfeatures2d ximgproc xobjdetect xphoto
Disabled: -
Disabled by dependency: -
Unavailable: alphamat cannops cvv freetype hdf java julia matlab ovis python2 python3 sfm viz
Applications: tests perf_tests apps
Documentation: NO
Non-free algorithms: NO
I built with VS and the same error messages appears that I show at the start of the post. Building with Visual studio creates de /install folder and I get the bin and lib folder, so I add them to the Path in env. variables. Now, if i try to build and run this code:
4a15465005