title: PNaCl - compilation error "Only Win32 target supported"
body: <p>I'm developing Portable Native Client application which uses some of the standard C++ libraries e.g. iostream and fstream. When I include these headers, and try to compile the project with Visual Studio 2012 Pro, many errors are thrown:</p>
  
  <p><img src="https://i.stack.imgur.com/XKLQb.png" alt="enter image description here"></p>
  
  <p>According to Native Client documentation, it is possible to use standard C++ library in PNaCl project.
  Has anyone encountered this problem before or knows how to resolve it?</p>
  
  <p>EDIT:</p>
  
  <p>@rubenvb: I don't think I am compiling for x64.. My target configuration is Debug\PNaCl.</p>
  
  <p>@JF Bastien: I am using compiler that comes with SDK. The compiler invocation:</p>
  
  <pre><code>  C:\nacl_sdk\pepper_39\toolchain\win_pnacl\bin\pnacl-clang.bat -o PNaCl/newlib/Debug/decompressor_prototype.obj -DNACL -ID:/dev/hello_nacl_cpp/charls -I"C:/Program Files (x86)/Microsoft Visual Studio 11.0/VC/include" -Iinclude -Iatlmfc/include -IC:/nacl_sdk/pepper_39/toolchain/win_pnacl/usr/local/include -IC:/nacl_sdk/pepper_39/toolchain/win_pnacl/usr/include -IC:/nacl_sdk/pepper_39/toolchain/win_pnacl//lib/clang/3.4/include -IC:/nacl_sdk/pepper_39/include -fexceptions -MMD -g -O0 -c decompressor_prototype.cpp
  </code></pre>
  
  <p>Here is textual version of the errors:</p>
  
  <pre><code>1&gt;------ Build started: Project: decompressor_prototype, Configuration: Debug PNaCl ------
  1&gt;C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.CppBuild.targets(343,5): warning MSB8003: Could not find VCInstallDir variable from the registry.  TargetFrameworkVersion or PlatformToolset may be set to an invalid version number.
  1&gt;C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\crtdefs.h(44,2): error : ERROR: Only Win32 target supported!
  1&gt;NACLCOMPILE : #error error : Only Win32 target supported!
  1&gt;C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\vadefs.h(19,2): error : ERROR: Only Win32 target supported!
  1&gt;NACLCOMPILE : #error error : Only Win32 target supported!
  1&gt;C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\crtdefs.h(470,18): error : 'short wchar_t' is invalid
  1&gt;C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\crtdefs.h(470,1): warning : typedef requires a name [-Wmissing-declarations]
  1&gt;C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\crtdefs.h(506,9): error : unknown type name '__int64'
  1&gt;C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\yvals.h(509,9): error : unknown type name '__int64'
  1&gt;C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\yvals.h(510,19): error : expected ';' after top level declarator
  1&gt;C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\yvals.h(575,2): warning : calling convention '__thiscall' ignored for this target [-Wignored-attributes]
  1&gt;C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\yvals.h(576,11): warning : calling convention '__thiscall' ignored for this target [-Wignored-attributes]
  1&gt;C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\yvals.h(577,2): warning : calling convention '__thiscall' ignored for this target [-Wignored-attributes]
  1&gt;C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\yvals.h(709,5): warning : calling convention '__thiscall' ignored for this target [-Wignored-attributes]
  1&gt;C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\yvals.h(710,2): warning : calling convention '__thiscall' ignored for this target [-Wignored-attributes]
  1&gt;C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\stdlib.h(445,33): error : redefinition of '__int64' as different kind of symbol
  1&gt;C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\stdlib.h(445,40): error : expected ';' after top level declarator
  1&gt;C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\stdlib.h(445,88): error : expected ')'
  1&gt;C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\stdlib.h(445,49): error : C++ requires a type specifier for all declarations
  1&gt;C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\stdlib.h(471,77): error : expected ')'
  1&gt;C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\stdlib.h(472,91): error : expected ')'
  1&gt;C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\stdlib.h(477,33): error : redefinition of '__int64' as different kind of symbol
  1&gt;C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\stdlib.h(477,40): error : expected ';' after top level declarator
  1&gt;C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\stdlib.h(477,49): error : C++ requires a type specifier for all declarations
  1&gt;C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\stdlib.h(478,33): error : redefinition of '__int64' as different kind of symbol
  1&gt;C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\stdlib.h(478,40): error : expected ';' after top level declarator
  1&gt;C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\stdlib.h(478,49): error : C++ requires a type specifier for all declarations
  1&gt;C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\stdlib.h(619,111): warning : __declspec attribute 'restrict' is not supported [-Wignored-attributes]
  1&gt;C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\stdlib.h(619,99): warning : __declspec attribute 'noalias' is not supported [-Wignored-attributes]
  1&gt;C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\stdlib.h(620,29): warning : __declspec attribute 'noalias' is not supported [-Wignored-attributes]
  1&gt;C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\stdlib.h(620,29): warning : __declspec attribute 'noalias' is not supported [-Wignored-attributes]
  1&gt;C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\stdlib.h(621,104): warning : __declspec attribute 'restrict' is not supported [-Wignored-attributes]
  1&gt;C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\stdlib.h(621,92): warning : __declspec attribute 'noalias' is not supported [-Wignored-attributes]
  1&gt;C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\stdlib.h(623,88): warning : __declspec attribute 'restrict' is not supported [-Wignored-attributes]
  1&gt;C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\stdlib.h(623,76): warning : __declspec attribute 'noalias' is not supported [-Wignored-attributes]
  1&gt;C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\stdlib.h(625,92): warning : __declspec attribute 'restrict' is not supported [-Wignored-attributes]
  1&gt;C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\stdlib.h(625,80): warning : __declspec attribute 'noalias' is not supported [-Wignored-attributes]
  1&gt;C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\stdlib.h(626,29): warning : __declspec attribute 'noalias' is not supported [-Wignored-attributes]
  1&gt;C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\stdlib.h(626,29): warning : __declspec attribute 'noalias' is not supported [-Wignored-attributes]
  1&gt;C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\stdlib.h(627,85): warning : __declspec attribute 'restrict' is not supported [-Wignored-attributes]
  1&gt;C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\stdlib.h(627,73): warning : __declspec attribute 'noalias' is not supported [-Wignored-attributes]
  1&gt;C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\stdlib.h(628,85): warning : __declspec attribute 'restrict' is not supported [-Wignored-attributes]
  1&gt;C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\stdlib.h(628,73): warning : __declspec attribute 'noalias' is not supported [-Wignored-attributes]
  1&gt;C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\stdlib.h(630,88): warning : __declspec attribute 'restrict' is not supported [-Wignored-attributes]
  1&gt;C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\stdlib.h(630,76): warning : __declspec attribute 'noalias' is not supported [-Wignored-attributes]
  1&gt;C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\stdlib.h(632,92): warning : __declspec attribute 'restrict' is not supported [-Wignored-attributes]
  1&gt;C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\stdlib.h(632,80): warning : __declspec attribute 'noalias' is not supported [-Wignored-attributes]
  1&gt;C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\stdlib.h(634,88): warning : __declspec attribute 'restrict' is not supported [-Wignored-attributes]
  1&gt;C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\stdlib.h(634,76): warning : __declspec attribute 'noalias' is not supported [-Wignored-attributes]
  1&gt;C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\stdlib.h(636,92): warning : __declspec attribute 'restrict' is not supported [-Wignored-attributes]
  1&gt;C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\stdlib.h(636,80): warning : __declspec attribute 'noalias' is not supported [-Wignored-attributes]
  1&gt;C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\stdlib.h(713,77): error : expected ')'
  1&gt;NACLCOMPILE : fatal error : too many errors emitted, stopping now [-ferror-limit=]
  ========== Build: 0 succeeded, 1 failed, 1 up-to-date, 0 skipped ==========
  </code></pre>