vcvars64.bat file is missing - windows

I installed visual C++ express from http://www.visualstudio.com/en-us/downloads#d-2010-express. I have also installed Microsoft SDKs http://www.microsoft.com/en-us/download/details.aspx?id=8279.
I need the vcvars64.bat for the installation of one of my programs (Gnu Linear Programming Kit or GLPK). Unfortunately, I don't see this file in C:/Program Files (x86)/Visual Studio 10.0/vc. I typed the following command in cmd terminal:
"CALL "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x64"
But it does not create the vcvars64.bat file in the intended place.
Can I just download this file from some webpage and put it in C:/Program Files (x86)/Visual Studio 10.0/vc ? Any feedback will be very appreciated.
Thanks,
Nazmul

The file is located in VC/bin/amd64 in the Program Files folder for Visual Studio 2010
Edit: Sorry, I checked with my own 2010 install, which is not an "Express" one. VS2010 Express comes without a 64 bits compiler.
See How to compile a 64-bit application using Visual C++ 2010 Express?

Related

Visual Studio 2022: Cannot open include file: 'ctype.h'

I've got the infamous error message in C++ build: "Cannot open include file: 'ctype.h'". I know a similar question was already asked multiple times, but my case seems different because I am using the latest Visual Studio 2022 and seems to behave differently.
I have a bunch of existing C++ projects, they use plain 32-bit Windows API with DirectX 6, and I used VC++ build tools 2015 and Windows SDK 8.1 to compile it without any issues in previous versions of Visual Studio. Everything was fine in Visual Studio 2019, no special setup was needed, until I uninstalled it and installed Visual Studio 2022.
Now I can open my solutions, it nicely shows they are using C++ build tools 2015, which I installed together with VS2022, and the solutions also shows correctly that they use Windows 8.1 SDK. But Windows 8.1 SDK is not present in VS2022 installation, I installed it separately. I also tried to "repair" VS2022 installation, but that only deleted all my UI preferences, but not fixed anything in build. Also, I tried to reinstall Windows 8.1 SDK, but it said it is already OK.
When looking to Visual Studio, I can't see any place where I can set default include and lib directories, I can only list what is being used right now. VS2022 shows this list:
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\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
The actual error message I receive is this:
c:\program files (x86)\windows kits\8.1\include\um\winnt.h(31): fatal error C1083: Cannot open include file: 'ctype.h': No such file or directory
So it says that winnt.h from windows kits 8.1 cannot find ctype.h. And yes, there is no ctype.h in that folder or anywhere around, I can see it only in C:\Program Files\Microsoft Visual Studio\2022\Professional\SDK\ScopeCppSDK\vc15\SDK\include\ucrt
which I think is the folder with VC++ 2015 build tools. So this seems correct, but I am wondering why this folder is not a part of default include directories when VC++ 2015 build tools are set in project settings. Because it seems that VS2022 is correctly picking my Windows 8.1 SDK, but not picking correctly the older C++ compiler.
When I try to add the folder where ctype.h resides to include folders, I receive another type of errors saying that other files are incompatible with these include files. Of course, this system of directories needs to be in sync. So please what is the correct way of using this?
Also, I tried to switch the VC++ build tools to 2022 version. Unfortunately, that also does not fix the issue. And Windows 10 SDK is not installed, the software wants to stay compatible with older Windows, so I don't need it.
I found a bug report which is related: https://developercommunity.visualstudio.com/t/windows-81-sdk-1/151682
Although Microsoft staff declined to accept it as a bug, it is happening for me as well. When I install only Windows 8.1 SDK, no project can be compiled with it. I even tried to create a new Windows API project in VS2022, the project was created, but failed to compile with the same error.
So I tried to install Windows 10 SDK (from VS2022 installed, but that is probably not important) and this added some missing files which now help to compile Windows 8.1 SDK projects. Problem seems to be solved, my old C++ code can now be compiled with Windows 8.1 SDK and both C++ build tools 2015 and 2022.

Visual Studio 2022 - "VCRUNTIME140.dll Is Missing" [duplicate]

I have a problem when trying to install apache 2.4 on my windows 10. It always shows the error that VCRUNTIME140.dll is missing. I have checked other threads and found out that installing the 2015 Visual c++ Redistributables x64/x86 always solves the problem but I have both installed and I still have this problem. Are there any other solutions?
You need to install Microsoft Visual C++ 2015 Redistributable Update 3 RC, please find the link here, choose between the 32bit or the 64bit.
Reinstall the apache 2.4 and error should gone.
I had the same issue after installing wamp on windows 10.This worked for me.
Download VCRUNTIME140.DLL
Copy the dll file to C:\Windows\System32 using administrative privileges.
Try reinstalling apache.
Download and install the proper version of Microsoft Visual C++ 2015 Redistributable Update 3 RC regarding your hardware architecture (x86 / x64). Use the link below:
Microsoft Visual C++ 2015 Redistributable Update 3 RC
On Windows 6 X64, got an error 500 on any PHP files,
installing the 2015 Visual c++ Redistributables x64 solved my problem.
I'v already had VC 2015 Redist on my PC but files were not copied into Windows\System32.
So I copied missing files directly to this folder. A thing that I should mention is since I compiled my application in X86 mode I copied them from
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\redist\x86
not
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\redist\x64
I know that this solution is not the ideal one, but it was a workaround for my case.
If you are using Microsoft Visual C/C++ and you have already downloaded VCRUNTIME140.DLL, Go to Project Properties->Configuration Properties-> C/C++ -> Code Generation, Set Runtime Library Multi-threaded (/MT)
Remove apache 2.4 from your pc
Download VCRUNTIME140.dll from this link
Copy VCRUNTIME140.dll file and paste it inside to Windows/System32
Finally reinstall apache and run

Visual Studio Exe App compilation path change

I just want to change the exe file Visual Studio compilation path change
I am doing it like this now. i created a bat file that copied file. I have added visual studio build events. I wonder if there is an easier way.
meanwhile the exe file is being copied to the network drive
I had this problem in a different context (Elixir/Phoenix, Rust), but the root cause was the same: cl.exe could not be found during compilation.
My setup was:
Windows 10, x64
Visual Studio Community 2017 already installed, but only for C# development
For some reason the solution with installing the Visual C++ Build Tools (as #cozzamara suggested) did not work. Stops during installation with some obscure error message. Guess it did not liked my existing Visual Studio installation.
This is how I solved it:
Start up the Visual Studio Installer
Check the Desktop development with C++ (screenshots here)
Execute following command before compiling:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat
From this on the command cl.exe works. Alternatively (and more conveniently for development) start the application 'Developer Command Prompt for VS 2017' or 'x64 Native Tools Command Prompt VS 2017'.
Share
I solved the problem by writing code like this in the Post build field, I just ensured that the exe was copied to the field I wanted
COPY $(TargetPath) "\x.x.x.x\ortak\yakup\TestApp.exe"
pause
$(TargetPath) = It gives the location where the exe exited, along with the exe name
"C:\yakup\project\TestApp.exe" like

"Invalid License File" while using CMake with Visual Studio Express 2010

After installing AVR Studio, CMake returns an error saying "Invalid License Key" while trying to generate a new project using the MSVC generator. This may also happen if other tools based on Visual Studio 2010 are installed.
This problem is caused by AVR Studio (and possibly) other products installing a "devenv.exe" in the folder C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE. By default, CMake will attempt to use "devenv.exe" and fall back on "MSBuild" if it is not found. MSVC Express 2010 does not use a "devenv.exe", but instead has its own executable. To fix this problem, rename the "devenv.exe" file to "devenv1.exe" while generating an MSVC 10 file using CMake. It may be necessary to rename it back to get the other tools to work but so far it has not been a problem.

VC++ cl.exe -- DLL not found

I added the bin directory of the VS2010 (not SP1) C++ compiler to my PATH variable on Windows XP. When i try to run it, it tells me that a DLL was not found.
I added this line to my PATH:
C:\Program Files\Microsoft Visual Studio 10.0\VC\bin;
Update: it still fails when I cd to the bin directory above, and then run the compiler
Can you help me out?
Run the VS command prompt shortcut or the batch file it points to, such as:
"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" x86
to set up an appropriate environment including the path.
By the way, mspdb100.dll lives in C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE. But run the shortcut/batch file anyway - it does more than set up the correct path.
add Microsoft Visual Studio 10.0\Common7\IDE to your Path variable, than close cmd prompt and open it. now it will work.
Running the VS command prompt takes care of setting up the environment. Also, ensure that you are running the command prompt as an admin.
Installing Visual Studio 2010 SP1 C++ Compiler Setup fixed this issue for me. Visual Studio 2010 SP1 C++ Compiler install
I faced the same issue when I tried to run a 32 bit exe I built, on a 64 bit machine.
"mspdb100.dll couldn't be found by cl.exe "
Visual Studio 2010(the version I currently use) builds a 32 bit exe by Default.To create a 64 bit executable, just change the setting from Win32 to x64 in the dropdown box at the top of VS and build.This will build for you a 64 bit executable and solve your problem.

Resources