It means that es3.c
does not define a main
function, and you are attempting to create an executable out of it. An executable needs to have an entry point, thereby the linker complains.
To compile only to an object file, use the -c
option:
gcc es3.c -c gcc es3.o main.c -o es3
The above compiles es3.c
to an object file, then compiles a file main.c
that would contain the main
function, and the linker merges es3.o
and main.o
into an executable called es3
.
Related Posts:
- difference between
and - Warning/error “function declaration isn’t a prototype”
- warning: initializer element is not computable at load time
- Why do I get “cast from pointer to integer of different size” error?
- Where is the
header file on Linux? Why can’t I find ? - typedef fixed length array
- How to solve static declaration follows non-static declaration in GCC C code?
- warning: incompatible implicit declaration of built-in function ‘xyz’
- Fatal error: iostream: No such file or directory in compiling C program using GCC
- waitpid, wnohang, wuntraced. How do I use these
- How to initialize array to 0 in C?
- Sign extend a nine-bit number in C
- Warning: assignment from incompatible pointer type
- C: error: expected ‘)’ before ‘;’ token
- make: Nothing to be done for `all’
- Data argument not used by format strings in C
- execv vs execvp, why just one of them require the exact file’s path?
- expected expression before ‘{‘ token
- Setting std=c99 flag in GCC
- C Vector/ArrayList/LinkedList
- Returning an array using C
- Debug vs Release in CMake
- error: ‘for’ loop initial declarations are only allowed in C99 mode [duplicate]
- c – warning: implicit declaration of function ‘printf’
- Flushing buffers in C
- What are 0x01 and 0x80 representative of in C bitwise operations?
- How to make parent wait for all child processes to finish?
- Undefined Reference issues using Semaphores
- What is time(NULL) in C?
- Use of cudamalloc(). Why the double pointer?
- Compiling a .C file: Undefined symbols for architecture x86_64
- Portable way to check if directory exists [Windows/Linux, C]
- OpenGL — GL_LINE_LOOP —
- How to use EOF to run through a text file in C?
- Incorrect checksum for freed object on malloc
- Valgrind complains with “Invalid write of size 8”
- Removing trailing newline character from fgets() input
- Expression must be a pointer to a complete object type using simple pointer arithmetic
- Simple way to check if a string contains another string in C?
- What does “request for member ‘*******’ in something not a structure or union” mean?
- gcc: undefined reference to
- Segmentation fault (core dumped) due to fgets – I think
- What does “request for member ‘*******’ in something not a structure or union” mean?
- Unknown ending signal when using debugger gdb
- Valgrind: invalid read of size 4 -> sigsegv, works fine without valgrind and in visual studio
- How to convert integer to char in C?
- Is there a good Valgrind substitute for Windows?
- Difference between sizeof(char) and sizeof(char *)
- Difference between “move” and “li” in MIPS assembly language
- How to empty a char array?
- What is the difference between array and enum in C ?
- How can one see content of stack with GDB?
- What does the term “empty loop” refer to exactly in C and C++?
- What does ** mean in C?
- Is there a way to have printf() properly print out an array (of floats, say)?
- error: unknown type name ‘bool’
- What integer hash function are good that accepts an integer hash key?
- Proper way to empty a C-String
- malloc(): memory corruption
- How do you allow spaces to be entered using scanf?
- X86 assembly – Handling the IDIV instruction
- Pause screen at program completion in C
- Difference between fgets and fscanf?
- How do I compile the asm generated by GCC?
- What is the difference between %g and %f in C?
- Why is the sizeof(int) == sizeof(long)?
- Structure padding and packing
- Lua – Number to string behaviour
- How to allocate array of pointers for strings by malloc in C?
- Reading in double values with scanf in c
- Realloc Invalid Pointer in C
- What tools are there for functional programming in C?
- “-bash: gcc: command not found” using cygwin when compiling c?
- How to format strings using printf() to get equal length in the output
- In C, what exactly happens when you pass a NULL pointer to strcmp()?
- lseek/write suddenly returns -1 with errno = 9 (Bad file descriptor)
- What are the differences between if, else, and else if?
- Should I use printf(“\n”) or putchar(‘\n’) to print a newline in C?
- error: struct has no member named X
- strtok segmentation fault
- Invalid write of size 1
- Linker error: “linker input file unused because linking not done”, undefined reference to a function in that file
- realloc(): invalid next size when reallocating to make space for strcat on char *
- Constructor for structs in C
- C Error: declaration shadows a local variable — Won’t let me repeatedly replace the value of my float variable
- MIPS to C Translation
- Pointer to 2D arrays in C
- Pointer to a string in C?
- gdb: No symbol “i” in current context
- Cross Platform C library for GUI Apps?
- Implicit function declarations in C
- Pre increment vs Post increment in array
- Convert long long to string in C?
- Using pointer to char array, values in that array can be accessed?
- How can I create a dynamically sized array of structs?
- How to compile C program on command line using MinGW?
- how to stop a loop arduino
- How to normalize a mantissa
- How to use shared memory with Linux in C
- When is it ok to use a global variable in C?