c++ - 如何配置 Eclipse C 项目以接受 C++ 包含

标签 c++ c eclipse

我有一个 C 项目,我想在其中使用一些 C++ 文件。 我已经相应地修改了 Makefile,但我得到了

make\mingw32-make.exe[1]: *** No rule to make target 

错误。

我注意到没有找到 cpp 标准库中包含的 header 。

Headers Not Found . picture

[编辑] 请注意,所有 .c、.cpp、.h 文件都位于同一文件夹中。

如果我添加

#include <string>

在.c 文件中找到它。在 .cpp 中则不然。

在 Eclipse 中,我发现无法为 C++ 设置包含。

No C++ Includes . picture

有办法做到这一点吗?

谢谢。

最佳答案

不幸的是我没有找到解决这个问题的方法。 我仍然走在正确的道路上,因为有一种方法可以使用 Alglib 中的 C 代码。

http://forum.alglib.net/viewtopic.php?f=2&t=3766

It may be better to download CPython version of ALGLIB and to work with source of its computational core. It is written in C, without even trace amounts of C++, so you may find it more convenient than making wrappers around C++ core.

关于c++ - 如何配置 Eclipse C 项目以接受 C++ 包含,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38911816/

相关文章:

c++ - 在赋值运算符内制作浅拷贝

c++ - 在 QTreeView 中获取选中的元素

c++ - 转义(\)字符背后的魔法是什么

c++ - 奇怪的重复模板 - 变体

c++ - lambda 绑定(bind)问题?

C 程序仅在 Visual Studio 中的 Debug模式下,以编程方式更改 argv 在程序退出后会出现堆损坏错误。如何解决?

用于查找整数位数的 C 代码无法按照建议进行修改

java - 在 Eclipse 中停止 vertx verticle

Eclipse 自动换行行号不匹配

java - 如何避免闹钟的确定按钮