Ubuntu – use a C/C++ compiler


I shifted to Ubuntu 10.10 now I am facing problem to have C/C++ compiler. What are the possible ways so that I can use C/C++ compiler using all the libraries (like graphic, math, conio, stdlib, etc) as in Microsoft Windows creating executable file?

Best Answer

Ubuntu provides the standard Gnu Compiler Collection in the repositories.

You can install the Gnu C Compiler gcc Install gcc as well as the Gnu C++ compiler g++ Install g++ with the following command:

sudo apt-get install gcc g++

You'll probably also want to install libc6-dev Install libc6-dev (which includes the C standard library) and libstdc++6-4.5-dev Install libstdc++6-4.5-dev (which includes the standard C++ libraries).

If you're looking for something comparable to Microsoft's Visual C++ compiler, try taking a look at Qt - specifically Qt Creator Install qtcreator. It's a full-fledged IDE with a visual form designer, code-editor, and debugger.

enter image description here

enter image description here

Now that it's clear what you mean by "perfectly as in Microsoft windows?", then Qt Creator (which I mentioned above) will be perfect for your needs. You won't need to use the console to compile your applications and the Qt framework is easy to learn and use.

There's a great tutorial for getting started with Qt here.

Related Question