Code::Blocks Forums

User forums => Help => Topic started by: ConradBuff1 on March 17, 2023, 09:03:39 am

Title: Compiler issues
Post by: ConradBuff1 on March 17, 2023, 09:03:39 am
Hi, I'm having some trouble getting programs to build and compile. I've downloaded the .exe file with the inbuilt compiler but it doesn't seem to working correctly. Tried a number of suggestions others have made on the forum but these haven't worked.

Here's the build log:
-------------- Build: Debug in asdfasdf (compiler: GNU GCC Compiler)---------------

gcc.exe  -o bin\Debug\asdfasdf.exe obj\Debug\main.o   
gcc.exe: error: obj\Debug\main.o: No such file or directory
gcc.exe: 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))
 
Any help would be greatly appreciated.
Title: Re: Compiler issues
Post by: stahta01 on March 17, 2023, 10:00:47 am
https://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28general%29#Q:_How_do_I_report_a_compilation_problem_on_the_forums.3F (https://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28general%29#Q:_How_do_I_report_a_compilation_problem_on_the_forums.3F)

Please post an full rebuild log in code tags.

Tim S.
Title: Re: Compiler issues
Post by: ConradBuff1 on March 17, 2023, 10:45:14 am
Hi Tim,

Thank you for your prompt response.

I am running Code::Blocks version 20.03 on Windows 10. The compiler I use is the GNU GCC Compiler (Mingw) that was bundled with the install file (unsure of version number).

When I open a new project and attempt to build the "Hello World!" program, I receive the error messages "No such file or directory" and "error: no input files".

Build log:
Code
-------------- Clean: Debug in Project (compiler: GNU GCC Compiler)---------------

Cleaned "Project - Debug"

-------------- Build: Debug in Project (compiler: GNU GCC Compiler)---------------

gcc.exe  -o bin\Debug\Project.exe obj\Debug\main.o   
gcc.exe: error: obj\Debug\main.o: No such file or directory
gcc.exe: 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 a few suggestions relating to the compiler's installation directory (manually selecting the folder, auto-detection. I received confirmation that the installation path was detected each time), but this was not successful.

Please let me know if you require anything further.
Title: Re: Compiler issues
Post by: stahta01 on March 17, 2023, 04:46:23 pm
Under tab projects; expand the project name Project

Right click on the source file main.c and select properties from the menu.
Select tab Build; checkmark compile leave link checked.
Click okay button
Rebuild project.

What my build log looks like
Code
-------------- Clean: Debug in Project (compiler: GNU GCC Compiler)---------------

Cleaned "Project - Debug"

-------------- Build: Debug in Project (compiler: GNU GCC Compiler)---------------

gcc.exe -Wall -g  -c H:\devel\cb_projects\test\Project\main.c -o obj\Debug\main.o
gcc.exe  -o bin\Debug\Project.exe obj\Debug\main.o   
Output file is bin\Debug\Project.exe with size 247.67 KB
Process terminated with status 0 (0 minute(s), 0 second(s))
0 error(s), 0 warning(s) (0 minute(s), 0 second(s))
Title: Re: Compiler issues
Post by: ConradBuff1 on March 18, 2023, 01:53:11 am
Both 'compile file' and 'link file' were already checked when producing the build log.
Title: Re: Compiler issues
Post by: stahta01 on March 18, 2023, 06:22:28 pm
Then other than making sure to have no spaces or non ASCII characters in the project path I have nothing to suggest other that upgrading to a CB Nightly build.

Tim S.
 
Title: Re: Compiler issues
Post by: BlueHazzard on March 19, 2023, 08:33:01 pm
Also make sure that you have write permission for the folder your project is into and also check if your anti virus program is disabled for the project folder and/or codeblocks executable.

Code
gcc.exe  -o bin\Debug\Project.exe obj\Debug\main.o   
this path looks quite sus