Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22016

How to properly compile multiple files using GCC compiler and .o files with -o?

$
0
0

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


Viewing all articles
Browse latest Browse all 22016

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>