我正在開發使用某些標準C++庫的Portable Native Client應用程序,例如iostream和fstream。當我包括這些標題,並嘗試與Visual Studio編譯該項目2012 Pro中,許多錯誤拋出:PNaCl - 編譯錯誤「僅支持Win32目標」
根據本機客戶端的文檔,有可能在PNaCl項目中使用C++標準庫。 有沒有人遇到過這個問題或知道如何解決它?
編輯:
@rubenvb:我不認爲我是一種編譯64 ..我的目標配置調試\ PNaCl。
@JF Bastien:我使用SDK附帶的編譯器。編譯器調用:
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
下面是錯誤的文本版本:
1>------ Build started: Project: decompressor_prototype, Configuration: Debug PNaCl ------
1>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>C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\crtdefs.h(44,2): error : ERROR: Only Win32 target supported!
1>NACLCOMPILE : #error error : Only Win32 target supported!
1>C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\vadefs.h(19,2): error : ERROR: Only Win32 target supported!
1>NACLCOMPILE : #error error : Only Win32 target supported!
1>C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\crtdefs.h(470,18): error : 'short wchar_t' is invalid
1>C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\crtdefs.h(470,1): warning : typedef requires a name [-Wmissing-declarations]
1>C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\crtdefs.h(506,9): error : unknown type name '__int64'
1>C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\yvals.h(509,9): error : unknown type name '__int64'
1>C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\yvals.h(510,19): error : expected ';' after top level declarator
1>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>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>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>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>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>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>C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\stdlib.h(445,40): error : expected ';' after top level declarator
1>C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\stdlib.h(445,88): error : expected ')'
1>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>C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\stdlib.h(471,77): error : expected ')'
1>C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\stdlib.h(472,91): error : expected ')'
1>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>C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\stdlib.h(477,40): error : expected ';' after top level declarator
1>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>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>C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\stdlib.h(478,40): error : expected ';' after top level declarator
1>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>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>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>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>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>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>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>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>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>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>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>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>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>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>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>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>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>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>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>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>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>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>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>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>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>C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\stdlib.h(713,77): error : expected ')'
1>NACLCOMPILE : fatal error : too many errors emitted, stopping now [-ferror-limit=]
========== Build: 0 succeeded, 1 failed, 1 up-to-date, 0 skipped ==========
刪除VisualStudio特定的包含程序確實解決了問題。 IntelliSense抱怨缺少類型,但正在編譯。謝謝你的幫助 :) – Signum 2015-02-12 09:43:18