Compile C code using gcc Command Line

Adopt from

http://ce.uml.edu/compile.htm


Compile C

gcc yourdotc.c

Compile C++

g++ yourdotcpp.cpp

Error will be shown if there is any error. If there is no error, you will get some .out file. The following command is entered

yourdotout.out

If you want to compiled your C program directly,

gcc –o yourCexec yourdotc.c

The executable file will be named yourCexec.

本篇發表於 C, C++, Programming 並標籤為 , 。將永久鏈結加入書籤。

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *