Parallel Installation of VS2017 and VS2015 breaks cmake (and more) - c++

I installed Visual Studio 2017 15.4.0, then i installed VS2015 Update 3 (
C++ Language only).
I started VS2015 and tried to create a C++ Project (e.g. Console Application) but nothing happens, the dialog just does not close or continue. Only "Cancel" is possible. More important for me, i tried to configure a project (caffe2) as a VS2015 project, but cmake failes to find the VS2015 tool set.
The problem (or a part of the problem) is, that VS2015 normally installs its toolset (cl.exe etc.) to
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin
But because of VS2017, it uses now:
C:\Program Files (x86)\Microsoft Visual Studio\Shared\14.0\VC\bin
(see also Visual Studio 2015 Installer doesn't install cl.exe)
CMake (3.9.4) does not find the rc.exe or cl.exe of VS2015 anymore
I tried uninstalling both studios and reinstall them starting with VS2015, but VS2015 is still using the shared folder and not its own. (Even worth, i now got a mix of both folders, some minor important files are now duplicated). As a workaround, i started cmd.exe in "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC",renamed bin,lib,include,redist to bin#,lib#,... and used hardlinks like this
mklink /j bin "C:\Program Files (x86)\Microsoft Visual Studio\Shared\14.0\VC\bin"
mklink /j lib "C:\Program Files (x86)\Microsoft Visual Studio\Shared\14.0\VC\lib"
mklink /j redist "C:\Program Files (x86)\Microsoft Visual Studio\Shared\14.0\VC\redist"
mklink /j include "C:\Program Files (x86)\Microsoft Visual Studio\Shared\14.0\VC\include"
At least, cmake is now working again, but i still cannot create any projects with VS2015 anymore ( i do not need this VS2015 functionality really, but it makes a bad feeling having a broken installation)
Is anyone else having this trouble and got a better solution than the workaround above ?

Related

Folder "Microsoft Visual Studio 14.0" Is Missing

I'm trying to add pthread library to Visual Studio 2017 (I'm using Windows 10 OS). I'm using the following guide from another post tat I saw, but I can't find the "Microsoft Visual Studio 14.0" folder in "C:\Program Files x86". I have Visual Studio 2017 and It's working. I've checked and I've installed the Visual Studio C++. What else should I install? Is there any other way to include pthread library by just adding it to the project and including the path to the library in the linker or something similar?
Thank you
Since visual studio 2017 visual studio is installed in C:\Program Files (x86)\Microsoft Visual Studio\<version>\<edition> by default e.g. C:\Program Files (x86)\Microsoft Visual Studio\2017\Community. There are other changes to the internal layout of files within the visual studio directory too. Your guide seems to only provide libraries for Visual Studio 2010 and 2012, these won't work in 2017, you should try to find an updated guide (or just use std::thread instead of pthreads).
Installing these files inside the visual studio directory isn't the right approach anyway, install them to a directory of your choice and update your project settings to point to that directory. The lazy approach in the guide is likely to cause problems in the long run.

Install LibRaw from Github-Repo in Windows [duplicate]

I recently installed Visual Studio 2017 and need to change something in a C++ project.
But when I try to build, it says cl.exe is missing. None of the solutions provided online seem to work.
I do have a cl.exe, but it is located under this path:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.10.25017\bin\HostX64\x64
I have also tried running vcvars32.bat, but that does not seem to make any changes.
And I have installed 'Desktop development with C++'.
I solved it by running vcvars.bat.
For Visual Studio Enterprise 2017 it is located under the following directory:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\Tools\vsdevcmd\ext

Visual Studio 2015 doesn't have cl.exe

I downloaded Visual C++ and Visual Studio, but I cannot find cl.exe to compile my C++ file. The path to the install is `C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin.
Where can I find the compiler to compile C++ code?
Visual Studio 2015 doesn't install C++ by default. You have to rerun the setup, select Modify and then check Programming Language -> C++
In Visual Studio 2019 you can find cl.exe inside
32-BIT : C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.20.27508\bin\Hostx86\x86
64-BIT : C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.20.27508\bin\Hostx64\x64
Before trying to compile either run vcvars32 for 32-Bit compilation or vcvars64 for 64-Bit.
32-BIT : "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars32.bat"
64-BIT : "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat"
If you can't find the file or the directory, try going to C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC and see if you can find a folder with a version number. If you can't, then you probably haven't installed C++ through the Visual Studio Installation yet.
For me that have Visual Studio 2015 this works:
Search this in the start menu: Developer Command Prompt for VS2015 and run the program in the search result.
You can now execute your command in it, for example: cl /?
For first need check is installed cl.exe,
open Developer Command Prompt for VS2015 and type "where cl"
When its founded on the PC need add $(VC_LibraryPath_x64), $(WindowsSDK_LibraryPath_x64) and $(NETFXKitsDir)Lib\um\x64 to Project->Properties->VC++ Directories

Making BJAM 1.33.1 in boost compile with Microsoft Visual Studio 8

When trying to build a boost 1.33.1 library with bjam, I keep getting thousands of errors with command similar to this:
CALL "C:\Program Files\Microsoft Visual Studio\VC98\bin\VCVARS32.BAT" >nul
Is there any way to change where bjam searchs for Microsoft Visual Studio for boost 1.33.1? My Visual Studio installation is located in "C:\Program Files\Microsoft Visual Studio 8"
Thank you for the suggestions ildjarn and Nicol Bolas.
I did a manual text search for VC98 and found an HTML help file, msvc-tools.html, which states that if the MSVC_ROOT variable defaults to "c:\Program Files\Microsoft Visual Studio\VC98" if not specified. I simply set the MSVC_ROOT variable to my Visual Studio 8 directory and things compiled.

C++ #include <atlbase.h> is not found

When I compile my C++ program in Visual Studio Express it says that it can't find atlbase.h. Am I missing some SDK or something?
Visual Studio 2017
When running the Visual Studio Installer, select the Individual components tab, and under SDKs, libraries, and frameworks make sure Visual C++ ATL Support is selected.
It is included with the Windows Driver Kit Version 7.1.0.
Microsoft ATL (Active Template Library), which includes the header atlbase.h is included with the Windows 2003 SDK, but it is not included with any newer Windows SDK release. It is also included with Professional editions of Visual Studio.
Solution for Visual Studio 2017 Express edition
I had the same error when building a COM C++ project in Visual Studio 2017 Express edition. As mentioned by several users here, ATL support is not included with the Express edition of Visual Studio. So to build a C++ COM/ATL project you need at least the Community edition.
If you really need to use the Express edition, you can download and install the Build Tools for Visual Studio 2017. Make sure to enable the 'Visual C++ ATL for x86 and x64' component during the setup.
After that add additional VC++ directories in the project properties:
Include directories: C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.14.26428\atlmfc\include
Library directories: C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.14.26428\atlmfc\lib\x86
The VC++ compiler should now be able to find the ATL source and library files.
For users of Visual Studio 2015, ensure Common Tools for C++ is installed (part of the VS installer).
Situation
With Visual Studio 2017 Community Edition, we installed "Visual C++ ATL support" and MFC and ATL support. The error still occurred in our x64 project.
Solution
We fixed some paths with the following two commands:
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC>mklink /d atlmfc "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.11.25503\atlmfc"
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.11.25503\atlmfc\lib>mklink /d amd64 "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.11.25503\atlmfc\lib\x64
Details
We eventually found the header atlbase.h in C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.11.25503\atlmfc\include. This path simply was not added to the VC Include directory by vsvars32.bat, so the header was not found during build.
vsvars32.bat includes the following line:
#if exist "%VCINSTALLDIR%ATLMFC\INCLUDE" set INCLUDE=%VCINSTALLDIR%ATLMFC\INCLUDE;%INCLUDE%`.
This resolved to C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\atlmfc\include in our machine.
We created a directory junction, so the build tool finds atlbase.h in the expected directory (this is the first command from the Solution section above):
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC>mklink /d atlmfc "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.11.25503\atlmfc"
Afterwards, the linker did not find atls.lib (see Cannot Open File atls.lib). This was due to the expected file structure was that lib should directly contain the x86 version of the libs and lib\amd64 should contain the x64 variants. Instead, lib\x86 contained the x86 versions and lib\x64 contained the 64 bit versions. Since we build a 64 bit project, creating another directory junk from amd64 to x64 solved the problem:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.11.25503\atlmfc\lib>mklink /d amd64 "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.11.25503\atlmfc\lib\x64
That header appears to be a part of the Windows Platform SDK.
You should search your computer for the file. That will tell you if you're missing it.
I had same problem with sample project. I specified the sample project's properties and the sample project compiled successfully.
Visual Studio 8
For header
C:\Program Files\Microsoft Visual Studio 8\VC\atlmfc\include
For .lib file
C:\Program Files\Microsoft Visual Studio 8\VC\atlmfc\lib
I have not yet seen anyone mention Visual Studio 2015 (MSBuild 14.0). In this case I've had to download Visual C++ BuildTools (found here: https://visualstudio.microsoft.com/vs/older-downloads/). After having installed this, running the installer again allowed me to modify the installation and include the ATL libs.
Hope this helps anyone that is still using MSBuild 14.0