I am extremely new to programming and I am having problems with the basic starting program of, ‘hello, world’.
I have downloaded MinGW and I believe I set it up correctly with the command promt by entering: setx PATH "%PATH%;C:\MinGW\bin"
Then I created this code following a guide while using Notepad++
#include <stdio.h> int main(void) { puts("Hello, world!"); return 0; }
saving it under c:/code/c/hello.c
When I try to compile it or run it under: gcc -o hello hello.c
, I get this error
gcc: error: hello.c: No such file or directory gcc: fatal error: no input files compilation terminated.
And I am not sure how to fix this. I have tried looking around, but I cant find any answers or I just don’t understand them.
Related Posts:
- what is stack smashing (C)?
- Compiling a .C file: Undefined symbols for architecture x86_64
- How do I compile the asm generated by GCC?
- C Unknown type name ‘my_structure’
- Convert char to int in C and C++
- gcc makefile error: “No rule to make target …”
- gcc makefile error: “No rule to make target …”
- How does #include
work in C++? - How do I install gcc on cygwin?
- warning: incompatible implicit declaration of built-in function ‘xyz’
- libpthread.so.0: error adding symbols: DSO missing from command line
- fatal error: Python.h: No such file or directory
- Fatal error: iostream: No such file or directory in compiling C program using GCC
- conflicting types error when compiling c program using gcc
- What is a file with extension .a?
- gcc/g++: “No such file or directory”
- (.text+0x20): undefined reference to `main’ and undefined reference to function
- Interpreting valgrind error Invalid write of size 4
- difference between
and - Warning/error “function declaration isn’t a prototype”
- Error: initializer element is not computable at load time
- warning: initializer element is not computable at load time
- Debug vs Release in CMake
- Debug vs Release in CMake
- gcc error : undefined reference to `itoa’
- What is the difference between gcc/g++ and cc1/cc1plus?
- Removing trailing newline character from fgets() input
- gcc: undefined reference to
- How to repair warning: missing braces around initializer?
- Why do I get “cast from pointer to integer of different size” error?
- What happens during a “relocation has invalid symbol index” error?
- g++ output: file not recognized: File format not recognized
- What does this GCC error “… relocation truncated to fit…” mean?
- Undefined reference to main – collect2: ld returned 1 exit status
- error: unknown type name ‘bool’
- Where is the
header file on Linux? Why can’t I find ? - gcc -g :what will happen
- Make Error 127 when running trying to compile code
- File format not recognized; treating as linker script using GCC
- Gcc error: gcc: error trying to exec ‘cc1’: execvp: No such file or directory
- gcc 4.8 on MAC OS X 10.8 throws “Undefined symbols for architecture x86_64: “
- cc1.exe System Error – libwinpthread-1.dll missing – But it isn’t
- Fatal error: iostream: No such file or directory in compiling C program using GCC
- typedef fixed length array
- How to solve static declaration follows non-static declaration in GCC C code?
- Linker error: “linker input file unused because linking not done”, undefined reference to a function in that file
- GCC: Array type has incomplete element type
- I don’t understand -Wl,-rpath -Wl,
- How to compile C program on command line using MinGW?
- What causes a segmentation fault (core dump) to occur in C?
- How to use symbols of extended ASCII table in C?
- Arrow operator (->) usage in C
- typedef struct vs struct definitions [duplicate]
- Floating point exception( core dump
- Why am I getting “void value not ignored as it ought to be”?
- 1 = false and 0 = true?
- How to go from fopen to fopen_s
- Write to .txt file?
- What does #pragma once mean in C? [duplicate]
- Printing hexadecimal characters in C
- What is the difference between const int*, const int * const, and int const *?
- Connect: Socket operation on non-socket
- C library function to perform sort
- Try catch statements in C
- How I can print to stderr in C?
- How do I create an array of strings in C?
- How to check if a string is a number?
- The difference between stdout and STDOUT_FILENO
- How do I create an array of strings in C?
- wait(null) and wait(&status) C language and Status
- Python ? (conditional/ternary) operator for assignments
- What’s the difference between a file descriptor and file pointer?
- How do you pass a function as a parameter in C?
- Cygwin – Makefile-error: recipe for target `main.o’ failed
- Why am I getting “undefined reference to sqrt” error even though I include math.h header?
- Why am I getting “undefined reference to sqrt” error even though I include math.h header?
- warning: control reaches end of non-void function [-Wreturn-type]
- C++ array assign error: invalid array assignment
- “…redeclared as different kind of symbol”?
- OS X 10.9.2: checking whether the C compiler works… no
- Bind failed: Address already in use
- too many arguments for format [-Wformat-extra-args]
- C: using strtol endptr is never NULL, cannot check if value is integer only?
- cast to pointer from integer of different size, pthread code
- double free or corruption (!prev) error in c program
- Where to find the complete definition of off_t type?
- How to write to a file using open() and printf()?
- Using floats with sprintf() in embedded C
- How to write log base(2) in c/c++
- Printf width specifier to maintain precision of floating-point value
- Two or more data types in declaration specifiers error
- ‘sprintf’: double precision in C
- C printing bits
- error: ISO C forbids nested functions – What’s wrong?
- Wait for user input in C?
- Carriage return in C?
- C: How do I make a number always round up
- malloc(sizeof(int)) vs malloc(sizeof(int *)) vs (int *)malloc(sizeof(int))
- Convert Char to String in C
- How to print a int64_t type in C