Pasang pakej g++ sebagai root
su -
aptitude install g++
Untuk compile fail hello.cpp yang kandungannya seperti berikut
#include <iostream>
using namespace std;
int main ()
{
cout << "Hello, world." << endl;
return 0;
}
Arahannya seperti berikut:
g++ hello.cpp -o hello
Sengaja saya tambah pilihan dan parameter -o hello supaya program terhasil bernama hello, bukannya a.out. Untuk laksanakan program terhasil:
./hello
Hasil sepatutnya:
Hello, world.
















No comments
Comments feed for this article
Trackback link: http://umarzuki.org/blogku/wp-trackback.php?p=220