【问题标题】:run makefile generated by eclipse from command line after updating code not working更新代码后从命令行运行 eclipse 生成的 makefile 不起作用
【发布时间】:2013-08-13 15:39:49
【问题描述】:

我在跑步

eclipse juno Service Release 2 Build id: 20130225-0426 with this CDT config

还有这个操作系统:

uname -a 的截断输出):Linux 3.2.0-51-generic #77-Ubuntu SMP x86_64 x86_64 x86_64 GNU/Linux

我创建一个HelloWorld C++项目如下:

  • 文件->新建->C++ 项目
  • 项目类型:可执行空项目
  • 工具链:跨 GCC
  • 配置:已检查调试和发布

然后我创建一个包含 hello world 代码的 C++ 源文件 Main.cpp

然后我可以使用锤子图标进行编译。我选择在 Release 模式下编译。该程序运行良好(在 Eclipse 中或在命令行中)并打印“hello”。 如果我修改代码打印出“hello there”,我可以用锤子重新编译,程序仍然可以正常运行并打印出“hello there”。

但是,如果我修改代码以打印出“你好”,请转到发布目录 (/home/user/workspace/HelloWorld/Release) 并键入 make,我会收到以下消息:make: Nothing to be done for 'Main.d'

Release 目录中有一个名为 makefile 的文件,但它的行为与普通的 makefile 不同。我希望这个 makefile 是这样的,当代码发生更改并且您键入 make 时,代码实际上会被重新编译。如果我输入make clean 后跟make,代码会被重新编译,但这对于大型项目来说效率很低。

你知道为什么 eclipse 生成的 makefile 会这样吗?非常感谢。

【问题讨论】:

    标签: c++ makefile eclipse-cdt


    【解决方案1】:

    试试 $make all,而不是 $make 它应该可以工作。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-11-20
      • 1970-01-01
      相关资源
      最近更新 更多