
如何在 Code::Blocks 中檢查我使用的 GCC 編譯器版本是什麼?
答案1
運行gcc --version
,結果將是這樣的:
gcc (GCC) 4.4.0
Copyright (C) 2009 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
如果這不起作用,您可能沒有PATH
正確設定編譯器(我相信如果在Windows 上使用MinGW,這種情況很常見),在這種情況下,您可以先透過在Code::Blocks 中執行以下操作來檢查編譯器的位置:
- 選單列
Settings
->Compiler and Debugger
- 選擇
GNU GCC Compiler
- 選擇選項
Toolchain executables
卡
然後,使用命令列移動到給定的目錄,然後進入bin
子目錄,然後嘗試gcc --version
從那裡運行。
答案2
一般執行命令
gcc --version
它應該給你這樣的結果:
gcc (Ubuntu/Linaro 4.4.4-14ubuntu5) 4.4.5
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.