I'm trying to compile multiple files using the GCC compiler through the command prompt.I'm using this commands to compile them:gcc tokens.c main.c -c
to create the .o files; and using gcc tokens.o main.o -o proyect.exe
to compile it (.exe file).The problem is, when I use the -o proyect.exe
in the latter command, the program just doesn't work as is supposed to. When I only use gcc tokens.o main.o
(without -o and naming it) creates the a.exe by default, and that exe works perfectly.Is there a difference between using -o "name.exe" or just don't? I don't see a problem using -o and then naming my program, but it just freezes and exit when I use it. I do not get any kind of errors/warnings when I use these commands
↧
How to properly compile multiple files using GCC compiler and .o files with -o?
↧