No files in ~\Microsoft Visual Studio 10.0\VC\include - visual-studio-2010

I have just installed Visual C++ 2010 Express on my laptop (running with Windows8) and I have created a new project (Win32 console Application).
VS 10 generates all the files, and when I build the solution I have the following message
1>------ Rebuild All started: Project: toDelete, Configuration: Debug Win32 ------
1> stdafx.cpp
1>c:\users\arthur\documents\visual studio 2010\projects\todelete\todelete\stdafx.h(10): fatal error C1083: Cannot open include file: 'stdio.h': No such file or directory
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
According to what I have read in other forums, I should have the file stdio.h (and others) in the directory
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include
It appears that this directory contains only a file srv.h
If my understanding is correct, Visual C++ Redistributable installs such files in this directory. I have reinstalled it without any change!
Could you please confirm that my understanding is correct, ie that the directory
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include
should contains files such as stdio.h and then do you have any idea how to get them???
Many thanks!

Related

Qt Creator fails to open a CMake project due to a wrong link.exe path

I upgraded Visual Studio 2017 recently and now cannot open a CMake project in Qt Creator 4.8.2.
CMake succeeds to test the compiler when running from cmd.exe but fails in Qt Creator:
Running "C:\Program Files\CMake\bin\cmake.exe -E server "--pipe=\\.\pipe\{b2399ce2-b8c1-4992-94b7-57b65efed70f}" --experimental" in D:\checkout\mateju\integrace\util\itex\build_Qt5-Release.
Starting to parse CMake project.
The C compiler identification is MSVC 19.16.27027.1
The CXX compiler identification is MSVC 19.16.27027.1
Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/HostX64/x64/cl.exe
Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/HostX64/x64/cl.exe -- broken
CMake Error at C:/Program Files/CMake/share/cmake-3.8/Modules/CMakeTestCCompiler.cmake:51 (message):
The C compiler "C:/Program Files (x86)/Microsoft Visual
Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/HostX64/x64/cl.exe" is
not able to compile a simple test program.
It fails with the following output:
Change Dir: D:/checkout/mateju/integrace/util/itex/build_Qt5-Release/CMakeFiles/CMakeTmp
Run Build Command:"nmake" "/NOLOGO" "cmTC_1344c\fast"
"C:\Program Files (x86)\Microsoft Visual
Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX64\x64\nmake.exe"
-f CMakeFiles\cmTC_1344c.dir\build.make /nologo -L
CMakeFiles\cmTC_1344c.dir\build
Building C object CMakeFiles/cmTC_1344c.dir/testCCompiler.c.obj
C:\PROGRA~2\MICROS~2\2017\COMMUN~1\VC\Tools\MSVC\1416~1.270\bin\HostX64\x64\cl.exe
#C:\Users\MATEJU~1\AppData\Local\Temp\nmEB0D.tmp
testCCompiler.c
Linking C executable cmTC_1344c.exe
"C:\Program Files\CMake\bin\cmake.exe" -E vs_link_exe
--intdir=CMakeFiles\cmTC_1344c.dir --manifests -- "C:\Program Files
(x86)\Microsoft Visual
Studio\2017\Community\VC\Tools\MSVC\14.10.25017\bin\HostX64\x64\link.exe"
/nologo #CMakeFiles\cmTC_1344c.dir\objects1.rsp
#C:\Users\MATEJU~1\AppData\Local\Temp\nmEC75.tmp
LINK Pass 1 failed to run.
NMAKE : fatal error U1077: "C:\Program Files\CMake\bin\cmake.exe":
return code 0xffffffff
Stop.
NMAKE : fatal error U1077: "C:\Program Files (x86)\Microsoft Visual
Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX64\x64\nmake.exe":
return code 0x2
Stop.
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:2 (project)
Configuring incomplete, errors occurred!
See also "D:/checkout/mateju/integrace/util/itex/build_Qt5-Release/CMakeFiles/CMakeOutput.log".
See also "D:/checkout/mateju/integrace/util/itex/build_Qt5-Release/CMakeFiles/CMakeError.log".
CMake Project parsing failed.
As you can see, the compiler path is:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX64\x64
However, it’s looking for the linker in the path:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.10.25017\bin\HostX64\x64
So my question is: How can I update the linker path to (the only existing) 14.16.27023? Or what else should I do to continue using CMake in Qt Creator?
I’ve tried to find a corresponding option in my Qt Creator Compiler options but it claims to use the same vcvarsall.bat call which works well on command-line…
D:\build>"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" amd64
**********************************************************************
** Visual Studio 2017 Developer Command Prompt v15.9.8
** Copyright (c) 2017 Microsoft Corporation
**********************************************************************
[vcvarsall.bat] Environment initialized for: 'x64'
D:\build>link
Microsoft (R) Incremental Linker Version 14.16.27027.1
Copyright (C) Microsoft Corporation. All rights reserved.
<and so on...>
I’ve tried the following steps without any success:
add C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX64\x64 to PATH as the answer to a similar question suggests
launch Qt Creator from cmd.exe after running vcvarsall.bat in the same window
upgrade CMake to the latest stable version (3.14.1)
install and try in Qt Creator 4.9.0-rc1
search for the string 14.10.25017
in the Windows Registry – no results
in the Qt Creator directory
no configuration files found
found .pdb and .lib files which likely only means they were built using this version of Visual Studio
in C:\Program Files (x86)\Microsoft Visual Studio – no results
in C:\Program Files (x86)\Windows Kits – no results
After several unsuccessful guesses mentioned in the question, I succeeded to open, build and run my project after I issued
Build > Clear CMake Configuration
in the menu of Qt Creator.

Clang C2 on Visual studio 15.5 bool_constant<__is_trivially_destructible(_Ty)> error : '_Ty' does not refer to a value

I am trying to re-compile a hello world using Clang_C2 compiler on Visual studio 15.5 (latest).
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.12.25827\include\type_traits(899,2): error : expected class name
1> { // determine whether _Ty has a trivial destructor
In file included from ..\hello_boost_exception\hello_boost_exception.cpp:11:
1>In file included from I:\modular-boost\boost/config.hpp:48:
1>In file included from I:\modular-boost\boost/config/stdlib/dinkumware.hpp:98:
1>In file included from C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.12.25827\include\typeinfo:22:
1>In file included from C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.12.25827\include\exception:7:
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.12.25827\include\type_traits(898,47):
This looks as though I have some missing or incorrect library but I can't see what.
I have try various compiler versions C++14 (-std=c++1y) and library -stdlib=libc++ (should it use dinkumware version of type_traits?) but the error persists.
Suggestions most welcome.
Paul

Cordova app Build is failing in visual studio

I am not able to build cordova app in Visual studio. i have installed cordova extensions for my visual studio
In VS console it just displaying build is failed but no errors.
------ Build started: Project: SampleCordovaUsingCTP, Configuration: Debug Android ------
1>C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\TypeScript\Microsoft.TypeScript.targets(95,5): warning : The TypeScript Compiler was given no files for compilation, so it will skip compiling.
1> GeneratedJavascript=
1> C:\PhonegapSamples\SampleCordovaUsingCTP\SampleCordovaUsingCTP\SampleCordovaUsingCTP>call "C:\Program Files\nodejs\"\nodevars.bat
1> Your environment has been set up for using Node.js 0.10.29 (x64) and npm.
1> ------ Ensuring correct global installation of package from source package directory: C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO 12.0\COMMON7\IDE\EXTENSIONS\R3EFQQ33.L3R\packages\vs-mda
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Missing standard C libraries in cl

I have a Windows project that came with a Makefile.vc. I would like to import this into Visual Studio 10.0. My initial effort is to run nmake and invoke the cl.exe compiler.
After getting some paths straights my first run generates this message:
cl /nologo /W3 /O1 -I..\./ -I..\charset/ -I..\windows/ -I..\unix/ -I..\macosx/ /D_WINDOWS /D_WIN32_WINDOWS=0x500 /DWINVER=0x500 /DHAS_GSSAPI /DSECURITY
_WIN32 /c ..\be_all_s.c
be_all_s.c
..\be_all_s.c(6) : fatal error C1083: Cannot open include file: 'stdio.h': No such file or directory
NMAKE : fatal error U1077: '"c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\cl.EXE"' : return code '0x2'
Stop.
Now I know where the VC stdio.h header is, on my PC it's at C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include. So it would be a simple matter to add a -I to the makefile and include this directory.
But durn burn it I don't think I should have to! Other build systems don't make me do this and why doesn't the command line compiler know where its standard headers are installed? So I'm asking if there's a config file, an .ini file or something else that cl reads that tells it where to look for the standard C library. I've been browsing the internet and Visual Studio help with no success.
Just after I posted the question I found the answer.
Start > All Programs > Microsoft Visual 10.0 > Microsoft Visual Studio Tools > Visual Studio Command Prompt
This gives me a command prompt with all the paths, env. variables etc. set.
Why didn't I find that earlier?

Building with Visual Studio 2010, MFC, and FFmpeg

I'm working on building a Windows MFC application in Visual Studio 2010 using FFmpeg and SDL. However, I can't get the project to build after creating an MFC project from scratch and including the FFmpeg development libraries (avcodec.lib, avdevice.lib, avformat.lib, etc.). I'm using the development build from Zeranoe FFmpeg. I have configured the following in the Project Properties:
Set VC++ Directories -> Include Directories (added the FFmpeg "include" directories)
Set VC++ Directories -> Library Directories (to the FFmpeg "lib" directory)
Set Linker -> Input -> Additional Dependencies (to include avcodec.lib, etc.)
For what it's worth, the build succeeds when I omit FFmpeg's "include\libavutil" include from the VC++ Directories -> Include Directories.
Below are some of the first build errors I'm receiving (I won't post all, since it's long). Any help would be appreciated.
ClCompile:
stdafx.cpp
c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\atltime.h(371): error C3861: '_mktime64': identifier not found
c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\atltime.h(386): error C3861: '_localtime64_s': identifier not found
c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\atltime.h(409): error C3861: '_gmtime64_s': identifier not found
c:\program files\microsoft sdks\windows\v7.0a\include\intsafe.h(144): warning C4005: 'INT8_MIN' : macro redefinition
c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxtaskspane.h(279): error C2146: syntax error : missing ';' before identifier 'm_nLastAnimTime'
c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxribboncategory.h(282): error C2146: syntax error : missing ';' before identifier 'm_ActiveTime'
c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxdockingmanager.h(353): error C2146: syntax error : missing ';' before identifier 'm_clkLastTime'
Build FAILED.
I've referenced both of these articles, which were of help:
Visual Studio and libavcodec
Visual Studio and SDL
I think what you did is this. When you did your first 2 steps
Set VC++ Directories -> Include Directories (added the FFmpeg
"include" directories)
Set VC++ Directories -> Library Directories
(to the FFmpeg "lib" directory)
You have included them at the top of the list before MFC and ATL paths. Please move them to the bottom of the list using the up/down buttons. This should solve the problem
Have a look at Use FFmpeg in Visual Studio - it has a link to small Visual Studio 2010 project that builds against Zeranoe binaries.
Note that you need a inttypes.h file to succeed in building.
Your log shows issues with stdafx.cpp and this means that you have either search paths set wrong, or something is wrong in stdafx.h. Putting FFmpeg directories on top of search list might work out, however it might equally well break building for MFC part. I would rather have them on the bottom of the list, however the code itself should have the correct order of explicit #includes.

Resources