Question:
GCC command line compile and run? a simple C program in command window?
2009-08-01 13:17:48 UTC
where can i learn how to use gcc compiler to compile link and run a simple C program manually?

i have too many manuals, i need a tutorial please, that will take me step by step with some simple examples!
Three answers:
anon
2009-08-01 16:21:08 UTC
save the program with a '.c' extension like myprogram.c

then run

]$ gcc myprogram.c

look for a.out and get permission like

]$ chmod +x a.out

then run it on that file

]$ ./a.out

or run that whole path

]$ /home/Desktop/a.out



this is all Unix

if you know Unix then u know Linux



you can do it in root also

root ] #

if you want a better name while compiling then

] # gcc myprogram.c -o Firstprogram.c

get permissions chmod +x or chmod 766

then run in that file

] # ./Firstprogram.c

You can find bugs with Wall when u compile

# gcc myprogram.c -Wall -o first_time



checkout all u can on Unix file sys.
cherida
2016-09-29 16:37:11 UTC
C is a compiled language. you will not be able to run it immediately faraway from notepad. you go with a compiler for that purpose. After compiled, a binary executable would be created. this technique you written would be run by utilising working the created software. As to what a compiler is, it extremely is ultimate you detect tutorials approximately C programming, strategies for each platform etc. as i don't on what platform you're writing the utility in (however i assume it relatively is abode windows, as you stated notepad, yet abode windows additionally are available kinds).
2009-08-01 13:26:52 UTC
Have you tried the man pages?


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...