编译UTF-8带单向code线分隔符codeD音源 [英] Compiling UTF-8 encoded source with Unicode line separators

查看:164
本文介绍了编译UTF-8带单向code线分隔符codeD音源的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用最新版本的Microsoft编译器(包含在Win7的SDK),我试图编译源文件使用的是EN codeD UTF-8与UNI code线分隔符。

Using the latest version of the Microsoft Compiler (included with the Win7 SDK), I'm attempting to compile a source file that's encoded using UTF-8 with unicode line separators.

不幸的是,code将无法编译 - 即使我包括在文件开头的UTF-8签名。例如,如果我尝试编译如下:

Unfortunately, the code will not compile -- even if I include the UTF-8 signature at the start of the file. For example, if I try to compile this:

#include <stdio.h>

int main (void)
{
    printf("Hello!");
    return 0;
}

我会看到以下错误:

I'll see the following error:


提示>的cl test.c的

Prompt> cl test.c

微软(R)32位C / C ++优化编译器版本为15.00.30729.01的80x86
版权所有(C)微软公司。保留所有权利。

Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 15.00.30729.01 for 80x86 Copyright (C) Microsoft Corporation. All rights reserved.

test.c的
test.c以(1):警告C4067:意外的标记以下preprocessor指令 -
预计一个换行符
微软(R)增量链接器版本9.00.30729.01
版权所有(C)微软公司。保留所有权利。

test.c test.c(1) : warning C4067: unexpected tokens following preprocessor directive - expected a newline Microsoft (R) Incremental Linker Version 9.00.30729.01 Copyright (C) Microsoft Corporation. All rights reserved.

/out:test.exe
test.obj
LINK:致命错误LNK1561:入口点必须定义

/out:test.exe test.obj LINK : fatal error LNK1561: entry point must be defined


有没有人遇到过这个问题吗?任何解决方案?

Has anyone encountered this problem before? Any solutions?

谢谢!
安德鲁

Thanks! Andrew

推荐答案

您是指的这个人物,相对于传统的CR LF字符。

Are you're referring to this character, as opposed to the traditional CR LF characters.

我猜编译期待CR和LF的组合而已。

I'd guess that the compiler is expecting some combination of CR and LF only.

这篇关于编译UTF-8带单向code线分隔符codeD音源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆