MJay
MJay

Reputation: 1058

How to install g++ in Cygwin?

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?

Upvotes: 6

Views: 20165

Answers (4)

z f
z f

Reputation: 145

this link solved my problem use this command to install cygwin:

setup-x86_64.exe -q -P wget -P gcc-g++ -P make -P diffutils -P libmpfr-devel -P libgmp-devel -P libmpc-devel

Upvotes: 0

MJay
MJay

Reputation: 1058

Finally I could find the answer in this link.

If one uses the MinGW installation file again, one can add some other packages.

I installed all Devel packages for MinGW and followed this tutorial which helped me to solve the problem.

Upvotes: 1

jovial
jovial

Reputation: 1

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.

Upvotes: 0

Isaac Hanson
Isaac Hanson

Reputation: 1148

Try installing the package cygport. It will take care of many of the dependencies you need, including g++.

Upvotes: 6

Related Questions