I would like to create an executable of my two mycode.c and my main.c, how can I create an executable? i did
gcc mycode.c main.c
and it generates a a.out, but when i click it it would not run.. (i am new to this so please bear with me)
Thank you
Try this
gcc mycode.c main.c -o myprogram
Then run ./myprogram
If you double click it you probably won't see anything, you should instead try running it from the command line, where you compiled it from in the first place.
Your a.out might not be executable yet.
do:
$> chmod 755 a.out
or
$> chmod a+x a.out
then try running it:
$> ./a.out
a.out execute permission. If you double-click an `a.out’ file (probably from Nautilus), it should execute it, but not in a terminal.
./a.outon the commandline.