can the experts show me a few trick on getting started with c++, installing a compiler(the simpliest way pls.)

Recommended Answers

All 10 Replies

I think g++ (g++ filename)is inbuilt but for starters it might be a good idea to take a look in an IDE, for example Code Blocks it is out of charge and is one of the best C++ IDEs I've came across

thanks for the insight

The de facto standard compilers for Linux are GCC (GNU Compiler Collection), which you can install if it is not pre-installed on your distro. Under Ubuntu, you can simply install "build-essential" package, which pulls in all that you need (compilers, make, auto-conf.. etc..). Other distros will have an equivalent packages. If not, you can install the individual packages for GCC compilers (gcc for C, g++ for C++, gfortran, gcj for Java, etc..) and the "binutils" package as well as other useful tools like "make", "autoconf", "cmake", etc..

The other alternative compile in Linux that some distros have on their package repositories is Clang (clang, clang++, etc..) which a more modern (but less stable) replacement for GCC.

But up to here, this will only get you as far as being able to compile some code in the terminal / command-line.

To actually do some coding, you can install an IDE. There are plenty of decent IDEs for Linux and C++, like CodeBlocks, Geany, KDevelop, NetBeans, Qt Creator, etc.. which are all offered on most distro's package repositories so that you can easily install them from apt-get or yum or your software center application.

wow, thanks, am appreciative of the indept explaination given, fortunately for me i am in a feild that is very related to yours (Mechatronics and Robotics engineering) looking forward to communicating with you more.....

The one very popular IDE that Mike2K didn't mention is Eclipse which runs on just about anything. It has a C/C++ plugin which works a treat. Myself, I prefer to use a good editor and make, but for less experienced people, the tools that a good IDE provide for editing, compiling, and debugging are very valuable in getting started.

oh thanks for the suggestion, i got it installed on my windows but on linux it's a bit tricky....

I've never had a problem installing it on Linux. What issues are you encountering?

ooooo thanks, i later figured it out, the gcc version and the g++ version did not correlate that was the problem i encountered but i later figured........ thanks anyways!).

@Rubber, I have problem with Eclipse, apparently there is something wrong having Luna on debian 64 bit, they've given a solution where I had to manually change something in a file but I never found the file and gave up :( Installed windows 8 and I have to go on it everytime I code now >.>

If you're running any of the Debian-based distros, an "apt-get install build-essential" will install everything you need to be able to develop C/C++ code on Linux. Then make sure that you use the CDT (C/C++ developer toolkit) version of Luna rather than the Java version to be able to find the compiler for native compliation in Eclipse.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.