在 Dev C++ 中运行一个项目

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/13544684/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-27 17:27:08  来源:igfitidea点击:

running a project in Dev c++

c++makefiledev-c++

提问by MasterWayne

I have a folder that contains a few .h and .cpp files along with a makefile. How can I run them in dev C++. I have just started using dev C++, hence, a bit clueless about this. the make file is

我有一个文件夹,其中包含一些 .h 和 .cpp 文件以及一个 makefile。我如何在开发 C++ 中运行它们。我刚刚开始使用 dev C++,因此,对此有点无能为力。制作文件是

 CC=g++
 CV=-I/usr/include/opencv
 CV2=-lml -lcvaux -lhighgui -lcv -lcxcore

 all:
    $(CC) main.cpp HOG.cpp HOGFeaturesOfBlock.cpp $(CV) $(CV2) -o featureExtractor

and I'm getting the error main.cpp, hog.cpp: no such file or directory.

我收到错误 main.cpp, hog.cpp: no such file or directory。

采纳答案by Orwell

  • Create a new project using File >> New Project. You can ignore the C/C++ options if you use a custom makefile. Also, an empty project will do.
  • Add the source and header files to the new project using Project >> Add to Project or the '+' sign in the middle of the top toolbar.
  • Go to Project >> Project Options (Alt+P) >> Makefile and tick the 'Use custom makefile' option. Then point Dev-C++ to the custom makefile below.
  • 使用 File >> New Project 创建一个新项目。如果使用自定义生成文件,则可以忽略 C/C++ 选项。此外,一个空项目也可以。
  • 使用 Project >> Add to Project 或顶部工具栏中间的“+”号将源文件和头文件添加到新项目中。
  • 转到 Project >> Project Options (Alt+P) >> Makefile 并勾选“Use custom makefile”选项。然后将 Dev-C++ 指向下面的自定义 makefile。

Also, be sure to update your IDE to the following version, which fixes an immense list of bugs compared to the ancient 4.9.9.2 version, ships with GCC 4.6.1 or 4.7.0, and is fully portable: http://sourceforge.net/projects/orwelldevcpp/

此外,请务必将您的 IDE 更新到以下版本,与古老的 4.9.9.2 版本相比,它修复了大量错误列表,随 GCC 4.6.1 或 4.7.0 一起提供,并且完全可移植:http://sourceforge .net/projects/orwelldevcpp/