Building OpenCV 3.0.0's DLLs for Visual Studio 2015 with Cmake - c++

Following the instructions here:
docs.opencv.org/doc/tutorials/introduction/windows_visual_studio_Opencv/windows_visual_studio_Opencv.html#windows-visual-studio-how-to
I setup an OpenCV project in VS 2015 Community and used the pre-built libraries. It works until I get this message:
"MSVCP120D.dll is missing from your computer"
From doing some searching I gathered this means that the pre-build libraries are only supposed to be used with an older version of VS so I figured I'd just compile them myself using this:
docs.opencv.org/doc/tutorials/introduction/windows_install/windows_install.html#windowssetpathandenviromentvariablehere
While it appears to compile properly and despite flagging "BUILD_SHARED_LIBS" I can't find any DLL files in the output - just a lot of VS solutions:
imgur.com/JdSc5CH
Would someone be able to give me some advice on how to generate the DLLs?
thanks!

I'm a beginner at this stuff. I've since learned a lot about Visual Studio, about CMake and about OpenCV. Got it all working now, took me a day or two.
It turns out you have to compile the openCV library from git repository in order to be compatible with Visual Studio (VS14) 2015. As of this date, no go on pre-compiled version supporting VS14.
I've organized what I've learned, placed it online here in case anybody else has the same frustrations. Its pretty detailed, too much content to post here.

VS2015 uses MSVCP140.dll, I think your error message is about a redistributable package of VS2013.
And try BUILD_SHARED_LIBS as on/off.

Related

How can I setup CMake for use with Visual Studio 2017RC and CUDA 8.0?

Visual Studio 2017 RC includes much tighter CMake integration, allowing one to skip the intermediate step of generating project/solution files and use CMake effectively as the project file itself. There is sufficient documentation from Microsoft for using these features with regular C++ files, and there is sufficient documentation on this website (example) for making CUDA and Cmake play nicely, when it comes to linking CUDA code to C++ code.
What I can't find information on is how to make CMake, Visual Studio 2017 RC, and CUDA 8.0 all play nicely. This is a difficult problem, because 2017RC has no integration for the CUDA SDK anyways, and I was hoping to use 2017RC so that my C++ interface to the CUDA code could use C++14 and/or C++17. I'm working on the beginning of a large project that will primarily involve writing a static CUDA library that is accessed through C++: so, I'd like to get the CMake to take care of compiling my CUDA sources into a static library, and for it to help with feeding the linking information to Visual Studio. So far, I haven't had any success with using FindCUDA's various features to accomplish this, but I'm assuming that's due to a misunderstanding on my part. I've read through the documentation on separable compilation from Nvidia, but that wasn't helpful for figuring out CMake.
Further, whenever I try to use CMake in VS2017RC, I still end up with the various vcxproj files that CMake likes to spit out. Is this due to an error on my part? How do I edit the build command arguments, or CMakeLists.txt, to get the functionality demonstrated here to work?
The very short (and only at the time of writing) answer is that you can't. CUDA 8 doesn't support VS2017. Only VS2015 is presently supported.
You can always find the compiler/IDE versions which the release version of CUDA supports here
Edit to add that the CUDA 9 release will add official support for VS2017.
All you need to do is set the CUDA_HOST_COMPILER variable to a supported compiler for example the visual studio 2015 compiler.
In my case this is:
C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/amd64/cl.exe
As both runtime libraries are binary compatible you can use the 2015 compiler within CUDA and compile all the rest of the application with the 2017 compiler.

Installing socket.io C++

I try to work with socket.io in C++ but I can't seem to get the example running.
First it asked me to convert the project to my visual studio (which is 2015). So I did that. Then it was missing libraries offcourse (boost, websocket++, rapidjson). So I added them to the additional libraries in the project settings. Then it was searching for boost.lib. Boost.lib doesnt exist in the boost library I installed on my pc, so I deleted it from the dependency list. I figured I already included boost, why would it search for a lib that doesn't exist. I ran bjam.exe and b2.exe etc from boost, so if there would be a boost.lib it should be there I guess and it isn't.
I then got this error: https://msdn.microsoft.com/en-us/library/f6xx1b1z.aspx
So I added msvcrt.lib and msvcmrt.lib to the linker's Additional Dependencies property. Which caused the errors in the included image..
Now all the steps seemed to fix the problems I had, but also create more errors in the process. I do not understand how to run a project like this and I can't find a good explanation of the steps I need to take.
Can anyone explain what I am doing wrong?
https://github.com/socketio/socket.io-client-cpp
That is what I try to run, the included SioChatExample
Thanks for any help in advance!
Current errors..... :(
i think many errors because of VC++ version.
creator of project Socket.io-c++, he used VC++ 11.0
if you use VC++ 14.0 to build it, you will get the error. for suggestion you should use VC++ 12.0
In cast you want to use prebuilt libraries:
i myself just try many solutions,
goodness i fix all
you can get them here Prebuilt-libraries-for-Socket.io-c++
for Visual Studio 2015, what u need are:
install more Visual Studio 2013 (i install Visual Studio 2013 community) to get VC++ 12.0 (prebuilt-lib is built in VC++ 12.0)
change your project Platform Toolset to Visaul Studio 2013 (v120)
link libraries to your project
libraries you need are:
libboost_date_time-vc120-mt-gd-1_50.lib
libboost_random-vc120-mt-gd-1_50.lib
libboost_system-vc120-mt-gd-1_50.lib
sioclient.lib
include folder of *.h (header of Socket.io-C++) to your project
build and run

Gtkmm and cairomm with visual studio 11 (for the first time)?

I am learning c++ and wish to draw geometry to better enjoy the process and test my scripts.
I searched for a library to draw vectors in c++ and found Cairo came highly recommended on this site. I went ahead and downloaded Gtkmm that comes with Cairomm and installed it. I so far used this aweomse tutorial:
https://live.gnome.org/gtkmm/MSWindows/UsingMSVC
I followed the steps but I think this tutorial might be outdated or there may be an issue with one of the steps on MSVC 2012 with gtkmm-vc100-d-2_4.props (that is perhaps only supported on MSVC 2010).
In general I really want to get started but I am new to this and very confused atm.
It seems the current latest Project property file is not supported with Visual Studio 11 (2012).
I should have known that with the file name being, 'gtkmm-vc100-2_4'.
It works perfectly with VC10 so I reverted to using that for the time being.
I compiled gtkmm3 on Widnows 7 x64 (including cairo and others) for Visual Studio, see this
I have a CMake based project to build gtkmm on top of MSYS2 (it used to use OBS). It can be used with any version of Visual Studio supported by CMake as well as plain makefiles and jom makefiles.

Open CV 2.2 Include Directory Missing

I have several Windows 7 64bit systems with OpenCV 2.2 installed on them using CMake and Visual Studio 2008 Standard. CMake generates everything in C:\libs\OpenCV-2.2.0\build just fine and Visual Studio 2008 compiles everything without complaint.
However, every time I do this process on various machines I find that the include directory (C:\libs\OpenCV-2.2.0\build\include\opencv2) is either empty or nearly so. I usually end up thrashing around compiling different versions and poking on random project files until it appears and every time I think I have it figured out. However, with each new install I'm back to the begining.
Is this a known issue for 64bit build of OpenCV 2.2 on Windows 7 64bit using Visual Studio 2008 and is there a known workaround?
Various questions here seem to be hinting at the same thing and guides online are either old or don't reference the problem at all.
To solve this problem compile everything in release and debug then right click the INSTALL project in Visual Studio 2008 and choose Build. This will "install" numerous files and move all the include files into the proper location.
Now /include will contain subfolders
opencv
opencv2
and /include/opencv2 will contain numerous subfolders:
calib3d
contrib
core
feature2d
flann
gpu
highgui
imgproc
legacy
ml
objdetect
video
I just had the same problem. The Answer which explains that you have to rightclick and build the "INSTALL" project after you have built the debug/release works for me now. BUT: for me it was not a "build" folder which was created, but a folder called "install". Inside of that folder there is a include folder now which contains all the stuff you need for the include. The OpenCV version im using is OpenCV v3.2.
well i have the same problem with visual studio 2010,
and the answer
""To solve this problem compile everything in release and debug then right click the INSTALL project in Visual Studio 2008 and choose Build. This will "install" numerous files and move all the include files into the proper location""
cannot work on this. because when you choose 2010 visual configuration
there are no option to do debg or release. u do this afterwars from visual studio
when complile in debug or release mod. has one anny answer.
you my friend that have managed to create a full buld properly
can you please make one with qt support ,and with examples and docs cmake configuration amd please e mail it to me??
it wont take you more than some minutes
and this will be a great help because i try many days to solve it
How are you making \build\ ?
I didn't think opencv did out-of-source builds properly. At least I've never got them to work - have you tried setting the build dir to a completely separate tree?

visual studio 2005 to 2010 with boost

About a month a go I spent almost an entire week trying to figure out how to build the boost libraries for vs2005 and today I updated to vs2010.
Do I need to remove boost for vs 2005(I uninstalled vs2005) and go through the build process for 2010 or will it magically work and I can go take a nap?
You need to rebuild Boost for the new version of Visual C++.
I don't believe anyone has released a binary distribution for Visual C++ 2010 yet. The BoostPro site would be the best place to get a binary distribution, and they don't have them yet.
It shouldn't be too difficult to build Boost if you follow the instructions in the Boost Getting Started Guide.
Whether or not you take a nap is up to you. If you build Boost from source, you may as well take one since the build is rather lengthy.