2014-10-31 43 views
0

我在嘗試在eclipse中運行C++項目時遇到問題。無法在eclipse中作爲C++項目運行

我發現了幾個解決方案的頁面,但都沒有工作。

The program file specified in the launch configuration does not exist

Launch Failed. Binary not found. CDT on Eclipse Helios

程序編譯:

08:52:36 **** Build of configuration Debug for project testcpp **** 
make all 
Building file: ../test.cpp 
Invoking: Cross G++ Compiler 
g++ -O0 -g3 -Wall -c -fmessage-length=0 -std=c++11 -MMD -MP -MF"test.d" -MT"test.d" -o "test.o" "../test.cpp" 
Finished building: ../test.cpp 

Building target: testcpp.exe 
Invoking: Cross G++ Linker 
g++ -pthread -o "testcpp.exe" ./test.o 
Finished building target: testcpp.exe 


08:52:38 Build Finished (took 1s.664ms) 

和文件testcpp.exe是debug文件夾裏面,但是當我運行Run as - >Local C/c++ Application它顯示的錯誤Launch Failed. Binary not found.

事情是我可以點擊Run,它的工作原理。

有什麼想法?

Eclipse版本:

的Eclipse IDE爲C/C++開發

版本:露娜服務版本1(4.4.1) 版本ID:20140925-1800

平臺: Windows 7 64bits。

+0

「調用:跨G ++編譯器」文本讓我猜測您正在爲另一個目標創建程序,而不是您正在使用的本地平臺。所以當你試圖以「本地應用程序」運行時,它試圖運行該程序,因爲它是本地的,但它不是。當你「運行」它時,你可能會在某種模擬器中啓動它。請注意,我只是在猜測,因爲我已經很多年沒有使用Eclipse了。 – 2014-10-31 08:02:54

+0

你使用哪個平臺?交叉編譯可能是有意義的,如果它是運行在Windows上的g ++ – Eric 2014-10-31 08:05:30

+0

是的,我在windows上運行並且目標交叉g ++,因爲它是我可以使用-pthread運行的唯一一個。我會用這個信息更新這個問題。 – blfuentes 2014-10-31 08:06:56

回答

1

一個廉價的黑客可能會將您的調試文件夾添加到您的PATH環境變量。這樣eclipse也會檢查二進制文件的路徑。

如果其他人寫了makefile(而不是eclipse),那麼Eclipse的調試路徑可能不會被識別。嘗試指定要啓動的完整路徑

+0

謝謝。這工作,但這是做到這一點的正確方法?還是應該以特殊的方式配置eclipse? – blfuentes 2014-10-31 08:13:56

+1

我沒有任何eclipse應用程序在手邊,但在運行中,因爲有一個地方,你指定你的二進制文件應該在哪裏。這真的取決於你的項目是如何創建的 – Eric 2014-10-31 08:33:39

相關問題