Author Topic: Compiler issues  (Read 289 times)

Offline ConradBuff1

  • Single posting newcomer
  • *
  • Posts: 3
Compiler issues
« 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.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7371
    • My Best Post
Re: Compiler issues
« Reply #1 on: March 17, 2023, 10:00:47 am »
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 ConradBuff1

  • Single posting newcomer
  • *
  • Posts: 3
Re: Compiler issues
« Reply #2 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.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7371
    • My Best Post
Re: Compiler issues
« Reply #3 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))
« Last Edit: March 17, 2023, 04:48:49 pm by stahta01 »
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 ConradBuff1

  • Single posting newcomer
  • *
  • Posts: 3
Re: Compiler issues
« Reply #4 on: March 18, 2023, 01:53:11 am »
Both 'compile file' and 'link file' were already checked when producing the build log.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7371
    • My Best Post
Re: Compiler issues
« Reply #5 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.
 
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 BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3334
Re: Compiler issues
« Reply #6 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