在Eclipse中運行C++程式出現”Launch failed. Binary not foud”和”Program file not SpecifiedR

來源:互聯網
上載者:User

在辦公室電腦XP下用eclipse建立一個test工程,本想使其可以在XP下的eclipse下運行起來!

但在裝了MinGW後,卻不能像家裡的eclipse環境一樣,可以順利run起來。

不管怎麼設定,要麼出現"Launch failed. Binary not foud"問題,要麼出現"Program file not Specified"問題;

初始以為是MinGW的問題,因為辦公室裡不能上網,所以就不能像在家裡用的MinGW-5.1.6了(因為這需要連網下載一些包),而是用了Qt SDK中的MinGW;

後來在網上查了些資料,冒似有網友也出現了類似問題,摘錄如下:

 

Using C++ in Eclipse - "Program file not Specified" problem遇到的問題 跟這位仁兄的一樣  不過我的是在Linux下的, 抄錄如下,以滋懷念。

When we are using CDT to write C++ in Eclipse, you may encounter the following error: (I've set up a new C++ Hello World project)

Binary not found

Or Program file not Specified

So how can we solve it?

1. Right click the project, Properties->C/C++ Build->Settings->Binary Parser, Click on "PE Windows Parser" if you are a Windows user.

2. Now in the Run configurations, you can choose your C/C++ Application (At first you may not find the binaries to run because eclipse does not know how to run this binary)

 

上面解決辦法中的第1步,好理解,而且也設定了,但第2步沒太理解,因為沒有出現如中的對話方塊介面。

後來仔細研究了下"Program file not Specified"問題含義,意思是說運行程式沒有指定。

我的理解是在eclipse中沒有指定*.exe運行程式。

在上面的第2步中,在test Default介面(即回合組態介面中)下,在C/C++ Appliaction一欄中點擊Browse按鈕,在項目工程目錄下,找到Debug目錄,然後選擇test.exe檔案(我的程式名是這個名字,應該是跟工程名一樣的),確定後,點擊應用並運行,可以了~~~

果然是因為在eclipse中沒有指定運行程式的原因。

後回到家中,查看了自已電腦上eclise的test工程,的確在eclipse中有指定了,只不過是可能由於家裡的eclipse版本較高(家裡用的是eclipse SDK 3.7),這部分可能由eclipse自己完成了!

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.