I have installed both tesseract:x64-windows and tesseract:x64-windows-static via vcpkg. In my Visual Studio project, I can #include <tesseract/baseapi.h> and it will automagically compile but I have no idea whether the static or dynamic version of the library is being linked and I also have no idea how to switch between them. What setting lets me see / change that?
For VS integration you could try out PR https://github.com/microsoft/vcpkg/pull/4361 or just set the MSBuild property VcpkgTriplet according to:
https://github.com/microsoft/vcpkg/blob/master/docs/users/buildsystems/msbuild-integration.md
Related
I have a project for which I generate a visual studio solution using cmake. That project links against a library built by a specific compiler version, which I cannot change / update! Therefore I need to compile my project with the same compiler version.
There are ways to setup the minor toolset version using CMake, however none of those that I have found are working like Id want them to.
The problem is: I can generate my vs solution and have cmake select the correct toolset version. However when I build the project with Visual Studio the compiler version does not match the version selected by cmake. I presume this is due to the fact, that Visual Studio does not care about CMakes build "ideas" and does not easily allow a minor toolset selection.
The only solution I have found so far is described in this link: https://devblogs.microsoft.com/cppblog/side-by-side-minor-version-msvc-toolsets-in-visual-studio-2019/
In Short you can (manually) edit every *.vcxproj File and override the toolset version with an import like so
<Import Project="$(SolutionDir)\Microsoft.VCToolsVersion.14.20.props" />. I wish to do this via the CMakeLists.txt or an argument, when generating the solution. I have tried:
Specifying the exact toolset version via the "-T" argument like so: -T v142,version=14.28.16.9 />
Modifying a "vcvarsall.bat" to pass the correct toolset version by appending "-vcvars_ver=14.28". This makes Cmake select the correct compiler.
For boths methods VS does not care. The only way I found working is modifying the *.vcxproj by hand. Otherwise VS always picks the newest minor version of the selected toolset (in my case v142).
I am novice at cmake, so please be gentle.
I have a medium sized project that has been using visual studio with cmake. I would like to use the build/install features that I currently use in visual studio, but with cmake in the terminal.
Currently the project uses a cmakesettings.json to switch between the different builds and locations. When I searched this though, it seems to be specific to visual studio?
https://github.com/microsoft/CmakeSettings
Is there a tool or easy way to use these settings with cmake instead of visual studio?
Note that in VS2019, the correct way to do this is to use CMakePresets.json and then you can build in a VS2019 or higher, VS2022, or in a CI using cmake from the cmd.exe. CMakeSettings.json is deprecated. To enabled support for them, there is an option that needs to be enabled. See this link https://learn.microsoft.com/en-us/cpp/build/cmake-presets-vs?view=msvc-160 for more information.
We have large project that used .NET Framework for showing forms/windows. Recently I decided to deprecate CLR dependency and move to Qt.
While learning Qt, we've migrated from Visual studio 2013 to 2015 and then I noticed that there is no qt support for MSVC 14 version which vs2015 use.
Additionally, Qt vs addin was not working jn visual studio express/community edition we use. Is there any chance for me to use Qt and qt addin in our projects?
Searching web did not help, and it looks like no one use Qt with latest Visual Studio?
Building
You can use Qt in Visual Studio 2015 without any problems. As already stated in the comments, you have to build it from source but Qt is pretty straightforward to build. You can download the current (5.5) sources here and then follow this step by step example on building it.
I would also suggest reading more about the configure options, this might save you a lot of time. It might possibly save you some external dependencies as well if you skip components you do not need. My configuration for instance contains -skip qtwebkit -skip qtwebchannel so I do not need ruby or python.
I could totally omit step 3 from the link. Just be sure to open the Visual Studio Command Prompt (32/64 is important here) for configure and nmake.
Usage
For Visual Studio 2015, the Qt Add-In is not available anymore. But there is an Extension (Tools > Extensions & Updates) called Qt5Package or QtPackage which has the same functionality. After installing it, you have the Qt entry on your main toolbar where you have to specify a version and the path to the directory where you built it. This version will also be associated with the current project via the same menu.
If you load an existing project, you also have to convert it so the whole Qt functionality is used automatically. You can do this by opening the solution and right click on it; there should be an entry for the conversion to a QtAddin generated project.
I am using Qt 5.5 on Visual Studio 2015 with an old project and it is working without any issues.
As of now, you can just download Qt for Visual Studio 2015. Here.
Qt have finally added support for Visual Studio 2013 and 2015 although it's only in beta right now. See QTVSADDINBUG-404 for progress and read the blog post From Visual Studio Add-In To Qt VS Tools (Beta).
The Qt Windows could be added to the current project by copying all relating necessary files from the Qt stand-alone project to the current project. Specifically, the following steps must be conducted carefully.
Create an example project of Qt inside a Visual C++ project by using a Qt Plugin Program. The windows must be designed inside this project carefully before adding to the existing project.
Inside the existing project, add carefully the file heloqt.cpp, helloqt.h, ui_helloqt.h, qrc_helloqt.cpp, moc_helloqt.cpp in case of the Qt Project having the name of helloqt.
Add some configurations of Additional include directories and Additional library directories and Additional Dependencies into the existing project.
Compile and add some required *.dll files for running the program.
I have to do that because I want to use a graphic user interface in my big project, and this project is too big to be added into the Qt project inside the Visual C++ Studio.
I want to use the compiler options described here:
http://randomascii.wordpress.com/2013/09/11/debugging-optimized-codenew-in-visual-studio-2012/
We have a base props sheet which gets included into all projects and would be the ideal place to set this option.
However, it seems that the compiler option changed name with Visual Studio 2013 with Update 3. Some developers in my department have not yet upgraded to this version, so I would like to dynamically select the correct name for this compiler option depending upon which version of visual studio is being used to build.
How can I do that?
I've seen there is a VisualStudioVersion property as described here: http://blogs.msdn.com/b/webdev/archive/2012/08/22/visual-studio-project-compatability-and-visualstudioversion.aspx
and here: Detect Visual Studio version from within MSBuild project
However, it seems that the value of that property changes depending upon the version of visual studio that was last used to edit the solution file, and it does not give the version of visual studio currently being used to build. (At least, that's how I read it, please correct me if that's wrong).
Hmm, also, I think it only gives the major visual studio version. I need to know which update version is being used too.
I am trying to use the gloox library (C++) to create a Windows XMPP application. It seems simple enough, except I don't know how to import gloox into Visual Studio 2010 so I can include it in my application project.
I've looked at the instructions provided in the read-me (shown below), but when I try to compile the library, I get this error:
Cannot open source file: 'src\tlsgnutlsserver.cpp': No such file or directory
Instructions provided in the read-me file:
Building gloox on MSVC++
use the included project file or create your own
adjust include + library paths if necessary
to receive any debug output you should use the LogSink facilities (this is not win32-specific)
build
Does anyone have experience using Gloox with VS10? If yes, can you please help me out? Thanks!
I assume you're using the official 1.0 tarball? I had the same problem (missing source file) and had to acquire the source from SVN instead. I used the 1.0 branch.
I encountered a few other build problems, namely
the release build configuration was set to build an Application (.exe) instead of Dynamic library (.dll) (Project->Properties->General->Configuration Type)
I needed to add DLL_EXPORT to the preprocessor definitions (Project->Properties->Configuration Properties->C/C++ ->Properties->Preprocessor)
src\atomicrefcount.cpp needed to be added to the project's source files. (Project->Add Existing Item)
This worked for me in express editions of both VC++ 2010 and VC++ 2008.
Hopefully it helps you as well.