Opencv dll issues - opencv

I was following a tutorial for object detection using opencv, I did it step by step but when I run it, I got this error -
The program can't start because opencv_244d.dll is missing from your computer.
Try reinstalling the program to fix this problem.
I don't know what is the problem because I can see this dll in opencv libraries, I have added the following to the input dependencies:
opencv_core244d.lib
opencv_imgproc244d.lib
opencv_highgui244d.lib
opencv_ml244d.lib
opencv_video244d.lib
opencv_features2d244d.lib
opencv_calib3d244d.lib
opencv_objdetect244d.lib
opencv_contrib244d.lib
opencv_legacy244d.lib
opencv_flann244d.lib
This is still not working, what can I do?

You can find the required dll files into the bin folder (that is next to lib folder where the .lib files are located), and you have two options:
1) copy the required dlls into the same folder with your application //this is a little better because it kind of prepares you for when you'll need to deploy your application on systems that don't have opencv installed (for then don't forget to build the release version of your application)
or
2) add to the Path in the Environment Variables your path to that bin folder (be carefull that the path in there are separated by ; )

I would advise you to build the OpenCV libraries from source so that you can have a custom installation specific for your system (this is always better since it gives you the option of using what you want/need and also the performance is better since the libs are custom-made for your system).

OpenCV does not contain a library file called "opencv_244d.dll".
Check all your dependencies and their names so you don't have any misspelled names. All the names are something like "opencv_name244d.dll" such as "opencv_photo244d.dll".

Related

Missing opencv_core248d.dll

I'm trying to install OpenCV 2.4.8. Turns out this is far more complicated as expected. The tutorials are all outdated. Here is my current problem:
I'm running on a 64 bit machine, and am trying just a simple sample code:
#include <opencv\cv.h>
#include <opencv\highgui.h>
using namespace cv;
int main() {
Mat image;
VideoCapture cap;
cap.open(0);
namedWindow("window",1);
while(true) {
cap >> image;
imshow("window", image);
waitKey(33);
}
return 0;
}
When I run this, I get an error stating that opencv_core248d.dll is missing. Checking the bin directory, it's there. How do I fix this?
Regards
Edit: I've been on this issue for the past 3 hours. Whoever can help me solve this issue will get so much rep and love from me...seriously I'm getting desperate
Edit2: Picture of some settings:
OPENCV_BUILD = C:\OpenCV\build\
You are running into OpenCV dll issues, similar to here. Three ways to fix dll-related issues about OpenCV, also works for other dll related issues.
copy the required dlls into the same folder with your application. This is a little better because it kind of prepares you for when you'll need to deploy your application on systems that don't have OpenCV installed (for then don't forget to build the release version of your application).
add the dll path to Debugging Environment: Project –> Properties –> Configuration Properties –> Debugging –> Environment –> add dlls' paths here. The syntax is NAME=VALUE and macros can be used (for example, $(OutDir)).
For example, to prepend C:\Windows\Temp to the PATH: PATH=C:\WINDOWS\Temp;%PATH%
Similarly, to append $(SolutionDir)\DLLS to the PATH: PATH=%PATH%;$(SolutionDir)\DLLS
add the dll path to Environment Variables (be careful that the path in there are separated by ;)
EDIT: Among the three methods, the first two will only work for this project (local) and the last one works for all projects in your PC (global).
Have you tried adding C:\OpenCV2.0\bin to your PATH variables? Yup, installing OpenCV can be a chore :/
Have you done the proper project setup, like adding source library, source directories etc? Anyway, if my guess if right, the following will resolve that particular error:
Go to your project properties, Linker -> Input -> Additional Dependencies, add opencv_core248d.dll in and compile. If a new error appears, means you have yet to do the proper configurations.
EDIT: to comments
Here, the include directories and library directories. Did you add the relevant build/include & \lib into to the include and library directory respectively? This are some of the "configuration" that need to be done.
EDIT2: TO answer your edit
Yup, looks like you did do the configurations. Was confused by your comments.
1) I am not really sure if $(OPENCV_BUILD) will work. Maybe you would like to try C:\OpenCV2.4\lib, (link directly) etc instead of that.
2)Go to your linker input and edit the additional dependencies to this (image from one of the books I have):
Hope it works. And don't worry. I know how you feel. I was stuck at installing OpenCV for almost a week, and only one guy's youtube video saved me. I needed to edit some header files. But it's a different problem from yours. Good luck and hope my method work.
EDIT3: Hopefully this solve your problem, try these.
1) If you are using the "band-aid" method, which means having to copy paste the dll files every time, my suspicion would be that your PATH variables is wrong. Just double check it.
the equivalent for yours would be something like(the path of where you copied the dll files from/the path of the library directories you added inside the property page. But instead of lib at the end, you use the bin folder):
C:\OpenCV2.3\build\x86\vc10\bin
More details on this : Setting window path
If you have done this, just check that you have separated them with a semi-colon.
2) Not sure if this is really the solution for missing .dll file, if I remember correctly, it's more for linking errors. But give it a shot if step 1 doesn't work, or if step one works and you face another error. At the most, you can just undo it.
For each header files, for instance the core.hpp file, add the following lines:
#pragma comment(lib,"opencv_core248.lib")
#pragma comment(lib,"opencv_core248d.lib")
This need to be done for all the header files you use. Where to place it? I place mine here:
This goes the same for highgui.hpp, etc, but you change the name, so #pragma comment(lib,"opencv_core248.lib") becomes #pragma comment(lib,"opencv_highgui248.lib", etc...
Hope all goes well. I think if the path variable, but if not and 2nd method doesn't work, I have no clues anymore.

Does OpenCV need to be compiled before using?

I'm trying to install OpenCV on Windows. Following are how I installed it:
Download OpenCV 2.4.2.exe from sourceforge.
unarchived it.
open Eclipse CDT.
Add C:/opencv/include/opencv to "Includes"
Add opencv_highgui, opencv_core, opencv_ml... to "Libraries"
Create a small project and compiled it.
The compiler complained about "opencv2/core/core_c.h:No such file or directory"...
I remember that when I install OpenCV on Ubuntu, I did compiled the project (it took quite a bit of time). Do I have to do the same thing on Windows? Or is any other thing causing this error?
Thanks.
You should add correct directories to includes.
Since you added C:/opencv/include/opencv, there is no way for compiler to find C:/opencv/include/opencv2/core/core.h.
I believe you should enter C:/opencv/include/ to includes directories as well.

I don't know how to add path to .dll for Cuda

I am completely new to CUDA and C. My eventual goal is to adapt a FORTRAN program for CUDA. For now, I am having trouble getting a simple "Hello world" program to run.
I have been able to compile using nvcc hello_test.cu --machine32 which creates an executable. However when I try to run the .exe, I get a System Error message stating:
The program can't start because cudart32_32_9.dll is missing from your computer. Try reinstalling the program to fix this problem
I imagine I haven't added the path to this file (which I can find in "C:\ProgramData\NVIDIA Corporation\NVIDIA GPU Computing SDK 4.2\C\common\bin\"); but I don't know how to add the path. Any help would be appreciated.
You can go several routes. Either just make a copy of the DLL and put it in the same directory as your executable.
Or you can add the path you mentioned in the PATH environment variable of Windows. Then it should be able to find the DLL.

OpenCvSharp throws DllNotFoundException

I have similiar problem as was presented here, but with opencv_imgproc231.dll (opencv_core231.dll is loaded correctly in my case).
I installed OpenCV 2.3.1 and set environment variable PATH to foldres in "vc9\bin" folder. I added all OpenCvSharp dlls to references. When I run my c# program, it loads opencv_core231.dll correctly, but opencv_imgproc231.dll cant find (is in tha same directory as all opencv dlls). I tried copy opencv dlls to folder where is executable file, but it showed same error.
I did all what he did - C++ red. pack. 2008, 2010SP1, set PATHs, copy openCV dlls to folder, where is executable file - but nothing works, still DllNotFoundException for opencv_imgproc231.dll.
I have VS2008 and Windows 7 32bit.
My program contains only one row: "IplImage image = new IplImage(128, 128, BitDepth.U8, 1);".
Thanks for any advice.
Pavel.
I found this issue at google code http://code.google.com/p/opencvsharp/issues/detail?id=97
add tbb.dll (from opencv/build/common/tbb) to PATH or same folder of the executable works for me :)
Ok, I solved it. There is problem in precompiled openCV DLL. So if you have similar problem, recompile openCV and it will work. I dont why, but precompiled opencv_imgproc230.dll has 1579008 bytes and my recompiled opencv_imgproc230.dll has 1568768 bytes, but it works.

QMake and a .pro file

I've downloaded a package and am trying to build/install it. The project's wiki page has a command that looks like
qmake VAR=/path/to/something/ project.pro
It says that this command should tell qmake to generate a make file. Instead, I'm getting
qmake: Nothing to be done for `project.pro'.
Why is qmake not generating the make file like it's supposed to?
Without knowing the project in questions or the contents of the project (.pro) file, it is difficult to diagnose. One possibility is that qmake was already run, or that the files it is to generate are included with your download. In these circumstances, there really is nothing to be done for said project.
As a side note, may I recommend downloading "Qt Creator" and opening the project file in there? Qt Creator tends to make Qt development and project building a lot easier.
I just answered my own question... apparently there is more than one qmake. On my system, we're using a qmake: distributed parallel make, scheduling by Grid Engine. I found /etc/alternatives/qmake which is the QT qmake...

Resources