I am trying to migrate my source from VS2010 to VS2013. It is giving me sleepless nights. I'm getting the below attached compilation error. Please help me out in identifying which compilation switch I'm missing out. I have saved my .sln file from VS2013 to get it adapted to the new environment.
My current compilation settings are as follows:
PlatformToolset: Visual Studio 2013 - Windows XP (v120_xp)
Command Line:
/Yu"stdafx.h" /FR"DebugU\" /GS /TP /analyze- /W3 /Zc:wchar_t /I"..\Common" /Zi /Gm- /Od /Fd".\DebugU/" /fp:precise /D "_PUGIXML" /D "_DEBUG" /D "_USRDLL" /D "_CRT_SECURE_NO_WARNINGS" /D "_BIND_TO_CURRENT_VCLIBS_VERSION" /D "_VC80_UPGRADE=0x0700" /D "_USING_V110_SDK71_" /D "_WINDLL" /D "_UNICODE" /D "UNICODE" /errorReport:prompt /WX /Zc:forScope /RTC1 /Gd /Oy- /showIncludes /MTd /Fa".\DebugU/" /EHsc /nologo /Fo".\DebugU/" /Fp".\DebugU/xxxxxxxx.pch"
Compilation Log with "ShowIncludes"
1> pugixml.cpp
1> Note: including file: d:\vistasonicpoc\common\pugixml.hpp
1> Note: including file: d:\vistasonicpoc\common\pugiconfig.hpp
1> Note: including file: C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\exception
1> Note: including file: C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xstddef
1> Note: including file: C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\cstddef
1> Note: including file: C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\yvals.h
1> Note: including file: C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xkeycheck.h
1> Note: including file: C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\crtdefs.h
1> Note: including file: C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\use_ansi.h
1> Note: including file: C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\initializer_list
1> Note: including file: C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xtr1common
1>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xtr1common(421): error C2159: more than one storage class specified
1> C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xtr1common(421) : see reference to class template instantiation 'std::_Has_result_type<_Ty>' being compiled
1>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xtr1common(421): error C3557: a function cannot have both a return type and a late-specified return type
1>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xtr1common(421): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xstddef(203): error C3557: a function cannot have both a return type and a late-specified return type
1>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xstddef(203): warning C4042: 'std::plus<void>::operator ()' : has bad storage class
1>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xstddef(203): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xstddef(218): error C3557: a function cannot have both a return type and a late-specified return type
1>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xstddef(218): warning C4042: 'std::minus<void>::operator ()' : has bad storage class
1>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xstddef(218): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xstddef(233): error C3557: a function cannot have both a return type and a late-specified return type
1>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xstddef(233): warning C4042: 'std::multiplies<void>::operator ()' : has bad storage class
1>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xstddef(233): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xstddef(248): error C3557: a function cannot have both a return type and a late-specified return type
1>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xstddef(248): warning C4042: 'std::equal_to<void>::operator ()' : has bad storage class
1>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xstddef(248): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xstddef(263): error C3557: a function cannot have both a return type and a late-specified return type
1>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xstddef(263): warning C4042: 'std::less<void>::operator ()' : has bad storage class
1>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xstddef(263): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
I had the same problem and found out that the flag /Zc:auto was set to /Zc:auto- and this was causing all the errors.
You don't seem to have it specified in the command line but it could help someone else having the same type of error.
Zc:auto
Related
I am trying to build cURL on Windows using the following line:
nmake vc-x64 mode=dll VC=10 MACHINE=x64
Now I have done this setup before building:
set PATH=C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\amd64;%PATH%
set INCLUDE="C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\include";"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include"
set LIB="C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\lib\amd64";"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\lib\amd64"
set LIBPATH="C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\lib\amd64"
set PATH="C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Bin\x64";%PATH%)
set INCLUDE="C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Include";%INCLUDE%
set LIB="C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Lib\x64";%LIB%
I get the following error:
rc /dDEBUGBUILD=0 /Fo ..\builds\libcurl-vc10-x64-release-dll-ipv6-sspi-w
inssl-obj-lib\libcurl.res ..\lib\libcurl.rc
Microsoft (R) Windows (R) Resource Compiler Version 6.1.7600.16385
Copyright (C) Microsoft Corporation. All rights reserved.
..\lib\libcurl.rc(22) : fatal error RC1015: cannot open include file 'winver.h'.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A
\Bin\x64\rc.EXE"' : return code '0x1'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 10.0
\VC\bin\amd64\nmake.EXE"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 10.0
\VC\bin\amd64\nmake.EXE"' : return code '0x2'
Stop.
It does not seem to find the file "winver.h" despite the fact that this file is in the directory "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Include", and that this directory is in my INCLUDE variable.
It looks like rc does not take in account the variable INCLUDE to find the include paths. Is there a way to add an include path for the rc command? Unless this is something completely different of course.
How do I avoid the unresolved external symbol _mainCRTStartup error when using the MSVC toolchain (ex: CL.EXE) from within an MSYS environment?
Details:
I started a "VS2013 x64 Native Tools Command Prompt" and the launched C:\msys64\msys2.exe from there.
In my MSYS session I get results like this:
user#host MSYS /c/libpostal/libpostal
$ "/c/Program Files (x86)/Microsoft Visual Studio 12.0/VC/bin/amd64/vcvars64.bat"
user#host MSYS /c/libpostal/libpostal
$ cl "-nologo" "conftest.c" "-link" "-SUBSYSTEM:CONSOLE"
conftest.c
LINK : error LNK2001: unresolved external symbol _mainCRTStartup
conftest.exe : fatal error LNK1120: 1 unresolved externals
user#host MSYS /c/libpostal/libpostal
$ cat conftest.c
/* confdefs.h */
#define PACKAGE_NAME "libpostal"
#define PACKAGE_TARNAME "libpostal"
#define PACKAGE_VERSION "1.0.0"
#define PACKAGE_STRING "libpostal 1.0.0"
#define PACKAGE_BUGREPORT ""
#define PACKAGE_URL ""
#define PACKAGE "libpostal"
#define VERSION "1.0.0"
/* end confdefs.h. */
int
main ()
{
;
return 0;
}
user#host MSYS /c/libpostal/libpostal
$ echo $PATH
/c/Program Files (x86)/Microsoft Visual Studio 12.0/VC/bin:/usr/local/bin:/usr/bin:/bin:/opt/bin:/c/Windows/System32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0/:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl
If I try to put the same "cl" command into the "VS2013 x64 Native Tools Command Prompt", I get the expected result instead:
C:\libpostal\libpostal>cl "-nologo" "conftest.c" "-link" "-SUBSYSTEM:CONSOLE"
conftest.c
C:\libpostal\libpostal>cl "/nologo" "conftest.c" "/link" "/SUBSYSTEM:CONSOLE"
conftest.c
C:\libpostal\libpostal>conftest.exe
C:\libpostal\libpostal>echo %PATH%
C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow;C:\Program Files (x86)\MSBuild\12.0\bin\amd64;C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\BIN\amd64;C:\Windows\Microsoft.NET\Framework64\v4.0.30319;C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\VCPackages;C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE;C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools;C:\Program Files (x86)\HTML Help Workshop;C:\Program Files (x86)\Microsoft Visual Studio 12.0\Team Tools\Performance Tools\x64;C:\Program Files (x86)\Microsoft Visual Studio 12.0\Team Tools\Performance Tools;C:\Program Files (x86)\Windows Kits\8.1\bin\x64;C:\Program Files (x86)\Windows Kits\8.1\bin\x86;C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools\x64\;C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow;C:\Program Files (x86)\MSBuild\12.0\bin\amd64;C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\BIN\amd64;C:\Windows\Microsoft.NET\Framework64\v4.0.30319;C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\VCPackages;C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE;C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools;C:\Program Files (x86)\HTML Help Workshop;C:\Program Files (x86)\Microsoft Visual Studio 12.0\Team Tools\Performance Tools\x64;C:\Program Files (x86)\Microsoft Visual Studio 12.0\Team Tools\Performance Tools;C:\Program Files (x86)\Windows Kits\8.1\bin\x64;C:\Program Files (x86)\WindowsKits\8.1\bin\x86;C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools\x64\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Microsoft Dynamics AX\60\Client\Bin\;C:\Program Files\Microsoft Dynamics AX\60\BusinessConnector\Bin\;C:\Program Files (x86)\Microsoft SQL Server\Client SDK\ODBC\110\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\120\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn\ManagementStudio\;C:\Program Files\Microsoft\Web Platform Installer\;C:\Program Files(x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0\;C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files\Git\cmd;C:\D\dmd2\windows\bin;C:\msys64;C:\msys64\usr\local\bin;C:\msys64\usr\bin;C:\msys64\bin;C:\msys64\opt\bin
This happened while I was trying to use cccl to build a posix project (libpostal) using the MSVC toolchain so I can link it with other MSVC code. As such, any answers involving Visual Studio GUI will probably not be very helpful: I need to figure out how to make it work from within the MSYS2/MSYS64 environment.
In the MSYS example I intentionally moved /c/Program Files (x86)/Microsoft Visual Studio 12.0/VC/bin to the beginning of my $PATH to avoid selecting the wrong executables. I originally received the same results (exact same error message) when it was at the end of the $PATH instead.
After checking everything in agonizing detail, I found the problem:
When C:\msys64\msys2.exe is executed from the "VS2013 x64 Native Tools Command Prompt", the $PATH variable will end up containing /c/Program Files (x86)/Microsoft Visual Studio 12.0/VC/bin, but that is the wrong directory for 64-bit work. Instead the path should contain /c/Program Files (x86)/Microsoft Visual Studio 12.0/VC/bin/amd64. Once I did that substitution, cl.exe worked fine.
Running vcvars64.bat from within the MSYS environment will not fix the $PATH. The above substitution has to be done manually or from a custom startup script like ~/.bashrc.
I have installed prebuilt llvm + clang for windows 3.6.2, and Visual Studio 2015. Now in VS 2015, you can create projects and set compiler to clang. It seems the installation of clang has registered the compilers to the settings. Everything else works fine, except I cannot use and standard libraries.
The compiler setting for clang is LLVM-vs2014 under properties->general->platform tools
For instance, when compiling this code
#include <iostream>
int main(int argc, char ** argv) {
return 0; }
if I delete the #include line, everything works fine.
any idea?
The output message from VS is:
1>------ Build started: Project: TT, Configuration: Debug Win32 ------
1>clang-cl.exe : warning : argument unused during compilation: '/ZI'
1>clang-cl.exe : warning : argument unused during compilation: '/Gm'
1>clang-cl.exe : warning : argument unused during compilation: '/GS'
1>clang-cl.exe : warning : argument unused during compilation: '/fp:precise'
1>clang-cl.exe : warning : argument unused during compilation: '/FdDebug\vc140.pdb'
1> In file included from main.cpp:1:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\iostream:6:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\istream:6:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\ostream:6:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\ios:6:
1
> In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xlocnum:7:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath:656:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xtgmath.h:8:
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xtr1common(231,22): error : use of undeclared identifier 'char16_t'
1> struct _Is_integral<char16_t>
1> ^
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xtr1common(237,22): error : use of undeclared identifier 'char32_t'
1> struct _Is_integral<char32_t>
1> ^
1> In file included from main.cpp:1:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\iostream:6:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\istream:6:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\ostream:6:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\ios:6:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xlocnum:10:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\streambuf:6:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xiosbase:6:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xlocale:8:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\stdexcept:6:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\exception:7:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\type_traits:6:
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xstddef(408,14): error : use of undeclared identifier 'char16_t'
1> struct hash<char16_t>
1> ^
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xstddef(414,14): error : use of undeclared identifier 'char32_t'
1> struct hash<char32_t>
1> ^
1> In file included from main.cpp:1:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\iostream:6:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\istream:6:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\ostream:6:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\ios:6:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xlocnum:10:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\streambuf:6:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xiosbase:6:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xlocale:8:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\stdexcept:7:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xstring:6:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xmemory0:8:
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\limits(615,33): error : use of undeclared identifier 'char16_t'
1> template<> class numeric_limits<char16_t>
1> ^
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\limits(905,33): error : use of undeclared identifier 'char32_t'
1> template<> class numeric_limits<char32_t>
1> ^
1> In file included from main.cpp:1:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\iostream:6:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\istream:6:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\ostream:6:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\ios:6:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xlocnum:10:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\streambuf:6:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xiosbase:6:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xlocale:8:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\stdexcept:7:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xstring:6:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xmemory0:10:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xutility:8:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\utility:7:
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\iosfwd(267,21): error : use of undeclared identifier 'char16_t'
1> struct char_traits<char16_t>
1> ^
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\iosfwd(276,21): error : use of undeclared identifier 'char32_t'
1> struct char_traits<char32_t>
1> ^
1> In file included from main.cpp:1:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\iostream:6:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\istream:6:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\ostream:6:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\ios:6:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xlocnum:10:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\streambuf:6:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xiosbase:6:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xlocale:8:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\stdexcept:7:
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xstring(2623,22): error : use of undeclared identifier 'char16_t'
1> typedef basic_string<char16_t, char_traits<char16_t>, allocator<char16_t> >
1> ^
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xstring(2623,53): error : expected unqualified-id
1> typedef basic_string<char16_t, char_traits<char16_t>, allocator<char16_t> >
1> ^
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xstring(2625,22): error : use of undeclared identifier 'char32_t'
1> typedef basic_string<char32_t, char_traits<char32_t>, allocator<char32_t> >
1> ^
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xstring(2625,53): error : expected unqualified-id
1> typedef basic_string<char32_t, char_traits<char32_t>, allocator<char32_t> >
1> ^
1> In file included from main.cpp:1:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\iostream:6:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\istream:6:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\ostream:6:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\ios:6:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xlocnum:10:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\streambuf:6:
1> In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xiosbase:6:
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xlocale(1004,30): error : use of undeclared identifier 'char16_t'
1> class _CRTIMP2_PURE codecvt<char16_t, char, _Mbstatet>
1> ^
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xlocale(1328,30): error : use of undeclared identifier 'char32_t'
1> class _CRTIMP2_PURE codecvt<char32_t, char, _Mbstatet>
1> ^
1> 14 errors generated.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Clang 3.6 doesn't support the C++11 keywords char16_t and char32_t in Microsoft mode (see the source). However good news, 3.7 does and will be released in three weeks (August 21) according to the LLVM website. In the meanwhile you could install a 3.7 release candidate or a snapshot build.
Anything I try to npm install on windows that requires node-gyp explodes in errors. I tried reinstalling all the windows stuff suggested on the node-gyp github page.
Why am I getting these errors? This is an attempt to install mongodb
PS C:\Users\Farzher\Documents\Dev\nodejs\abc> npm install mongodb
npm WARN package.json prelude-ls-extended#0.0.0 No description
npm http GET https://registry.npmjs.org/mongodb
npm http 304 https://registry.npmjs.org/mongodb
npm http GET https://registry.npmjs.org/bson/0.2.5
npm http GET https://registry.npmjs.org/kerberos/0.0.3
npm http 304 https://registry.npmjs.org/bson/0.2.5
npm http 304 https://registry.npmjs.org/kerberos/0.0.3
> kerberos#0.0.3 install C:\Users\Farzher\node_modules\mongodb\node_modules\kerberos
> (node-gyp rebuild 2> builderror.log) || (exit 0)
C:\Users\Farzher\node_modules\mongodb\node_modules\kerberos>node "c:\Program Files\nodejs\node_modules\npm\bin\node-gyp-
bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
kerberos.cc
worker.cc
security_credentials.cc
security_buffer.cc
security_buffer_descriptor.cc
security_context.cc
c:\users\farzher\node_modules\mongodb\node_modules\kerberos\lib\win32\worker.h(17): error C2146: syntax error : missing
';' before identifier 'request' [C:\Users\Farzher\node_modules\mongodb\node_modules\kerberos\build\kerberos.vcxproj]
c:\users\farzher\node_modules\mongodb\node_modules\kerberos\lib\win32\worker.h(17): error C4430: missing type specifier
- int assumed. Note: C++ does not support default-int [C:\Users\Farzher\node_modules\mongodb\node_modules\kerberos\bui
ld\kerberos.vcxproj]
c:\users\farzher\node_modules\mongodb\node_modules\kerberos\lib\win32\worker.h(17): error C4430: missing type specifier
- int assumed. Note: C++ does not support default-int [C:\Users\Farzher\node_modules\mongodb\node_modules\kerberos\bui
ld\kerberos.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xlocale(323): warning C4530: C++ exception handler used,
but unwind semantics are not enabled. Specify /EHsc [C:\Users\Farzher\node_modules\mongodb\node_modules\kerberos\build
\kerberos.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xlocale(323): warning C4530: C++ exception handler used,
but unwind semantics are not enabled. Specify /EHsc [C:\Users\Farzher\node_modules\mongodb\node_modules\kerberos\build
\kerberos.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xlocale(323): warning C4530: C++ exception handler used,
but unwind semantics are not enabled. Specify /EHsc [C:\Users\Farzher\node_modules\mongodb\node_modules\kerberos\build
\kerberos.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xlocale(323): warning C4530: C++ exception handler used,
but unwind semantics are not enabled. Specify /EHsc [C:\Users\Farzher\node_modules\mongodb\node_modules\kerberos\build
\kerberos.vcxproj]
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\sspi.h(82): error C2146: syntax error : missing ';' before
identifier 'SEC_WCHAR' [C:\Users\Farzher\node_modules\mongodb\node_modules\kerberos\build\kerberos.vcxproj]
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\sspi.h(82): error C4430: missing type specifier - int assum
ed. Note: C++ does not support default-int [C:\Users\Farzher\node_modules\mongodb\node_modules\kerberos\build\kerberos.
vcxproj]
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\sspi.h(82): error C4430: missing type specifier - int assum
ed. Note: C++ does not support default-int [C:\Users\Farzher\node_modules\mongodb\node_modules\kerberos\build\kerberos.
vcxproj]
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\sspi.h(83): error C2146: syntax error : missing ';' before
identifier 'SEC_CHAR' [C:\Users\Farzher\node_modules\mongodb\node_modules\kerberos\build\kerberos.vcxproj]
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\sspi.h(83): error C4430: missing type specifier - int assum
ed. Note: C++ does not support default-int [C:\Users\Farzher\node_modules\mongodb\node_modules\kerberos\build\kerberos.
vcxproj]
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\sspi.h(83): error C4430: missing type specifier - int assum
ed. Note: C++ does not support default-int [C:\Users\Farzher\node_modules\mongodb\node_modules\kerberos\build\kerberos.
vcxproj]
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\sspi.h(86): error C2146: syntax error : missing ';' before
identifier 'SECURITY_STATUS' [C:\Users\Farzher\node_modules\mongodb\node_modules\kerberos\build\kerberos.vcxproj]
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\sspi.h(86): error C4430: missing type specifier - int assum
ed. Note: C++ does not support default-int [C:\Users\Farzher\node_modules\mongodb\node_modules\kerberos\build\kerberos.
vcxproj]
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\sspi.h(86): error C4430: missing type specifier - int assum
ed. Note: C++ does not support default-int [C:\Users\Farzher\node_modules\mongodb\node_modules\kerberos\build\kerberos.
vcxproj]
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\sspi.h(105): error C2143: syntax error : missing ';' before
'*' [C:\Users\Farzher\node_modules\mongodb\node_modules\kerberos\build\kerberos.vcxproj]
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\sspi.h(105): error C4430: missing type specifier - int assu
med. Note: C++ does not support default-int [C:\Users\Farzher\node_modules\mongodb\node_modules\kerberos\build\kerberos
.vcxproj]
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\sspi.h(105): error C2378: 'SEC_CHAR' : redefinition; symbol
cannot be overloaded with a typedef [C:\Users\Farzher\node_modules\mongodb\node_modules\kerberos\build\kerberos.vcxpro
You need Python on your machine for gyp to work, AFAIK.
This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.
Closed 9 years ago.
i've got to do a bit of pure ANSI C and i'm trying to do it in Visual Studio 2010. Problem is; regardless of setting the compiler to pure C and flipping the \Za compiler switch to disable windows extensions - the code just won't compile:
#define _USE_MATH_DEFINES
#include <iostream>
#include <math.h>
using namespace std;
int main()
{
cout << M_PI;
return 0;
}
This is in a file called Test.c - there are no precompiled headers and everything should be fine, but this is what the compiler spits out:
1>ClCompile:
1> Test.c
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(19): error C2061: syntax error : identifier 'acosf'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(19): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(19): error C2061: syntax error : identifier 'asinf'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(19): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(20): error C2061: syntax error : identifier 'atanf'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(20): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(20): error C2061: syntax error : identifier 'atan2f'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(20): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(20): error C2061: syntax error : identifier 'ceilf'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(20): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(21): error C2061: syntax error : identifier 'cosf'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(21): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(21): error C2061: syntax error : identifier 'coshf'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(21): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(21): error C2061: syntax error : identifier 'expf'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(21): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(22): error C2061: syntax error : identifier 'fabsf'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(22): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(22): error C2061: syntax error : identifier 'floorf'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(22): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(22): error C2061: syntax error : identifier 'fmodf'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(22): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(23): error C2061: syntax error : identifier 'frexpf'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(23): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(23): error C2061: syntax error : identifier 'ldexpf'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(23): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(23): error C2061: syntax error : identifier 'logf'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(23): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(24): error C2061: syntax error : identifier 'log10f'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(24): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(24): error C2061: syntax error : identifier 'modff'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(24): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(24): error C2061: syntax error : identifier 'powf'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(24): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(25): error C2061: syntax error : identifier 'sinf'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(25): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(25): error C2061: syntax error : identifier 'sinhf'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(25): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(25): error C2061: syntax error : identifier 'sqrtf'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(25): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(26): error C2061: syntax error : identifier 'tanf'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(26): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(26): error C2061: syntax error : identifier 'tanhf'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(26): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(28): error C2061: syntax error : identifier 'acosl'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(28): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(28): error C2061: syntax error : identifier 'asinl'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(28): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(29): error C2061: syntax error : identifier 'atanl'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(29): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(29): error C2061: syntax error : identifier 'atan2l'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(29): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(29): error C2061: syntax error : identifier 'ceill'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(29): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(30): error C2061: syntax error : identifier 'cosl'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(30): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(30): error C2061: syntax error : identifier 'coshl'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(30): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(30): error C2061: syntax error : identifier 'expl'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(30): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(31): error C2061: syntax error : identifier 'fabsl'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(31): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(31): error C2061: syntax error : identifier 'floorl'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(31): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(31): error C2061: syntax error : identifier 'fmodl'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(31): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(32): error C2061: syntax error : identifier 'frexpl'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(32): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(32): error C2061: syntax error : identifier 'ldexpl'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(32): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(32): error C2061: syntax error : identifier 'logl'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(32): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(33): error C2061: syntax error : identifier 'log10l'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(33): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(33): error C2061: syntax error : identifier 'modfl'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(33): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(33): error C2061: syntax error : identifier 'powl'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(33): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(34): error C2061: syntax error : identifier 'sinl'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(34): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(34): error C2061: syntax error : identifier 'sinhl'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(34): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(34): error C2061: syntax error : identifier 'sqrtl'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(34): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(35): error C2061: syntax error : identifier 'tanl'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(35): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(35): error C2061: syntax error : identifier 'tanhl'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(35): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(37): error C2061: syntax error : identifier 'abs'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(37): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(39): error C2061: syntax error : identifier 'acos'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(39): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(39): error C2061: syntax error : identifier 'asin'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(39): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(40): error C2061: syntax error : identifier 'atan'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(40): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(40): error C2061: syntax error : identifier 'atan2'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(40): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(40): error C2061: syntax error : identifier 'ceil'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(40): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(41): error C2061: syntax error : identifier 'cos'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(41): fatal error C1003: error count exceeds 100; stopping compilation
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:00.17
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
I'm not that experienced with VS and C, but i've looked around and nothing I do seems to work. I'm guessing it'll be something silly. Thanks in advance
(Note: this same error occurs with absolutely no references to any math libraries)