User forums > Using Code::Blocks
Compiler Issue
TimAnderson:
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))
--- End code ---
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.
MortenMacFly:
Please provide a minimal sample project to reproduce.
TimAnderson:
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))
--- End quote ---
I hope there aren't any typos since the computer I'm running C::B on is not on the Internet.
Jenna:
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>" !
TimAnderson:
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.
Navigation
[0] Message Index
[#] Next page
Go to full version