How to install g++ in Cygwin?

Viewed 14225

I'm trying to compile a piece of MATLAB code containing a makefile. For the reason that I'm using Windows, I need to use Cygwin.

I have downloaded and installed Cygwin. When I tried to compile the code using make, there was an error that g++ is not found.

I searched for Cygwin package manager on the net and I installed apt-cyg but when I search for g++ using apt-cyg search g++, there is no result there!

I have updated package list (apt-cyg update) but finally I could not find c++ compiler for Cygwin!

How can I do it by apt-cyg package manager or any other way?

3 Answers

If using apt-cyg and looking for g++ I would suggest to look up for the name gcc-g++ instead of just g++.

In this case the command would look like:

apt-cyg search gcc-g++ - for searching the package or apt-cyg install gcc-g++ - for installing the package

Hint: Names of packages can be checked on the "Select Packages" page of the Cygwin installation program. There is no need to install, sometimes it is easier just to check the name of a package and cancel the installation.

Related