OpenCV 2.4.2 library files using CMake and MinGW - Target IDE CodeBlocks - opencv

I have been having this issue with OpenCV 2.4.2 that it doesn't really get installed properly with Microsoft VS 2010 Express; It is always missing a dll file or two doesn't matter what I follow by Googling. Also, Visual Studio 2010 Express is only valid for a few days, so it is acceptable that VS will not behave well with OpenCV at that point. However, when I changed my IDE to CodeBlocks, it is even stranger because now I have missing dll files and also "Missing Entry Point" error because of a duplicate .dll file. I found this guide and followed what it told me to do:
http://conanhung.wordpress.com/2012/05/23/opencv-2-2c-codeblocks-and-mingw-got-it-working-on-windows/
But it still doesn't work!! What I am after is a complete and definitive solution to integrating OpenCV (preferrably 2.4.2 version) on a Windows 7 64-bit machine. I have been turning Stackoverflow inside out but no solution is working for me. The problems are
WHEN USING VISUAL STUDIO:
Missing dll file (e.g. libopencv_core242d.dll, etc.)
WHEN USING CODE BLOCKS:
First it complains that libstdc++-6.dll is missing. When I download it to my C:\MinGW\libexec\gcc\mingw32\4.7.0 folder, it stops complaining about this. But now it complains that there is any entry point problem and some other .dll file is missing!!!
If someone has managed to make it work by hook or crook, I will be more than happy to know what it is, IN DEPTH. I don't believe that such an important library can be so stupidly distributed so that developers have to struggle night and day to make this work.
FYI, I have tried even the OPenCV website and frankly their instructions are a bit useless. Also, all the necessary information e.g. adding PATH, adding includes and libraries, etc. Please someone point me to the right direction as it has been two days and I cannot get anywhere. It is literally stopping my job now :(

As an answer, but probably a very simple one, I did the following and got rid of the problem:
1) Uninstalled code::blocks completely from the PC and downloaded the IDE-only version (i.e. withouth MinGW compiler), then installed it.
2) Downloaded the latest stable version of MinGW, installed, and added C:\MinGW\bin to PATH
3) Followed rest of the instructions from [link] http://conanhung.wordpress.com/2012/05/23/opencv-2-2c-codeblocks-and-mingw-got-it-working-on-windows/
4) Just to be sure, copied the opencv .dll files from the build folder (i.e. the one that you have created "make" and "install" files using CMake) to the debug (i.e. the executables') folder.
This will fix the problems. In case, it doesn't it might be that you need to add some environment variables.

Related

VS2019+WDK10, missing Spectre-mitigated MSVC library for 16.11, why?

Some weird stuff here. I'm trying to build a KMDF sample driver with VS2019 16.11.5 and WDK 10.0.19041.685 (also called version 2004 Dec 2020 update).
First, I got compilation error saying that I need to download Spectre-mitigated MSVC library.
Well, I try it, but got a new problem. The VS2019(16.11.5) installer does not show MSVC Spectre-mitigated MSVC library version for exact 16.11. Looks like the latest one it provides is 16.10 (🙁).
Download the 16.10 one and resume trying, still compilation error.
I peek into my D:\VSIDE\VS2019\VC\Tools\MSVC folder, and see two versions of MSVC libs listed, 14.29.30133 and 14.29.30037 . The later is the one with spectre libs(so it's 600MB+ larger).
However, the KMDF build tool insists to find MSVC libs in the newer 14.29.30133 folder, so Spectre-mitigated libs still CANNOT be found.
I know I can manually copy the required files from 14.29.30037 to 14.29.30133 to make things go on. BUT is it the decent way to do so, or is it a Microsoft toolset bug?
I'd like to ask how other kernel driver developers solve this issue. Thank you.
Well, several days later, I find out two workarounds for this issue.
First, as Hans Passant stated, disable the Spectre lib in .vcxproj. This can be configured from UI.
Second, explicitly select a MSVC library version for current project. This can also be configured in project settings UI.
==== 2022.02.11 UPDATE ====
Finally got it,the Spectre-lib with version number 14.29.30133 is called "(Latest)", so it is listed above the oldest version, and this defeats the novice. Use this and problem solved.
Sure, it is stupid enough to mark it as merely "(Lastest)". He should have named it MSVC v142 - VS2019 C++ x64/x86 Spectre-mitigated libs (v14.29-16.11)(Latest)" .

OpenCV 3.1.0 - LNK1104 with opencv_world310d.lib (Visual Studio Express 2013)

iam actually trying to get opencv running on my Computer. I allready configured the environment variables on Windows and added the Path for the includes and the libraries in a propertiesheet.
Now when i want to add additional dependencies i watched into my directory (opencv\build\x64\vs12\lib)and there are only two files. opencv_world310.lib and opencv_world310d.lib. So they are on my HDD.
I think these are the files i have to add?
I did this and then i got the error LNK1104 could not open "opencv_world310d.lib. Same with opencv_world310.lib.
Iam trying to build a example-code from opencv so there should be everything fine with it. I saw some Tutorials they did not have any issue. But they used OpenCv3.0
Is there any workaround?
kind regards
Yes. By default, opencv_world310.lib is the only file you should link with.
Or if you're building with Debug configuration, you should use opencv_world310d.lib instead.
Since the error code is LNK1104, I believe your additional library path is something wrong.
And then please check you are building x64 code not win32 code.

XNA 4.0 ClickOnce game does not run after installation

Okay, I have been looking all over to solve this problem before I actually broke down and decided to finally ask for my psecific problem. I am using ClickOnce installation and when I use the setup.exe to install nothing runs, not even on my personal computer that I know has all of the proper libraries and such. I'm not sure what I am doing wrong so it is difficult to explain the problem.
I have included dotNetFramework4.0 client x86 x64 , xna redistributable 4.0 and windows installer 3.1 along with my game and I have it set to install all of that with setup , also I have it set to download prereqs from same location as application. I've tried it on three separate computers , one that does not have XNA or VS C# installed and the same problem occurs.
Here is the problem , after I install the game nothing runs, I try clicking on the ClickOnce application file (the one with my game's icon image) and again nothing happens. The thing that really bugs me is that there isn't any errors or crashes or anything , it's almost like clicking on the desktop screen. (I looked at the properties of the "shortcut" that was installed with the game and the file size of the shortcut is like 300 bytes. Isn't that really small? I was thinking maybe there is a problem with a startup executable? I'm not sure though.)
I've tried tweaking some stuff in the Publish section of my project , such as un-checking the box that says "use .deploy extension files" (I don't know why, I've been grasping at straws here) I've been looking into some other installers such as NSIS but I don't know how to compile a list of files to include in other installers and I feel like that won't solve the problem anyway because I've gotten ClickOnce to work with me before.
On one computer there was an error report that said something about 'deployment and application do not have matching security zones.'
Game.application resulted in exception. Following failure messages were detected:
+ Deployment and application do not have matching security zones.
It's getting late so if I need to provide more information let me know.
ClickOnce can be a fickle thing. There are times that I've had errors occur that could only be solved by recreating an entire Windows user profile. Because there are so many different options for ClickOnce, it's going to be hard for me to diagnose your exact issue, so I can only offer what options I used to successfully install via ClickOnce.
Publishing Folder: local folder
Installation Folder URL: blank
Install Mode: offline
Application Files
Make sure the Publish Status of your game files is set to Include (Auto)
Make sure the Publish Status of the XNA libraries is set to Prerequisite (Auto)
Click Prerequisites
Microsoft .NET Framework 4 Client Profile
Microsoft XNA Framework Redistributable 4.0
Windows Installer 3.1
Do not check for updates
Everything else default under Options (publisher/suite name shouldn't affect anything)
Specify the version number
Publish Now
Install the game through the setup.exe provided in the publish location. I always distribute every file that is publishes. However, you can clean up old versions in the "Application Files" folder if you don't want the history to be distributed.
You can double check the "Application Files" folder to see if your version got published correctly (look at the files that were deployed and see if they match your project contents).

What is windows system path?-About Devcpp Opencv

I've looked into it through older questions and by using google, but I can't find an asnwe to my problem.
I have been trying to get devcpp to work with opencv2.1. I configured it with cmake and generated files. Then I compiled it with Mingw32-make command through a windows 7 cmd. Whichever way I tried to link stuff from devcpp, it's never worked. It keeps giving me cv::freecast(void) error.
I have seen some people talking about setting things to the system path. What is that system path exactly ?
Thanks in advance.
You have to tell Windows where to look for the openCV libraries when asked. There are two options:
Not to tell windows where to look for the .dll and put them in the same folder as the project
Tell windows where are the .dll by adding them to the system path
Here in "Compile using Visual Studio" point 3 you can see how to do it.

OpenCV 2.1 Strange Errors

I'm not sure if this is the right place for asking these kind of question but I have no better place in mind.
After LOTS of coding in OpenCV, I'm trying to migrate to new C++ interface of openCV which has been introduced in OpenCV 2.0. but I keep getting strange errors.
For example:
trying to use pre-built dlls and libs, I got exceptions in "cv::warpAffine" and "findContours" cv::function at runtime. I compiled the openCV, used my own build of libs and dlls and everything got fixed!
the same problem happened in linux.
linking the "Debug" built dlls with "Release" built of program cause some unexpected runtime errors, and vice versa.
and some other errors.
can anyone helping me with what I'm doing wrong? (please keep in mind that I coded alot with older version of openCV).
When I migrated to C++ interface I couldnt make openCV work until I compiled the source by myself. Probably DLL's and Libs that are installed with opencv are good only to a specific machine.
Another thing. Try to do the following if you use Visual Studio
go to Project Properties->Click the C/C++ folder->Code Generation->Runtime Library and change it to /MDd in Debug configuration and /MD in release
It solves a problem with esceptions related to STL
Some of the functions ave moved out to new libs (especially some of the stereo functions are in calib3d) and the header file structure is completely changed in 2.2
There are some guides to the configuration eg for visual studio

Resources