使用 MSVC 将 C 源文件编译为 C++ [英] Compile as C source file as C++ using MSVC

查看:48
本文介绍了使用 MSVC 将 C 源文件编译为 C++的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在处理 C++ 项目.由于一些错误,我建议设置 Properties > C/C++ > Advanced > Compile As 并检查 Compile as C++ Code(/TP).

I'm working on C++ project. Because of some errors I got recommendation to set Properties > C/C++ > Advanced > Compile As and check Compile as C++ Code(/TP).

我的项目包含扩展名为C"的 iniparser.c.我想知道我的新设置(C++)是否会影响我的项目的编译,因为它包含一个 .c 文件(iniparser.c)?

My project includes iniparser.c that has extension "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)?

推荐答案

您的问题似乎与此问题重复:

Your question seems to be a possible duplicate of this one:

我在编译 C 时会遇到什么问题使用 C++ 编译器编写代码?

在不知道问题细节的情况下,使用 C++ 编译器编译 C 代码时必须考虑许多问题.有关更多详细信息,请参阅此链接:http://david.tribble.com/text/cdiffs.htm

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. See this link for more details: http://david.tribble.com/text/cdiffs.htm

这篇关于使用 MSVC 将 C 源文件编译为 C++的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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