0

我是电脑程序编制员。我在 Linux 中编写 C 代码using GCC,它们可以正常运行。现在,我想在 Windows 系统中使用Visual studio 2015. 但它总是显示一些错误和警告,如下所示:

1>f:\md\test_sm3_hmac_02\tools.h : warning C4819: The file contains a character that cannot be represented in the current code page (936). Save the file in Unicode format to prevent data loss
1>f:\md\test_sm3_hmac_02\types.h : warning C4819: The file contains a character that cannot be represented in the current code page (936). Save the file in Unicode format to prevent data loss
1>f:\md\test_sm3_hmac_02\tools.h(13): error C2143: syntax error: missing ')' before '*'
1>f:\md\test_sm3_hmac_02\tools.h(13): error C2143: syntax error: missing '{' before '*'

当我打开每个文件并将它们复制到在 Windows 中创建的新文件中并且不做任何其他更改时。它运行正确。但是我的项目包含很多文件,我这样做不是为了解决这个问题。我想通过做一些工作来解决它。

windows中VS2015创建的文件格式为:

$ file testtypes.h
testtypes.h: C source, ISO-8859 text

linux中touch创建的文件格式为:

$ file filetest.c
filetest.c: UTF-8 Unicode text

我能怎么做 ?

4

0 回答 0