Author Topic: Compiler Issue  (Read 8739 times)

Offline TimAnderson

  • Single posting newcomer
  • *
  • Posts: 6
Compiler Issue
« on: January 10, 2014, 05:24:06 pm »
I am running Code::Blocks version 13.12 rev 9501 on Red Hat Enterprise Linux Workstation
(version 6.3(Santiago)). The compiler I use is gcc
version 4.4.7 20120313 (Red Hat 4.4.7-3).

When I try to compile my workspace (with multiple projects), I get an error in the Build Log saying that the file could not be found.  I have copied the command from the Build Log directly to command line and it works fine.

Description of problem.
The file is not being compiled.

Build log:
Code
-------------- Build: Debug in ExceptionsLib (compiler: GNU GCC Compiler)---------------
g++ -Wall -g -pedantic -Wall -ansi -g -c /home/anderson/STRIKE_CL/Software/trunk/SAS/Production/ExceptionsLib/Exception.cpp -o /home/anderson/STRIKE_CL/Software/trunk/SASProduction/CodeBlocks/ExceptionsLib/obj/Debug/ExceptionsLib/Exception.o
g++ -Wall -g -pedantic -Wall -ansi -g -c /home/anderson/STRIKE_CL/Software/trunk/SAS/Production/ExceptionsLib/Exception.cpp -o /home/anderson/STRIKE_CL/Software/trunk/SASProduction/CodeBlocks/ExceptionsLib/obj/Debug/ExceptionsLib/Exception.o: No such file or directory.
Process terminated with status 1 (0 minute(s), 0 second(s))
0 error(s), 0 warning(s) (0 minute(s), 0 second(s))


I have already tried modifying the Global compiler Settings->Toolchain executables to point to /usr/bin and trying specifying the absolute path to the g++ executable as /usr/bin/g++.  After that didn't change anything, I went back to the Toolchain executables tab and selected Auto-detect and the Compiler's installation directory was set back to /usr (that's when I noticed the NOTE below the text field stating that the bin sub-directory would be appeneded to the /usr).

I also changed the Project Properties->Build Targets Object output dir to be an absolute path.

Neither of these worked.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Compiler Issue
« Reply #1 on: January 10, 2014, 08:44:22 pm »
Please provide a minimal sample project to reproduce.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline TimAnderson

  • Single posting newcomer
  • *
  • Posts: 6
Re: Compiler Issue
« Reply #2 on: January 16, 2014, 12:03:56 am »
Attached are my Project and Source files for a simple Hello World project.

With these files, I get the following when I try to compile.
Quote
gcc -Wall -g -pedantic -Wall -ansi -g -c /home/anderson/CodeBlocks/HelloWorld/main.c -o /home/anderson/CodeBlocks/HelloWorld/obj/Debug/main.o
gcc -Wall -g -pedantic -Wall -ansi -g -c /home/anderson/CodeBlocks/HelloWorld/main.c -o /home/anderson/CodeBlocks/HelloWorld/obj/Debug/main.o: No such file or directory.
Process terminated with status 1 (0 minute(s), 0 second(s))
0 error(s), 0 warning(s) (0 minute(s), 0 second(s))


I hope there aren't any typos since the computer I'm running C::B on is not on the Internet.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Compiler Issue
« Reply #3 on: January 16, 2014, 12:30:07 am »
How did you create your file ?
It has incorrect line-endings (that does no harm), but also two typos:
there is no option "g" without the leading minus ("-") and there is no end-tag named "</Targert>" !

Offline TimAnderson

  • Single posting newcomer
  • *
  • Posts: 6
Re: Compiler Issue
« Reply #4 on: January 16, 2014, 12:33:24 am »
The original file is on a Linux system that is not connected to the Internet so I attempted to type it into my Windows computer that is.  Apparently I made a couple of typos (as I explained could happen at the bottom of my post).

I've updated the project file with the errors you pointed out and have attached.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Compiler Issue
« Reply #5 on: January 16, 2014, 12:56:57 am »
The original file is on a Linux system that is not connected to the Internet so I attempted to type it into my Windows computer that is.  Apparently I made a couple of typos (as I explained could happen at the bottom of my post).

I've updated the project file with the errors you pointed out and have attached.
I fixed the typos here (of course) and fixed the object path also and the project compiles fine on my CentOS 6 VM.

You have to find a way to provide the original project and the conf-file (~/.codeblocks/default.conf).
You should be able to use some kind of storage media (usb-stick etc.) to provide the original files, otherwise it is nearly impossible to help.