简体   繁体   English

使用MSVC作为C ++编译为C源文件

[英]Compile as C source file as C++ using MSVC

I'm working on C++ project. 我正在从事C ++项目。 Because of some errors I got recommendation to set Properties > C/C++ > Advanced > Compile As and check Compile as C++ Code(/TP) . 由于某些错误,我建议您设置“ Properties >“ C/C++ >“ Advanced >“ Compile As 然后选中“ Compile as C++ Code(/TP)

My project includes iniparser.c that has extension "C". 我的项目包括扩展名为“ C”的iniparser.c。 What I want to know is whether my new settings (C++) can affect the compilation of my project, given that it contains a .c file (iniparser.c)? 我想知道的是,鉴于新设置(C ++)包含.c文件(iniparser.c),它是否会影响项目的编译?

Your question seems to be a possible duplicate of this one: 您的问题似乎是这个问题的重复:

What issues can I expect compiling C code with a C++ compiler? 我可以期待使用C ++编译器编译C代码有哪些问题?

Without knowing the details of your problem, there a number of issues that have to be considered when compiling C code with a C++ compiler. 在不了解问题细节的情况下,使用C ++编译器编译C代码时,必须考虑许多问题。 See this link for more details: http://david.tribble.com/text/cdiffs.htm 有关更多详细信息,请参见此链接: http : //david.tribble.com/text/cdiffs.htm

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM