what is the general method to add opencv in visual studio for all programs? - c++

I am trying to setting up opencv for my project in visual studio and for this I have seen so many blogs and forums but still I didn't find any way to add openCv in generalized way so every time I make new project, it should be added automatically. Is there any way to add openCv in visual studio so every time when I will make new project it should be added automatically, please share your answers. I want to save my time

Vcpkg is a package manager which helps you to manage C and C++ libraries on Windows, Linux and MacOS, available on GitHub.
Use vcpkg in the PowerShell command prompt .\vcpkg install opencv to install opencv and issue command .\vcpkg integrate install to integrate installed packages into your Visual Studio projects.

Related

Setting up Qt for use in a project in Visual Studio

I am trying to use Qt to make a simple GUI program in C++ using Microsoft Visual Studio. It's for a school project, but my professor has given very little guidance on how to get the Qt library working in Visual Studio, and I can't seem to follow the information given on the website. I know it's a big ask, but would anyone be able to walk me through how to get things up and running?
I recently installed and used QT at home using VS19 Community and latest QT Open Source.
The following YouTube video should help you get started.
Configure VS19 to create QT5 Apps
The Summary:
Install QT: Choose advanced, and install the latest version of QT + the support for version of Visual Studio you are using.
Install the "QT Visual Studio Tools" extension via the Visual Studio "Manage Extensions"
After installed, From inside VS, set the QT version under the Extensions-->QT VS Tools-->QT Options.
Create a new project.
-- Search for "QT" as it may not appear in the list.
And you're off.

Build OpenCascade for VS2017

Usecase: I intend to use the OpenCascade C++ library in my C++ project. I need to do simple polyline offsetting and polygon scaling down.
So I am attempting to install the OpenCascade C++ library on my Windows 10 64bit machine to use in Visual Studio 17. My first attempt was to use the windows installer then run the batch files (env.bat, custom.bat). But I have read on this forum that the windows installer wont work for Visual Studio 2017 - is that correct?
So I have now followed the build instructions here. And now I have opened the sample projects in Visual Studio 2017. When I try to build the project I get the following errors for each of the sample projects:
Error MSB8036 The Windows SDK version 8.1 was not found. Install the required version of Windows SDK or change the SDK version in the project property pages or by right-clicking the solution and selecting "Retarget solution". TKQADraw C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Platforms\x64\PlatformToolsets\v141\Toolset.targets 36
Any advice on what I have done wrong? Maybe I didn't build it properly following these steps? Also, given my usecase above, do I need to do all this if I just want to use OpenCascade in a limited way?
Is there documentation or a link on how I create a new Visual Studio C++ project and link all the OpenCascade libraries?
As the error says, you haven't installed the correct SDK version, or maybe the version you installed is out dated. Check the SDK install and try again.

Adding Casablanca Dependency VS2017

I recently upgraded to VS2017 and I'm looking to start doing more C++ work. I've not used VS or C++ in a good while (and even at that I was a C++ novice).
I'm trying to install Casablanca, aka CPPRestSdk (https://github.com/Microsoft/cpprestsdk) but I can't seem to manage it.
I've tried installing it through NuGet but I'm not sure exactly what I've to link to my project, and I've tried vcpkg - to which I've downloaded via the instructions but I have no clue what to do there.
All the materials I find for this apply to earlier VS editions and don't appear to work when I try them. Has anyone had such luck with getting this to work? If not, is there an alternative that I can use that has clear installation instructions?
Thanks
I recently moved a C++ REST SDK based project from the older NuGet package to the recent VCPKG based 2.10.1 release. Apart from Visual Studio 2017 with the C++ for Desktop workload make sure you have Git for Windows installed. Clone the VCPKG repo from GitHub with
git clone https://github.com/Microsoft/vcpkg
I'd recommend using a directory not having any spaces in its path, otherwise some builds might fail. Change into the VCPKG directory and run the bootstrap script:
.\bootstrap-vcpkg.cmd
This will compile the package manager itself. Afterwards you can install the C++ REST SDK with
.\vcpkg install cpprestsdk cpprestsdk:x64-windows
This will download all required libraries and takes quite a while. For usage in Visual Studio you have to enable the system wide integration with
.\vcpkg integrate install
This requires elevated privileges the first time but afterwards the C++ REST SDK is available in any Visual Studio C++ project. Follow the instructions for getting started. As soon as you include a C++ REST SDK header into your project the linking is taking care of automatically by Visual Studio.
For consumption in a CMake project you have to pass the VCPKG toolchain file to the CMake command, e.g.
cmake -DCMAKE_TOOLCHAIN_FILE=C:\vcpkg\scripts\buildsystems\vcpkg.cmake
Referencing the C++ REST SDK from CMake is described in the project repo's README.

Adding dependencies to a setup project Win32 application Visual Studio

Hi I am looking to create a setup project for my Win32 application developed using Visual Studio 2013. I have created the setup.exe using InstallShield However now i also need to add dependencies which should be installed along with the required application when setup.exe is run.
The dependencies are simply Visual C++ Redistributable for Visual Studio 2015.
I went through this article for creating the setup.exe for my application. But I did not find any documentation which directs me how to add dependencies to this installer.
I found this document which describes a walkthrough for adding dependencies but that is no more possible in Visual Studio 2013 as much as I am aware. Now we 'NEED' to use Install Shield. Correct me if I am wrong.
Please direct me to some documentation which will guide me to add dependencies to my setup project.
UPDATE
I found in the InstallShield Project Assistant an option to check for installation requirements. But it requires you to specify the directory to search the particular file. As far as I know the Visual C++ Redistributable package is not installed in any particular location but the only way to detect its presence is to check if the registry key is set to 1.
So instead of checking I'd rather always have the setup file to install the Visual C++ Redistributable package no matter it is present or no.
But even for that how do I go about it?
There might be other reasons you need to use InstallShield that I'm not aware of, but in the simple case of a C++ app that needs the runtime as a prerequisite, I'd use Visual Studio 2015 (Community Edition will do) and add the Installer project extension. The project properties lets you build a prerequisite installer (a setup.exe) and among the choices are the VC++ runtimes. That's just an exe that does its checks and installs if required.
I'm not sure how you got a VC 2015 C++ requirement while developing with VS 2013. Again, VS 2013 also has a community edition and an installer project extension that will install the VS 2013 C++ prerequisites.
The redistributable installers have their own checks to see if they need installing. I wouldn't expect InstallShield to require you to know the detection rules of a C++ runtime. that's a bit odd. There may be another setting where you just say C++ runtime required.

how to install SFGUI and SFML visual Studio

I trying install SFML and SFGUI on Visual Studio 2010, but i can't install.
I used Cmake, but it don't work. With SFML,I install by link to library, SFGUI don't work.
Help me!
How to install SFML and SFGUI using Visual Studio 2010 with images???
There is a very good guide at the SFML page. Make sure you follow it to the letter. It's very important you read it first, don't skip steps and download the correct files. For 2010 there should be no need to use CMake. At the time of this post, you only need to build yourself for VS2013.
Current (at the time of this post) guides to SFGUI can be found here. Please note that due to the use of C++11 features, only VS2013 is supported. You can download VS2013 Express for free on the Microsoft site.
That means if you want to use both SFML and SFGUI, you have to use VS2013 and rebuild SFML from scratch. That's easy, if you follow the instructions carefully. If something fails, reread the instructions.