News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

Compiler issues

Started by ConradBuff1, March 17, 2023, 09:03:39 AM

Previous topic - Next topic

ConradBuff1

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.

stahta01

C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

ConradBuff1

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:

-------------- 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.

stahta01

#3
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

-------------- 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))
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

ConradBuff1

Both 'compile file' and 'link file' were already checked when producing the build log.

stahta01

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.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

BlueHazzard

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.

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