visual c++ include and link libraries - visual-c++

I have a old install of visual c++ 6.0. I'd like to bring things more nearly up to date particularly for include files. Here is a list of what my TOOLS->OPTIONS->DIRECTORIES->INCLUDE FILES shows...
c:\program files\microsoft visual studio\vc98\include
c:\program files\microsoft visual studio\vc98\mfc\include
c:\program files\microsoft visual studio\vc98\atl\include
c:\windows\microsoftnet\framework\v2.0.50727
c:\program files\microsoft html help workshop\include
c:\program files\microsoft sdks\windows\v7.0\include
So, the questions is: Are there newer versions of these include directories compatible with my visual c++?

The last SDK that works with VC 6.0 is the February 2003 Edition. .Net 2.0 SDK and
Windows 7 SDK won't work with VC6. Since you put them after VC6's include path, they are likely not used anyway.
Html help workshop has not been updated since 2003. It works with VC6.

Related

vcvarsall.bat missing after installing Visual Studio 2019

Previously on my Visual Studio 2017, I had the file vcvarsall.bat located at this location - "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat"
But later my office installed Visual Studio 2019 and I dont see vcvarsall.bat file anywhere.
Can anyone advise how to get the file, I did read some forums but could not find any solution.
Please advise.
Thanks.
You can find the vcvarsall.bat file for VS2019 at:
C:\Program Files (x86)\Microsoft Visual Studio\2019\Your VS Edition\VC\Auxiliary\Build\vcvarsall.bat
And one point we should know, this file is under VC folder. So it's part of C++ workload. If you can't find the file in the location above, please make sure you've installed the C++ related workload. (In VS, go Tools menu=>Get Tools and Features=>Install the Desktop Development With C++ workload)
In addition: The path you mentioned above refers to the vcvarsall.bat for VS2015. The vcvarsall.bat for VS2017 should be under C:\Program Files (x86)\Microsoft Visual Studio\2017\... directory. VS2015=>vs version 14.0 while VS2017=>15.0.

How can I use CodeBlocks with the most recent versions of the VC++ compiler?

I need to use C::B with a recent version of MS VC++ compiler like the ones in VS2015 or VS2017, and eventually future ones, but C::B does not offer such option. The most recent VC++ version that C::B allows the user to choose from its list, in the Settings, is VC++2010 (MSVC++10.0) wich is quite old. After some search I didn't find an explanation to overcome the problem. Not even C::B site offers a solution. How can I do that?
After some attempts I made with C::B settings and VC++ compilers, I found a solution that is not complicate at all. In this post I will show how to use the latest versions of VC++ compiler (MSVC++ 14.0 or higher) with CodeBlocks - with no need to install Visual Studio. The solution would be identical if you prefer to use Visual Studio instead.
I will answer the question for 32 and 64 bits projects. By default it will support std C++14.
Content:
A) Install the latest version and compile for x86 projects;
B) Change to C::B 64bits projects.
A) Install and use for 32bits projects
Install the latest version of VC++ compiler.
The VC++ Toolset can be obtained through NuGet.
To get NuGet look here: NuGet.
Run the following command from the command line. The command installs the latest version is (according MSDN):
c:\\> nuget install VisualCppTools.Community.Daily.VS2017Layout -Version 14.14.26423-Pre -Source https://visualcpp.myget.org/F/dailymsvc/api/v3/index.json
Install Microsoft Build Tools 2015 (or higher). Here I will stick with 2015, but you can go for 2017.
For 2015 the installer is here BuildTools2015. Run it to install the tools.
Open C::B and configure it. C::B last version for Microsoft Visual C++ is 2010. We can use it, but seting a more recent compiler.
3.1 Go to Settings>>Compiler
3.2 In "Selected Compiler" select MS visual C++ 2010. This is the higher version available in C::B.
3.3 Select the Tab "Toolchain executables" and set the Compiler's directory with the directory with the VC++ Toolset. In my case:
D:\VisualCppTools.14.0.25114-Pre\lib\native
Confirm if the "Program Files" boxes of the tab are filled.
3.3 Select "Search directories" tab.
3.3.1 In "Compiler" tab add the include directory path.
In my case is:
D:\VisualCppTools.14.0.25114-Pre\lib\native\include
Possibly the following will also be needed (from Build Tools).
C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt
Also if not already there and if needed (in my case)
C:\Program Files (x86)\Windows Kits\8.1\Lib\winv6.3\um
3.3.2 In "Linker" tab enter the paths for the libs. In my case.
D:\VisualCppTools.14.0.25114-Pre\lib\native\lib
Possibly, also,
C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\x86
And if your project complains about uuid.lib, then insert also (in my case),
C:\Program Files (x86)\Windows Kits\8.1\Lib\winv6.3\um\x86
3.3.3 "Resource compiler" tab. This is optional. In my case,
D:\VisualCppTools.14.0.25114-Pre\lib\native\include
And that's it! But if we prefer, C::B allow us to change the compiler name.
B) Change the C::B project settings for x64 projects
Point linker libraries' paths to their x64 counterparts. In the Settings menu choose "Search Directories">>"Linker".
1.1 For the compiler library, add "amd64". In my case:
D:\VisualCppTools.14.0.25114-Pre\lib\native\lib\amd64
1.2 For "ucrt" and "um" add "\x64" to the paths. Example for my case:
C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\x64
C:\Program Files (x86)\Windows Kits\8.1\Lib\winv6.3\um\x64
For the compiler select the Tab "Toolchain executables" and insert the prefix "amd64\" for C++ compiler and Make program, as: amd64\cl.exe, amd64\nmake.exe
Again, that's it!
Good work!
Below are compiler options entries for MSVC 2015 installation on Windows 7 when compiling a "plain" C++ console application (no CLI) for a x86 target machine:
INCLUDE=
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\atlmfc\include
C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt
C:\Program Files (x86)\Windows Kits\8.1\Include\um
C:\Program Files (x86)\Windows Kits\8.1\Include\shared
C:\Program Files (x86)\Windows Kits\8.1\Include\winrt
LIB [x86]=
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\lib
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\atlmfc\lib
C:\Program Files (x86)\Windows Kits\10\lib\10.0.10240.0\ucrt\x86
C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86
C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\Lib\um\x86
LIBPATH=
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\atlmfc\lib
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\lib
I added INCLUDE and LIB to search directories for compiler and linker, respectively, and everything worked in C::B for a x86 console application.
I didn't experiment with x64 architecture...

Cannot locate VS 2015 Enterprise executable

Installed VS 2015 Enterprise in location
C:\Program Files(x86)\Microsoft Visual Studio 14.0
From previous posts with other versions it is supposed to be in the Common\IDE folder somewhere. In Control Panel it already shows as installed. Can't locate it.
As said in comments, the path is:
C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\devenv.exe

VS2012 changes assembly location after adding the reference

I have a TFS Policy for VS2010, I want to use it in VS2012 also so I created a new project (a library targeting Framework 4.5) and started the migration, the problem is that VS2012 insist on changing the paths of my references, for example:
C:\Program Files (x86)\Common Files\Microsoft Shared\MSEnv\PublicAssemblies\envdte.dll
C:\Program Files (x86)\Microsoft Visual Studio 11.0\VSSDK\VisualStudioIntegration\Common\Assemblies\v2.0\Microsoft.VisualStudio.Shell.Interop.dll
VS2012 changes it to:
C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\PublicAssemblies\envdte.dll
C:\Program Files (x86)\Microsoft Visual Studio 2010 SDK SP1\VisualStudioIntegration\Common\Assemblies\v2.0\Microsoft.VisualStudio.Shell.Interop.dll
Is there a way to avoid this?, I added a HintPath to the .proj file with the full path but Im afraid it will not compile on the server if cant find the exact same path.

Visual C++ includes directories

I want to read some library files and I went to Tools>Options>Projects and Solutions>VC++ directories and I found the following :
$VSInstalldir/...
$VSInstalldir/...
$FrameworkSDKdir/
$WindowsSDKdir/...
$PATH
$SystemRoot/Syswow64/....
And I could locate only files inside $VSInstalldir .
Where are $FrameworkSDKdir, $WindowsSDKdir, $PATH, $SystemRoot/Syswow64 supposed to be in Windows???
Most of those variables are set using batch files. You can find each one by going to your Visual Studio installation folder, then the VC subfolder and tracing through vcvarsall.bat.
For instance, on my VS2008 installation on WinXP:
Open C:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat
Go to the x86 label, that points to C:\Program Files\Microsoft Visual Studio 9.0\VC\bin\vcvars32.bat
That file points to C:\Program Files\Microsoft Visual Studio 9.0\Common7\Tools\vsvars32.bat
This file (finally) contains all the variable definitions.
Another, easier, way is to open the Visual Studio Command Prompt under Microsoft Visual Studio 2008 -> Visual Studio Tools and then use the echo command to print all those variables.
Setting environment for using Microsoft Visual Studio 2008 x86 tools.
C:\Program Files\Microsoft Visual Studio 9.0\VC>echo %FrameworkDir%
C:\WINDOWS\Microsoft.NET\Framework
C:\Program Files\Microsoft Visual Studio 9.0\VC>echo %VSInstalldir%
C:\Program Files\Microsoft Visual Studio 9.0

Resources