我是一名程序员。我在Linux using GCC
中编写了C代码,它们可以正常运行。现在,我想使用Visual studio 2015
在Windows系统中运行这些代码。但是它总是显示一些错误和警告,如下所示:
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中创建的新文件中时,不做任何其他更改。它可以正常运行。但是我的项目包含许多文件,因此我不这样做来解决此问题。 我想通过做一些工作来解决它。
VS2015在Windows中创建的文件格式为:
$ file testtypes.h
testtypes.h: C source, ISO-8859 text
在Linux中通过touch创建的文件格式为:
$ file filetest.c
filetest.c: UTF-8 Unicode text
我该怎么办?