c++ - Eclipse C++ 头文件和文件问题

标签 c++ eclipse eclipse-cdt

有没有一种方法可以在 Eclipse for C++ 中使用 cpp 文件创建一个没有头文件的类?另外,有没有办法运行单个文件,而不将其放入自己的项目或其他东西中?我在网上搜索,但找不到完全按问题回答的答案。

最佳答案

回复:

Is there a way to create a class with a cpp file in Eclipse for C++ without the header?

是的。您可以将类定义和元素函数的实现放在同一个 .cpp 文件中。

回复:

[...] is there a way to run a single file, without putting it in its own project or something?

  • 选择运行外部工具外部工具配置...
  • 选择新建按钮或右键单击新建
  • ...配置...
  • 停用构建启动前构建,以防您不想

另见 Workbench User Guide > Tasks > Running external tools .

关于c++ - Eclipse C++ 头文件和文件问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47490717/

相关文章:

c++ - 确定 C++ 文件中的事件 qmake 配置

c++ - 从 sfml 2.1 中的 vector 中删除 Sprite

java - 下载独立的 STS 后 Eclipse 停止工作

C++ 直接调用 vector 元素的函数(Eclipse CDT 错误?)

android - 错误 : unknown type name 'class' NDK CDT JNI

c++ - 变量的内存分配

Linux 中的 C++ Stream 接口(interface)

java - 从 Eclipse 导入到 Android Studio : Can't find bundle messages. AndroidJpsBundle,语言环境 pl_PL

java - 打开打包在 JAR 中的 PDF 文件

c - Eclipse C/C++ (CDT) 将文件导入项目 - 找不到头文件 - 包含路径