How to install OpenCV 2.0 on win32 - winapi

I need to install OpenCV on Win32. I do not have it installed currently. I downloaded OpenCV-2.0.0a-win32.exe and ran it. What the heck do I do now? There are no .lib's and whatnot.
I found some instructions for building the release using cmake at http://opencv.willowgarage.com/wiki/InstallGuide . I downloaded the latest and greatest cmake, and tried to follow the instructions, but I was guessing. No joy.
I specified VC++9 when I did the "configure," but cmake built a VC++ 6 dsw file. No vcproj. I converted the dsw into a vc++9 vcproj anyway, just to see if it would work. Nope. It compiled lots of files, but many failed because it could not find omp.h. Sure enough, it's not there, anywhere. The build log said, 'A tool returned an error code from "Performing Custom Build Step".'
I am lost.
Ideally, I would like to find a full installation with all the files pre-built for Win32 vc++ 2008. Failing that, I need instructions that even I can follow. Short sentences and small words, but lots of them.
Please help!
UPDATE: I tried to build just CXCORE. It complained, "cannot open file 'VCOMPD.lib'" There's that OMP again.

For version 2.0, you must build the project from source.
Here's what you will need:
The OpenCV installer.
CMake. Here's the CMake installer.
Instructions for using CMake to install OpenCV-2.0.01-win32. Those instructions need an extra step if you are using a vc++ Express edition. In that case you must un-check ENABLE_OPENMP when running the CMake GUI.
Instructions for setting up an application project. (Thanks to mloskot for this find.)

If you've installed OpenCV-2.0.0a-win32.exe then it will install pre-built DLLs and libs. Then you just have to follow the instructions in this tutorial.
I recommend that you wipe the folder you previously installed OpenCV2.0 in and reinstall it.
Update:
Well sorry it didn't work out. I suggest the following then: check out the latest version from the SVN repository, https://code.ros.org/svn/opencv/trunk/opencv with any SVN client - I use TortoiseSVN.
Then run CMake (I see you've already installed it) on the source folder and then compile the Solution file. This should work - it does for me.
I apologize for my old answer - I had started off with OpenCV a few months ago in the same way and assumed that downloading the Gold version would still work - apparently not.
OMP
The OMP issue may arise from the checked Enable OpenMP in the CMake config. Try unchecking that .. might solve your initial problem.

I followed Jive Dadson's procedure to get OpenCV2.0 to work on Visual Studio 2010 Express (disabled OMP).
All went good until compilation of the generated stuff in Debug and Release. In both cases got this error: "LINK : fatal error LNK1181: cannot open input file '../../lib/Release/cv200.lib'"
in debug the only difference is that the library is cv200d.lib.
EDIT: I solved by downloading the latest svn snapshot for OpenCV2.0. One additional thing on Vista/7: it may be good to execute CMake as administrator.

Download OpenCV installer for Windows
Read OpenCV-2.0.0a-win32.Readme.Please.txt
Follow OpenCV with Visual C++ 6.0, 2005 Express, and 2008 Express in order to create project using OpenCV

Related

How to build opencv correctly in windows to get "opencv_createsamples.exe"

I want to learn and use haarcascade classifier using OpenCV for detection of object of my choice. I searched the internet and found that createsamples utility helps in creating dataset for positive and negative images. I know how to install OpenCV in python (pip install opencv-python works perfectly) but since I need to use that utility I need to build the OpenCV for my windows system.
My attempts to install OpenCV in windows
Attempt 1 : using MinGW and cmake
cloned latest OpenCV using git at "C:\OpenCV" from https://github.com/opencv/opencv
Installed cmake
created build using cmake at "C:\OpenCV\build" using MinGW(64 bit) build system with default options
ran mingw32-make
ran mingw32-make install
It created an install directory in "C:\OpenCV\build\install"
but to my surprise opencv_createsamples.exe was not present there
opencv_visualisation.exe, opencv_annotation.exe, opencv_version.exe etc. are present
screenshot of install files generated
screenshot of build options selected in cmake by default
It is clear BUILD_opencv_apps is true by default and other apps were created except this one
still in source folder : createsamples.cpp is present in "C:\OpenCV\apps\" along with opencv_visualisation.cpp and others
Attempt 2: visual studio 14_15 build from official site
Downloaded OpenCV latest 4.0.1 from https://github.com/opencv/opencv/releases/download/4.0.1/opencv-4.0.1-vc14_vc15.exe from https://github.com/opencv/opencv/releases webpage
extracted the opencv build at "C:\OpenCV401\"
still to my surprise at "C:\OpenCV401\build\x64\vc14\bin" no opencv_createsamples.exe
likewise other files are present
screenshot of files present in build
Attempt 3
This time I downloaded visual studio 10 build from this github page : https://github.com/abreheret/opencv3.2.0_build
here at <OpenCV_DIR>/x64/vc10/bin/ all the amazing files are present
screenshot of files present in this build
So, my question is :
Why that utility was not built from the source using MinGW and cmake in my first attempt
Why they have not included in the official build
How to build using MinGW and cmake to get that utility correctly (maybe some build configuration needed?)
Createsamples was disabled in latest OpenCV (4.0 and greater): here.

Building OpenJDK8 on Windows x64

so I am trying to compile openjdk8 from sources, but I am stuck at missing files problem in the end of compilation process...
Here is the software that I use:
Windows 7 SP1 x64
Windows SDK for Windows 7.1
Microsoft .NET Framework 4
Visual Studio 2010 Express Edition
GNU make 3.82 (compiled by myself)
Freetype 2.3 (compiled by myself)
Oracle JDK 1.7 update 71
Direct X 9.0 (August 2009)
Cygwin
Here are the manuals which I was reading from:
Official README
Royvanrijn's build guide
Some other build guide
Build guide using MSYS
With all these guides I am able to let it compile, however during the Building Images - step , I get an error that some files are missing ( and they are indeed missing ) , which makes me think that something has gone wrong during the build...
There are several points where I afraid I might be doing something wrong...
Cygwin
Right now I use cygwin version 2.8. The openjdk configure script requires cygwin version >1.7 but fails to recognize that 2.8 is greater than 1.7 and throws me an error, so i've tweaked the script (made build work like 2 months ago)...
./configure
My configure command looks as follows:
./configure --disable-ccache --with-freetype=/cygdrive/c/freetype
Maybe I need more arguments here to make it work ( note that i've copied self compiled make executable to cygwin bin folder, so that i dont need to provide its location )
Visual Studio C++ 2010 Express
I would rather try Professional Trial version, but it cannot be found anywhere anymore... (except torrents...) I have a strong feeling that Express version is not suitable for openjdk build. I also get that error with missing ammintrin.h file, but it is easily resolved by creating the empty header file in the include folder of Visual Studio installation.
My basic procedure of building is:
Install all the software above
hg clone http://hg.openjdk.java.net/jdk8/jdk8
./get_source.sh
./configure --disable-ccache --with-freetype=/cygdrive/c/freetype`
make clean images
However, here how it ends :
Does anyone have any clue of how to solve this?
I found the proper fix: using the Cygwin installer, downgrade Grep to 2.27, which properly ignores CRLF line endings.
Run the Cygwin setup (e.g. setup-x86_64.exe)
Advance through the setup wizard until you get to the package selection
Choose "Full" from the View drop-down menu
Type "grep" into the search field
Click the icon in the New column until it shows a 2.x version (2.27 as of this writing)
Click Next and then Finish.
I found myself in the same position as you, except in my case I need OpenJDK build to be repeatable, so "run make repeatedly until it finishes" wasn't an acceptable solution.
Through some experimenting, I found the root cause:
grep was failing because the file being processed had Windows line endings (CRLF)
The Windows line endings were due to the fact that the file is generated by a Java app (fixpaths) which emits platform-native line endings
Identifying fixpaths led me to an old OpenJDK e-mail thread, which reported that some users were having the same problem and fixed it by downgrading.
This gave me the idea to try downgrading grep. I did so, and it worked.
So, after couple of days at this task my only approach was to ignore the errors with the missing files and continue extracting files... This resulted in still working jdk image, which i currently use. My guess is that the errors come frome Oracle boot jdk. Since i am compiling an openjdk, it cannot find oracleJDK files in its headers and thus produces errors.
So, if anyone also gets same errors a me, try to ignore the missing files error and continue the images build.

freeswitch noob cant build solution

im just starting out with FreeSwitch, i downloaded via git, and am trying to build in VS
all i need i believe are the dlls of mod_managed, as my goal is to manage FS via .net
but i get 248 errors, most look something like this:
Error 5 error C1083: Cannot open source file: '....\jpeg-8d\jaricom.c': No such file or directory D:\FreeSwitch\freeswitch\libs\win32\libjpeg\c1 libjpeg
btw, i searched windows and cannot find any such file anywhere on my pc.
I tried
cleaning the solution first, but it did not help
moving the file to a path without spaces
downloading with autocrlf=false
building on another machine
but none of these steps helped
anybody have any idea?
if i can just download the dlls i need, i wouldnt mind skipping this step altogether
environment
win 8 64bit
visual studio 2012
thanks a million
The libjpeg sources are not in the git sources but are normally downloaded during the build process. If you build the entire solution that should not be a problem since it has the project dependencies set: libjpeg.2012 depends on Download libjpg.2012, which means the latter gets built before the first. All Download libjpg.2012 is run a cscript which downloads libjpeg from http://www.ijg.org/files/jpegsrc.v8d.tar.gz (see inside the project file).
So if you do not have the sources, either you are building incorrectly (not in VS for instance, or with a broken solution file) or the download script is broken. In that case, you should inspect the output: I assume it shows errors when it can not download the libs.

How to install Boost on Windows 7 with VS

So I am trying for whole day to integrate Boost with Visual Studio (2008) on Windows 7.
I firstly I went twice trough this How to use Boost in Visual Studio 2010.
I searched over all (there are at least 3 of them) simiral topics and none of them worked.
Some people proposed using this one : www.boostpro.com/download/ but link is not active.
Someone proposed to change runtime library to Multi-threaded DLL but is also didnt work.
I just try to include #include <boost/thread.hpp> and got this error
fatal error LNK1104: cannot open file 'libboost_thread-vc90-mt-s-1_53.lib'.
Before installing Boost the error was that it cannot find the thread.hpp so it seems like the Boost is installed somewhat correctly.
The problem is that the libraries were not build while I was using the tutorial. How can I build them manually?
There's no such thing like one-click boost install, you still need to do something manually. In your case it seems you need to compile Boost.Thread library and then add directory where resulting .lib file is to your library path. The link you provided looks pretty good. If you followed it probably you already built Boost.Thread. Make sure you did #6 from the second part.
There are prebuild binaries - installation packages:
http://sourceforge.net/projects/boost/files/boost-binaries/1.53.0/
Use this command:
bjam --build-dir=build-directory toolset=toolset-name --build-type=complete stage
this build the libraries manually. Then add the new directory to additional libraries path
as it is indicated in this link:
http://www.boost.org/doc/libs/1_43_0/more/getting_started/windows.html#or-build-binaries-from-source
I found this article quite helpful:
http://www.codeproject.com/Articles/11597/Building-Boost-libraries-for-Visual-Studio
The article explains how to build the build tool BJam (mainly by locating the boostrapper.bat)
How to build the libraries, e.g. bjam toolset=msvc-11.0 variant=debug threading=multi link=static (in this case the VS2012 multi-threaded, statically linked debug version).
It also features build batches, but I haven't tried them.
It has some additional information on how to specifiy the used C-Runtime

qt configuration on windows

I'm having some trouble installing and configuring qt on my vista laptop.
I'm trying to setup a development environment on my laptop where I compile from the command line, because that's how the environment is setup on my university's linux machines, so I don't want to tie myself to some IDE .. (plus, real programmers use the command line!)
I haven't used the command line before for C++ development, it was all MSVC, so now I'm having a bit of trouble.
I'm still using MSVC, but from the command line. I practically have no idea what's going on, I just know that I have to run:
qmake
nmake
to compile my code!
I downloaded the opensource version of qt, and did the configuration, and tried a simple qt application (from a tutorial) and it worked, it compiled and executed pretty much as expected.
Now, when I decided to run another project that uses opengl, I got the following error:
fatal error C1083: Cannot open include file: 'qgl.h': No such file
or directory
I'm not sure where does the compiler look for header files, and I didn't copy any header files anywhere, I assume that configure.exe worked its magic somehow and added the include directory to one or more enviroment variables or to some registery location or whatever other peculier places that the MSVC compiler searches for to find include directories.
However, what I did was search my C:\qt\include\ folder to make sure that qgl.h exists, and sure enough there it was. so why can't nmake find it?
I think the actual solution to this is in your pro file:
QT += opengl
If you want to stay with the command line anyway (plus use it on a linux box later / parallel) I'd suggest at least trying out the MinGW version of Qt. I'm using it regularly, and besides of the non-existance of a GUI it works pretty well. Using MinGW also has the advantage that you can simply download and install the MinGW edition of Qt and don't need to reconfigure or recompile anything.
Also, trying out QtCreator might be interesting. It's still beta and requires the beta Qt 4.5 but it's a nice small IDE that integrates nicely with gcc.
Two potential solutions (they solved issues at my workplace)
Do you have qt include and bin folders in the PATH variable? I think the doc says only one of these is needed, but one of the students had Vista and putting the other in the PATH variable solved a "Cannot open include file" problem.
If you're using MSVC did you run configure and nmake from the Visual Studio command prompt? We had problems when using the bare windows Command Prompt because the VS one adds a lot of temporary environment variables to the configure process.
Good luck
Install the complete Qt SDK for Windows which includes Qt 4.6 SDK, Qt Creator 1.3, and MinGW.
It will also install "Qt Command Prompt" launcher that you can use to build Qt apps from the command line.
I'm sure you're more familiar with MSVC than MinGW, as I do too (I've been using MSVC 6.0 to MSVC# 2008 for developing .NET apps).
But try MinGW with Qt and I think it's better for long term. I do some C++ development on Linux too so getting familiar with MinGW will be beneficial for you in cross-platform C++/Qt development.
For more info, see Installation of Qt 4.6 SDK for Windows.
Qmake generates Makefile from *.pro file located in current directory. It has qt path compiled in. Type "qmake -v" to see it. You can't move qt's dir after compiling it. If You haven't moved it, first maybe try to install Qt following instruction from INSTALL file. Good luck.
The opensource version of Qt does not provide profiles (mkspecs in qt terms) so qmake can generate nmake (msvc) compatible makefiles.
You have to use mingw/gcc.

Resources