Monday, June 2, 2008

Build Essentials - Develop C/C++ in Ubuntu

If you want to develop in C or C++ you have to install the basic packages that include among other things the C/C++ standard libraries, otherwise you migth have the C/C++ compiler (gcc/g++) and you are getting compile errors.


To install these basic C/C++ developement packages just do:

$ sudo apt-get install build-essential


To test it, just save the C code below in a file like "hello.c"


#include

main()
{
printf ("Hello World!\n");
}


now then compile it:

$ gcc hello.c


and run it:

$ ./a.out

it shoul print "Hello World!"


And thats it you are ready to start developing C/C++ in Ubuntu.

No comments: