Skip to content
This repository has been archived by the owner on Nov 1, 2020. It is now read-only.

Compiling source to native code failed on Windows 7 Chinese version #6770

Closed
hzexe opened this issue Jan 4, 2019 · 3 comments
Closed

Compiling source to native code failed on Windows 7 Chinese version #6770

hzexe opened this issue Jan 4, 2019 · 3 comments

Comments

@hzexe
Copy link

hzexe commented Jan 4, 2019

I have followed https://github.com/dotnet/corert/blob/master/Documentation/how-to-build-and-run-ilcompiler-in-console-shell-prompt.md
When execute

dotnet publish /p:NativeCodeGen=cpp -r win-x64

got the following output, it seems a problem with file encoding:

用于 .NET Core 的 Microsoft (R) 生成引擎版本 16.0.225-preview+g5ebeba52a1
版权所有(C) Microsoft Corporation。保留所有权利。

G:\test\pp.csproj(2,1): warning MSB4011: 无法再次导入“C:\Program Files\dotnet\sdk\3.0.100-preview-009812\Sdks\Microsoft.NET.Sdk\Sdk\Sdk.props”。可能已在“G:\test\pp.csproj”处导入过它。这很可能是生成创作错误。将忽略此后续导入。
G:\test\pp.csproj : warning MSB4011: 无法再次导入“C:\Program Files\dotnet\sdk\3.0.100-preview-009812\Sdks\Microsoft.NET.Sdk\Sdk\Sdk.targets”。可能已在“G:\test\pp.csproj (7,3)”处导入过它。这很可能是生成创作错误。将忽略此后续导入。
G:\test\pp.csproj(2,1): warning MSB4011: 无法再次导入“C:\Program Files\dotnet\sdk\3.0.100-preview-009812\Sdks\Microsoft.NET.Sdk\Sdk\Sdk.props”。可能已在“G:\test\pp.csproj”处导入过它。这很可能是生成创作错误。将忽略此后续导入。
G:\test\pp.csproj : warning MSB4011: 无法再次导入“C:\Program Files\dotnet\sdk\3.0.100-preview-009812\Sdks\Microsoft.NET.Sdk\Sdk\Sdk.targets”。可能已在“G:\test\pp.csproj (7,3)”处导入过它。这很可能是生成创作错误。将忽略此后续导入。
正在还原 G:\test\pp.csproj 的包...
正在生成 MSBuild 文件 G:\test\obj\pp.csproj.nuget.g.props。
正在生成 MSBuild 文件 G:\test\obj\pp.csproj.nuget.g.targets。
G:\test\pp.csproj 的还原在 196.83 ms 内完成。
G:\test\pp.csproj(2,1): warning MSB4011: 无法再次导入“C:\Program Files\dotnet\sdk\3.0.100-preview-009812\Sdks\Microsoft.NET.Sdk\Sdk\Sdk.props”。可能已在“G:\test\pp.csproj”处导入过它。这很可能是生成创作错误。将忽略此后续导入。
G:\test\pp.csproj : warning MSB4011: 无法再次导入“C:\Program Files\dotnet\sdk\3.0.100-preview-009812\Sdks\Microsoft.NET.Sdk\Sdk\Sdk.targets”。可能已在“G:\test\pp.csproj (7,3)”处导入过它。这很可能是生成创作错误。将忽略此后续导入。
C:\Program Files\dotnet\sdk\3.0.100-preview-009812\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.RuntimeIdentifierInference.targets(142,5): message NETSDK1057: 你正在使用 .NET Core SDK 的预览版。可通过当前项目中的 global.json 文件来定义 SDK 版本。详细信息请访问 https://go.microsoft.com/fwlink/?linkid=869452 [G:\test\pp.csproj]
pp -> G:\test\bin\Debug\netcoreapp3.0\win-x64\pp.dll
Generating native code
The method or operation is not implemented. ([S.P.CompilerGenerated]Internal.CompilerGenerated..InvokeRetO<Nullable`1>(object,native int,ArgSetupState&,bool))
pp.cpp
G:\test\Program.cs(7189): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 [G:\test\pp.csproj]
G:\test\Program.cs(7692): error C2001: 常量中有换行符 [G:\test\pp.csproj]
G:\test\Program.cs(7693): error C2064: 项不会计算为接受 1 个参数的函数 [G:\test\pp.csproj]
G:\test\Program.cs(7693): error C2143: 语法错误: 缺少“)”(在“;”的前面) [G:\test\pp.csproj]
E:\A_work\7\s\corefx\src\System.Console\src\System\Console.cs(3395): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 [G:\test\pp.csproj]
E:\A_work\7\s\corefx\src\System.Console\src\System\Console.cs(3643): error C2001: 常量中有换行符 [G:\test\pp.csproj]
E:\A_work\7\s\corefx\src\System.Console\src\System\Console.cs(3644): error C2064: 项不会计算为接受 1 个参数的函数 [G:\test\pp.csproj]
E:\A_work\7\s\corefx\src\System.Console\src\System\Console.cs(3644): error C2143: 语法错误: 缺少“)”(在“;”的前面) [G:\test\pp.csproj]
E:\A_work\7\s\corefx\src\System.Console\src\System\Console.cs(3885): error C2001: 常量中有换行符 [G:\test\pp.csproj]
E:\A_work\7\s\corefx\src\System.Console\src\System\Console.cs(3886): error C2144: 语法错误:“void”的前面应有“)” [G:\test\pp.csproj]
E:\A_work\7\s\corefx\src\System.Console\src\System\Console.cs(3886): error C2144: 语法错误:“void”的前面应有“;” [G:\test\pp.csproj]
E:\A_work\7\s\corefx\src\System.Console\src\System\Console.cs(3965): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 [G:\test\pp.csproj]
E:\A_work\7\s\corefx\src\System.Console\src\System\Console.cs(4113): error C2001: 常量中有换行符 [G:\test\pp.csproj]
E:\A_work\7\s\corefx\src\System.Console\src\System\Console.cs(4114): error C2144: 语法错误:“void”的前面应有“)” [G:\test\pp.csproj]
E:\A_work\7\s\corefx\src\System.Console\src\System\Console.cs(4114): error C2144: 语法错误:“void”的前面应有“;” [G:\test\pp.csproj]
E:\A_work\7\s\corefx\src\System.Console\src\System\Console.cs(15512): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 [G:\test\pp.csproj]
E:\A_work\7\s\corefx\src\System.Console\src\System\Console.cs(15979): error C2001: 常量中有换行符 [G:\test\pp.csproj]
E:\A_work\7\s\corefx\src\System.Console\src\System\Console.cs(15980): error C2064: 项不会计算为接受 1 个参数的函数 [G:\test\pp.csproj]
E:\A_work\7\s\corefx\src\System.Console\src\System\Console.cs(15980): error C2143: 语法错误: 缺少“)”(在“;”的前面) [G:\test\pp.csproj]
E:\A_work\7\s\corefx\src\System.Console\src\System\ConsolePal.Windows.cs(4094): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 [G:\test\pp.csproj]
E:\A_work\7\s\corefx\src\System.Console\src\System\ConsolePal.Windows.cs(4856): error C2001: 常量中有换行符 [G:\test\pp.csproj]
E:\A_work\7\s\corefx\src\System.Console\src\System\ConsolePal.Windows.cs(4857): error C2146: 语法错误: 缺少“)”(在标识符“int32_t”的前面) [G:\test\pp.csproj]
E:\A_work\7\s\corefx\src\System.Console\src\System\ConsolePal.Windows.cs(4857): error C2146: 语法错误: 缺少“;”(在标识符“int32_t”的前面) [G:\test\pp.csproj]
E:\A_work\7\s\corefx\src\System.Console\src\System\ConsolePal.Windows.cs(4898): error C2001: 常量中有换行符 [G:\test\pp.csproj]
E:\A_work\7\s\corefx\src\System.Console\src\System\ConsolePal.Windows.cs(4899): error C2146: 语法错误: 缺少“)”(在标识符“int32_t”的前面) [G:\test\pp.csproj]
E:\A_work\7\s\corefx\src\System.Console\src\System\ConsolePal.Windows.cs(4899): error C2146: 语法错误: 缺少“;”(在标识符“int32_t”的前面) [G:\test\pp.csproj]
E:\A_work\7\s\corefx\src\System.Console\src\System\ConsolePal.Windows.cs(4908): error C2001: 常量中有换行符 [G:\test\pp.csproj]
E:\A_work\7\s\corefx\src\System.Console\src\System\ConsolePal.Windows.cs(4909): error C2146: 语法错误: 缺少“)”(在标识符“int32_t”的前面) [G:\test\pp.csproj]
E:\A_work\7\s\corefx\src\System.Console\src\System\ConsolePal.Windows.cs(4909): error C2146: 语法错误: 缺少“;”(在标识符“int32_t”的前面) [G:\test\pp.csproj]
E:\A_work\7\s\corefx\src\System.Runtime.Extensions\src\System\OperatingSystem.cs(5238): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 [G:\test\pp.csproj]
E:\A_work\7\s\corefx\src\System.Runtime.Extensions\src\System\OperatingSystem.cs(5315): error C2001: 常量中有换行符 [G:\test\pp.csproj]
E:\A_work\7\s\corefx\src\System.Runtime.Extensions\src\System\OperatingSystem.cs(5316): error C2064: 项不会计算为接受 1 个参数的函数 [G:\test\pp.csproj]
E:\A_work\7\s\corefx\src\System.Runtime.Extensions\src\System\OperatingSystem.cs(5316): error C2143: 语法错误: 缺少“)”(在“;”的前面) [G:\test\pp.csproj]
E:\A_work\7\s\corefx\src\System.Runtime.Extensions\src\System\OperatingSystem.cs(5522): error C2001: 常量中有换行符 [G:\test\pp.csproj]
E:\A_work\7\s\corefx\src\System.Runtime.Extensions\src\System\OperatingSystem.cs(5523): error C2144: 语法错误:“void”的前面应有“)” [G:\test\pp.csproj]
E:\A_work\7\s\corefx\src\System.Runtime.Extensions\src\System\OperatingSystem.cs(5523): error C2144: 语法错误:“void”的前面应有“;” [G:\test\pp.csproj]
E:\A_work\7\s\corefx\src\System.Runtime.Extensions\src\System\OperatingSystem.cs(5530): error C2001: 常量中有换行符 [G:\test\pp.csproj]
E:\A_work\7\s\corefx\src\System.Runtime.Extensions\src\System\OperatingSystem.cs(5531): error C2144: 语法错误:“void”的前面应有“)” [G:\test\pp.csproj]
E:\A_work\7\s\corefx\src\System.Runtime.Extensions\src\System\OperatingSystem.cs(5531): error C2144: 语法错误:“void”的前面应有“;” [G:\test\pp.csproj]
E:\A_work\7\s\corefx\src\System.Runtime.Extensions\src\System\OperatingSystem.cs(5538): error C2001: 常量中有换行符 [G:\test\pp.csproj]
E:\A_work\7\s\corefx\src\System.Runtime.Extensions\src\System\OperatingSystem.cs(5539): error C2144: 语法错误:“void”的前面应有“)” [G:\test\pp.csproj]
E:\A_work\7\s\corefx\src\System.Runtime.Extensions\src\System\OperatingSystem.cs(5539): error C2144: 语法错误:“void”的前面应有“;” [G:\test\pp.csproj]
E:\A_work\7\s\corefx\src\System.Runtime.Extensions\src\System\OperatingSystem.cs(5546): error C2001: 常量中有换行符 [G:\test\pp.csproj]
E:\A_work\7\s\corefx\src\System.Runtime.Extensions\src\System\OperatingSystem.cs(5547): error C2144: 语法错误:“void”的前面应有“)” [G:\test\pp.csproj]
E:\A_work\7\s\corefx\src\System.Runtime.Extensions\src\System\OperatingSystem.cs(5547): error C2144: 语法错误:“void”的前面应有“;” [G:\test\pp.csproj]
E:\A_work\7\s\corefx\src\Common\src\System\Text\ConsoleEncoding.cs(12875): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 [G:\test\pp.csproj]
E:\A_work\7\s\corefx\artifacts\obj\System.Console\netcoreapp-Windows_NT-Release\System.SR.cs(7988): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 [G:\test\pp.csproj]
E:\A_work\7\s\corefx\artifacts\obj\System.Console\netcoreapp-Windows_NT-Release\System.SR.cs(8409): error C2001: 常量中有换行符 [G:\test\pp.csproj]
E:\A_work\7\s\corefx\artifacts\obj\System.Console\netcoreapp-Windows_NT-Release\System.SR.cs(8410): error C2144: 语法错误:“void”的前面应有“)” [G:\test\pp.csproj]
E:\A_work\7\s\corefx\artifacts\obj\System.Console\netcoreapp-Windows_NT-Release\System.SR.cs(8410): error C2144: 语法错误:“void”的前面应有“;” [G:\test\pp.csproj]
E:\A_work\7\s\corefx\artifacts\obj\System.Console\netcoreapp-Windows_NT-Release\System.SR.cs(8414): error C2001: 常量中有换行符 [G:\test\pp.csproj]
E:\A_work\7\s\corefx\artifacts\obj\System.Console\netcoreapp-Windows_NT-Release\System.SR.cs(8415): error C2144: 语法错误:“void”的前面应有“)” [G:\test\pp.csproj]
E:\A_work\7\s\corefx\artifacts\obj\System.Console\netcoreapp-Windows_NT-Release\System.SR.cs(8415): error C2144: 语法错误:“void”的前面应有“;” [G:\test\pp.csproj]
E:\A_work\7\s\corefx\artifacts\obj\System.Console\netcoreapp-Windows_NT-Release\System.SR.cs(9496): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 [G:\test\pp.csproj]
E:\A_work\7\s\corefx\src\Common\src\System\Text\ConsoleEncoding.cs(456): error C2001: 常量中有换行符 [G:\test\pp.csproj]
E:\A_work\7\s\corefx\src\Common\src\System\Text\ConsoleEncoding.cs(457): error C2144: 语法错误:“void”的前面应有“)” [G:\test\pp.csproj]
E:\A_work\7\s\corefx\src\Common\src\System\Text\ConsoleEncoding.cs(457): error C2144: 语法错误:“void”的前面应有“;” [G:\test\pp.csproj]
E:\A_work\7\s\corefx\src\Common\src\System\Text\ConsoleEncoding.cs(461): error C2001: 常量中有换行符 [G:\test\pp.csproj]
E:\A_work\7\s\corefx\src\Common\src\System\Text\ConsoleEncoding.cs(462): error C2144: 语法错误:“void”的前面应有“)” [G:\test\pp.csproj]
E:\A_work\7\s\corefx\src\Common\src\System\Text\ConsoleEncoding.cs(462): error C2144: 语法错误:“void”的前面应有“;” [G:\test\pp.csproj]
E:\A_work\7\s\corefx\src\Common\src\System\Text\OSEncoder.cs(822): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 [G:\test\pp.csproj]
E:\A_work\7\s\corefx\src\Common\src\System\Text\OSEncoder.cs(1762): error C2001: 常量中有换行符 [G:\test\pp.csproj]
E:\A_work\7\s\corefx\src\Common\src\System\Text\OSEncoder.cs(1763): error C2144: 语法错误:“void”的前面应有“)” [G:\test\pp.csproj]
E:\A_work\7\s\corefx\src\Common\src\System\Text\OSEncoder.cs(1763): error C2144: 语法错误:“void”的前面应有“;” [G:\test\pp.csproj]
E:\A_work\7\s\corefx\src\Common\src\System\Text\OSEncoder.cs(1767): error C2001: 常量中有换行符 [G:\test\pp.csproj]
E:\A_work\7\s\corefx\src\Common\src\System\Text\OSEncoder.cs(1768): error C2144: 语法错误:“void”的前面应有“)” [G:\test\pp.csproj]
E:\A_work\7\s\corefx\src\Common\src\System\Text\OSEncoder.cs(1768): error C2144: 语法错误:“void”的前面应有“;” [G:\test\pp.csproj]
C:\Users\hzexe.nuget\packages\runtime.win-x64.microsoft.dotnet.ilcompiler\1.0.0-alpha-27228-02\targets\Microsoft.NETCore.Native.targets(249,5): error MSB3073: 命令“cl @"obj\Debug\netcoreapp3.0\win-x64\native\cl.rsp"”已退出,代码为 2。 [G:\test\pp.csproj]

@hzexe hzexe closed this as completed Jan 4, 2019
@hzexe
Copy link
Author

hzexe commented Jan 4, 2019

This issues still exists, and I've checked test.csproj and Program.cs, whether they're Unicode or utf-8, the same mistake

@hzexe hzexe reopened this Jan 4, 2019
@jkotas
Copy link
Member

jkotas commented Jan 4, 2019

Looks like a dup of #663: The generated cpp file requires BOM header.

@cshung cshung self-assigned this Jan 11, 2019
@cshung
Copy link
Member

cshung commented Jan 12, 2019

Fixed with pull request #6814

@cshung cshung closed this as completed Jan 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants