eclipse c/c++IDE 編譯 make: *** No rule to make target `all'. Stop. 解決辦法

來源:互聯網
上載者:User

標籤: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. 解決辦法

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.