Author Topic: I can't compile anything! (Edited) (Solved)  (Read 2033 times)

Offline Dannyu NDos

  • Single posting newcomer
  • *
  • Posts: 2
I can't compile anything! (Edited) (Solved)
« on: January 17, 2017, 03:19:00 pm »
I am running Code::Blocks version Code::Blocks 16.01 on Ubuntu 16.10 "Yakkety". The compiler I use is GCC 6.2.

I can't compile anything since I tried to switch my compiler to Clang 3.9.1.

When I try to re-build a project (named "Hello, World!" here) that already is built before, it fails. The build log is:
Code
-------------- 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))

When I make a new project (named "Hello, World!" here) and try to build, it also fails. The build log is:
Code
-------------- 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))

I have already tried reinstalling Code::Blocks, reinstalling GCC, purging Clang, switching the compiler back to GCC, but none of them worked. Please help!
« Last Edit: January 18, 2017, 05:53:39 am by Dannyu NDos »

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7070
    • My Best Post
Re: I can't compile anything!
« Reply #1 on: January 17, 2017, 06:03:13 pm »
What version of Code::Blocks?

Edit: Please post a build log instead of build messages.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org


Offline stahta01

  • Lives here!
  • ****
  • Posts: 7070
    • My Best Post
Re: I can't compile anything! (Edited)
« Reply #3 on: January 18, 2017, 05:40:27 am »
Try using only ASCII letters with no spaces in your project path and filenames.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Dannyu NDos

  • Single posting newcomer
  • *
  • Posts: 2
Re: I can't compile anything! (Edited)
« Reply #4 on: January 18, 2017, 05:54:39 am »
Try using only ASCII letters with no spaces in your project path and filenames.

Tim S.

That solved my problem. Thank you very much!
(Furthermore, I changed the default language from Korean to English.)