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.
Related
I am editing a visual studio MVC Solution. I have edited all the files, assemblies and Project Name etc. But in the end, it is build successfully but when I am going to run this solution it shows an error like shows in the picture.
Actually, TestSolution was the name of my solution which I've changed with RealEstateErp.Now when I am going to search "Using TestSolution " , I don't find anything. Now, what should I do to overcome this problem? Any kind of help will be appreciated.
when they make drastic changes like the namespaces and dll names, the first thing people forget is to delete the old dlls.
I would start with that, make sure you delete everything in bin, obj and all temp files which reside in Windows\Microsoft.Net and then Framework and Framework 64.
Next, check your global.asax file, specifically the front end part. You get to it by right-clicking the global.asax file and selecting the "View markup" option, that one always has a reference to the old namespace and always gets missed.
Finally, make sure you delete all the using statements referring to the old namespace. You don't need those and they will cause a compilation error like the one you are seeing, because that particular namespace does not exist anymore.
Actually, It was on the Web. Config under View Folder.
I've Updated it with the latest solution name and now it works fine for me.
Could you do Ctrl+Shift+F and search your whole solution about Using TestSolution?
You probably will find the word left somewhere.
I made a program today, and I was wondering on how exactly to make it an executable. I've researched and I've came up with using srlua. I've asked this previously, but I usually mess up on the same instruction. I was told to 'compile srlua' While I know exactly what to do right after I compile srlua, I don't know how to compile them right now.
I've gone through a few YouTube tutorials, and I managed to find one but only in Spanish. I was able to slightly follow along until he downloaded a precompiled version of srlua, where the download link is no longer there at the same page he was at.
Would anyone be able to explain what they're trying to say?
You need to tell CMake where the Lua files it needs are.
For me, the Lua includes are in /usr/include/luaX.X, where X.X is your version number, e.g. 5.3. The Lua libraries may be in /usr/lib (with filenames like libluaX.X.so).
If the locations differ for you, you can try find / | grep "lua.h" and find / | grep "liblua".
Once you've located the folder which lua.h is in, and the appropriate library file like liblua5.3.so, you need to add these to the CMakeLists.txt file in the srlua folder.
For example, using lua5.3, you might replace this line:
include_directories(${LUA_INCLUDE_DIR})
with this one:
include_directories(/usr/include/lua5.3)
And for the libraries, you might replace this:
target_link_libraries(glue ${LUA_LIBRARIES})
target_link_libraries(srlua ${LUA_LIBRARIES})
with this:
target_link_libraries(glue /usr/lib/liblua5.3.so)
target_link_libraries(srlua /usr/lib/liblua5.3.so)
After this, run cmake ./ in the srlua folder, then run make. srlua should be built.
Note: you may also have to remove the line find_package ( Lua REQUIRED ), it was a false error for me (it only built when I removed that line).
First of all, I've never worked on iOS, so this may or may not be a stupid question, I don't know :)
I have an iOS App, and I need to run it.
In the 'Project Navigator' I have a folder/package called 'Reuse and Platform Libraries'. Inside, I have another four folders but 3 of them seem like missing.
I am not sure if this is the case. I've tried googling their name but without results so I assume they are not some open source libraries.
Can someone clear this up for me? Do I need to install some XCode packages?
Thanks!
I suggest you search the folder of the project for those files, sometimes when copying a project the paths get screwed up because they were set as absolute paths and not relative paths.
If you can't find the files, it's most likely that the library is a private one used by the previous developers, and usually kept out of the project folder so they probably forgot to send it along. I'd suggest simply asking them to send the files over :).
There is also a slight chance they are not needed to run the file, in which case, just deleting them from the sidebar should make the project run.
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".
I've set up VES and am modifying the Kiwiviewer app in XCode 4.3.2. Kiwi builds and runs fine, so I'm now trying to set up Sudzc within my app (it works fine standalone). I've followed the tutorial here but at the point after modifying the headers, where his app builds and runs, mine instead comes up with a succession of errors. At first, it gives >150 errors all along the lines of:
Lexical or Preprocessor Issue
Invalid token at start of a preprocessor expression
Mostly pointing at the line
#include "xmlversion.h"
in a file tree.h, which is a part of vtkmodular/Utilities/vtklibxml2/include/libxml/tree.h.
Changing the " " to < > (which was suggested for a similar problem) instead gives another Lexical or Preprocessor Issue, this time that 'xmlversion.h' file not found - seemingly all in the file tree.h. The file's in my Project Navigator (and cmd-clicking on #include "xmlversion.h" does indeed load the file, so it understands it that way).
Presumably then the problem is with vtk having its own version of libxml2? If this is the case - what can I do about this? All of the errors I've looked at seem to originate from within soap handler classes, and eventually get through to "include < libxml/tree.h>" - which is then in the vtk directory shown above. I'm not really sure where to go from here - is it wrong to include the library that's added in the instructions? Can/should I modify the header paths? If this isn't the tree.h the rest of the code is looking for, where is it - a quick system search didn't find it?
Or am I completely off the mark?
Thanks in advance!
I got an answer from the VES Mailing List, link here. It ended up being as simple as removing the VTK version of libxml2, which it seems VES doesn't use. Hope this might be of use to someone!