Author Topic: error: no such file or directory  (Read 12028 times)

Offline uryyakir

  • Single posting newcomer
  • *
  • Posts: 2
error: no such file or directory
« on: November 13, 2016, 12:12:38 am »
Hey,
I'm really new to code:blocks, so please treat my stupidity with forgiveness. I've recently downloaded C:B in order to use it to code C.
I've downloaded TDM-GCC to use it as a compiler, following the instructions from here: http://wiki.codeblocks.org/index.php/MinGW_installation
I've gone to Setting -> Compiler, selected the "Intel C/C++ Compiler from the list on top, and then gone to "toolchain executables", and put "C:\TDM-GCC-32\bin" as the compiler's installation directory. then, I've changed the C compiler to mingw32-gcc.exe according to the instructions. I've created a new file, saved it as "hello.c".
this is my code:
Code
#include <stdio.h>

main() {
    printf("hello, world\n");
           }

When attempting to Build and Run, I receive the error:
Code
||=== Build file: "no target" in "no project" (compiler: unknown) ===|
||error: /nologo: No such file or directory|
||error: /c: No such file or directory|
||error: /FoC:\hello.obj: Invalid argument|
||=== Build failed: 3 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|


This is my build log:
Quote
mingw32-gcc.exe: error: /nologo: No such file or directory
mingw32-gcc.exe: error: /c: No such file or directory
mingw32-gcc.exe: error: /FoC:\hello.obj: Invalid argument
Process terminated with status 1 (0 minute(s), 0 second(s))
3 error(s), 0 warning(s) (0 minute(s), 0 second(s))
Why is this happening? How can I fix it?

Thanks in advance, and sorry for bad English.
Oh and sorry if this has already been asked like a thousand times, I've dig around the internet the best I could, resulting in nothing but an headache.
« Last Edit: November 13, 2016, 12:21:14 am by uryyakir »

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: error: no such file or directory
« Reply #1 on: November 13, 2016, 12:21:23 am »
TDM-GCC is .... GCC !  not Intel.
So you use a commandline generated for Intels C++(C-compiler together with a gcc-compiler executable. That can not work.
Use GNU GCC instead, fix the toolchain (if necessary) and set it as default compiler.

Offline uryyakir

  • Single posting newcomer
  • *
  • Posts: 2
Re: error: no such file or directory
« Reply #2 on: November 13, 2016, 12:27:20 am »
TDM-GCC is .... GCC !  not Intel.
So you use a commandline generated for Intels C++(C-compiler together with a gcc-compiler executable. That can not work.
Use GNU GCC instead, fix the toolchain (if necessary) and set it as default compiler.

MY GOD. YOU FIXED MY PROBLEM. I've spent so much time on that problem and the solution was right there the entire time. Anyway, thank you so much!