DEV Community

Cover image for Dev-C++ 4.9.9.2 版的問題
codemee
codemee

Posted on

1

Dev-C++ 4.9.9.2 版的問題

我在 Windows 11 上執行 Dev-C++ 4.9.9.2 中編譯程式時,會在下方編譯器記錄窗格看到以下錯誤:

編譯器: Default compiler
執行檔案 '' gcc.exe...''
gcc.exe "C:\temp\ch1\prog1_1.c" -o "C:\temp\ch1\prog1_1.exe"    -I"C:\Dev-Cpp\include"   -L"C:\Dev-Cpp\lib" 
gcc.exe: Internal error: Aborted (program collect2)
Please submit a full bug report.
See <URL:http://www.mingw.org/bugs.shtml> for instructions.

執行結束
編譯成功
Enter fullscreen mode Exit fullscreen mode

雖然最後顯示『編譯成功』,不過如果你仔細看,會發現其中有一列錯誤訊息:

gcc.exe: Internal error: Aborted (program collect2)
Enter fullscreen mode Exit fullscreen mode

如果你直接執行,就會看到彈出交談窗,顯示『原始碼檔案無法編譯』錯誤。

剛剛看到的 collect2 是中介的工具程式,會去找到正確的連結器進行連結工作,剛剛看到的錯誤訊息就是它出問題,權宜解法就是把這個值行檔刪除,你可以在 Dev-Cpp 安裝資料夾中(預設是 c:\Dev-Cpp)的 libexec\gcc\mingw32\3.4.2\ 下找到 collec2.exe 檔,刪除之後就可以正常編譯執行。

如果你覺得這樣看起來只是躲避問題,並沒有根除問題,那你有兩個選擇:

  • 採用 Owell 維護的版本,它延續到 2015 年的 5.11 版,使用 TDM-GCC 4.9.2 編譯器。
  • 採用 Embarcadero 公司維護的版本,這間 Embarcadero 公司你也許不知道名字,但它其實就是以前的 Borland 公司,想當年赫赫有名。這個版本最新是 6.3 版,使用 TDM-GCC 9.2.0 編譯器。不過要注意的是,這個版本的繁體中文介面語系連結沒有做好,所以如果選 Chinese TW 會變亂碼。

Image of Docusign

Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs