Is there a well-known package I should install for C++ Development Tools?
What do I type at the command-line after
sudo apt-get install?
Ideally, I want the same tools that were installed with "MinGW" on my Windows computer.
Raspberry Pi Stack Exchange is a question and answer site for users and developers of hardware and software for Raspberry Pi. It only takes a minute to sign up.Sign up to join this community
That may depend on your distro, but if you are using raspbian, the stock gcc includes g++, here's the version info:
me@RPi» gcc -v Using built-in specs. [...] --enable-languages=c,c++,fortran,objc,obj-c++
apt-get install gcc should work if it isn't already there.
Most distros will build gcc with C++ support, so this should be true for them too. The easy way to check is to install gcc then try
FYI, GCC is the "Gnu Compiler Collection" used by MinGW;
gcc is the C compiler,
g++ is C++.
To compile C++ code you'll also need the stdc++ header files (
#includes) from the "libstdc++ dev package". There is more than one available for raspbian because there are 4 slightly different versions of libstdc++ available. The one which appears to be the default against which (presumably) all or most binaries in the distro are built looks to me to be 6-4.6. Check with:
dpkg -l | grep ++
That's what is currently installed. If you don't see any libstdc++ listed, then just pick one from what's available (
apt-cache search libstdc++). You can have them all installed at the same time, although the system will tend to use only one (there is a symlink based on major version in /lib to one of the .so's). So:
apt-get install libstdc++6-4.6-dev
That should (I think) include the base library as a prereq, in which case that and gcc and its prereqs should cover everything. If it doesn't, just install
libstdc++6-4.6. Library packages in most linux distros come in two parts, the runtime, and the headers in a separate
-dev package for compiling using the API.