The Quick and Dirty "Hello World" with GCC: Difference between revisions
Appearance
Created page with "by Martin Iturbide I just wanted to check out which will be the most basic example to use the gcc compiler to create on OS/2-eCS the most basic, most easy program on eart..." |
No edit summary |
||
Line 1: | Line 1: | ||
by [[Martin Iturbide]] | by [[Martini|Martin Iturbide]] | ||
I just wanted to check out which will be the most basic example to use the gcc compiler to create on OS/2-eCS the most basic, most easy program on earth, the "Hello World" program. | I just wanted to check out which will be the most basic example to use the gcc compiler to create on OS/2-eCS the most basic, most easy program on earth, the "Hello World" program. | ||
Line 26: | Line 26: | ||
When you run it you will see: | When you run it you will see: | ||
[[image:Hellocmd.png]] | [[image:Hellocmd.png|200px]] | ||
It can not be more simple. | It can not be more simple. |
Revision as of 22:12, 31 May 2016
I just wanted to check out which will be the most basic example to use the gcc compiler to create on OS/2-eCS the most basic, most easy program on earth, the "Hello World" program.
First I installed with Arca Noae Package Manager the gcc compiler.
I created a simple text file called "hello.c" and included on it.
/* Hello World program */ #include<stdio.h> main() { printf("Hello World"); }
The most simple program on C to print out "Hello World" on the command prompt.
To compile it is as simple as:
gcc -o hello.exe hello.c
It will generate a "hello.exe" file.
When you run it you will see:
It can not be more simple.
The -o file parameter of gcc it is just to place the output of the compile into an specific file name.