码迷,mamicode.com
首页 > 编程语言 > 详细

eclipse c/c++IDE 编译 make: *** No rule to make target `all'. Stop. 解决办法

时间:2015-04-02 15:12:38      阅读:141      评论:0      收藏:0      [点我收藏+]

标签:eclipse   eclipse makefile   no rule to make targ   make no target all   

若要转载请注明来源


首先看提示信息 产生的背景make: *** No rule to make target `all‘.  Stop

  1. 在eclipse上创建一个c project(注意:Project type:  Makefile Project下的Empty Project)
    技术分享
  2. 添加c语言文件
  3. 编辑自己的makefile
  4. 点击project->clean 清除编译产生的文件
  5. 点击project->build project  就会出现这个错误

原因

首先从提示总可知道 Current Project没有办法make taget ‘all’,那么很可能就是Current Project 的编译设置不对导致的。

其次,在IDE上找到配置Current Project Build的地方,在Project->Properties->C/C++ Build。

最后,在C/C++ Build中的Behavior Tab(行为or规则)标签下,看到一个Build(Incremental build)CheckBox和一个文本框(内容是all),试着去掉all在编译则会通过

     或者在Build(Incremental build)后面的variable..按钮Button中选择build_project 或者 build_files都可编译通过。

解决

在C/C++ Build中的Behavior Tab(行为or规则)标签下,看到一个Build(Incremental build)CheckBox和一个文本框(内容是all)

解决方法1: 去掉all在编译则会通过

  解决方法2: 在Build(Incremental build)后面的variable..按钮Button中选择build_project 或者 build_files都可编译通过。

解决方法3:在Build(Incremental build)后面的text(文本框中)输入 -f Makefile,可以编译通过。


总结

Build(Incremental build)意为增加编译规则(通俗易懂点就是给make增加后面的参数),默认是all,因为makefile中all标签不存在,所以会出现make: *** No rule to make target `all‘.  Stop.

因此去掉all,实质make

        添加-f Makefile ,实质是make -f Makefile

        在variable..按钮按钮Button中选择build_project 或者 build_files,实质是make -f Makefile

   

eclipse c/c++IDE 编译 make: *** No rule to make target `all'. Stop. 解决办法

标签:eclipse   eclipse makefile   no rule to make targ   make no target all   

原文地址:http://blog.csdn.net/txk15619567977/article/details/44830547

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!