0
我在Ubuntu 16.10「Yakkety」上運行Code :: Blocks版本Code :: Blocks 16.01。我使用的編譯器是GCC 6.2。我無法編譯任何代碼::塊
我無法編譯任何東西,因爲我試圖將我的編譯器切換到Clang 3.9.1。
當我嘗試重新構建一個項目(這裏命名爲「Hello,World!」)時,它會失敗。構建日誌:
-------------- Build: Debug in Hello, World! (compiler: GNU GCC Compiler)---------------
g++-6 -Wall -g -O3 -std=c++1z -c "/home/ndos/바탕화면/Hello, World!/Hello, World!.cpp" -o "obj/Debug/Hello, World!.o"
g++-6 -o "bin/Debug/Hello, World!" "obj/Debug/Hello, World!.o"
/usr/bin/ld: obj/Debug/Hello, World!.o: relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
Process terminated with status 1 (0 minute(s), 0 second(s))
1 error(s), 0 warning(s) (0 minute(s), 0 second(s))
當我做一個新的項目(命名爲「你好,世界!」在這裏),並嘗試建立,它也將失敗。構建日誌:
-------------- Build: Release in Hello, World! (compiler: GNU GCC Compiler)---------------
g++-6 -Wall -O2 -O3 -std=c++1z -c "/home/ndos/바탕화면/Hello, World!/Hello, World!.cpp" -o "obj/Release/Hello, World!.o"
g++-6 -o "bin/Release/Hello, World!" "obj/Release/Hello, World!.o" -s
g++-6: error: obj/Release/Hello, World!.o: No such file or directory
g++-6: fatal error: no input files
compilation terminated.
Process terminated with status 1 (0 minute(s), 0 second(s))
2 error(s), 0 warning(s) (0 minute(s), 0 second(s))
我已經嘗試重新安裝代碼::塊,重新安裝GCC,清洗鏘,切換編譯器回GCC,但沒有一次成功。
如果你已經解決了問題,你可以回答你自己的問題。 – user3545752