How to install g++ in Cygwin? - g++

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?

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

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.

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

CPack create package for pacman and MSYS2/ MinGW

I already successfully created NSIS installers and Debian packages with CMake and CPack for other projects.
For a new C++ project I also want to provide various packages for different platforms. Besides Debian packages, I also want to create packages for MSYS2/ MinGW.
Now I am a little bit struggling to find documentation to create packages for MSYS2/ MinGW for pacman. Is this even possible and can CPack create packages for MSYS2/ MinGW?
Is there any documentation available or did somebody try the same? Can those packages create cross-platform? I know I can cross-compile for MinGW under Linux but can I also create those packages cross-platform?
Any hints would be appreciated! Thanks!

Build package with customized port file using vcpkg

I installed OpenCV package using vcpkg, and since the OpenCV comes with vcpkg's own build configuration does not support libgtk, I got error when trying to run OpenCV with in WSL2 on windows 10.
The solution I found OpenCV GTK+2.x error suggests to add -DWITH_GTK=ON to the cmake configuration. And I added that option to the portfile in $vcpkgRoot/port/opencv4/porfile.make. And I try to rebuild/update the OpenCV, but seems it does not work.
I searched the documentation and could not find a clear description on how to use updated/customized portfile to rebuild the package. The only way that seems to work is to uninstall and install it again with the modified portfile.
If you used vcpkg install opencv and then used vcpkg remove opencv opencv4 will not be removed since the port opencv is just a redirection to opencv4. So if you want to remove opencv4 you need to use vcpkg remove opencv4 --recurse or vcpkg remove opencv opencv4. The same is true for e.g. openssl which needs to specific the platform e.g openssl-windows for correct removal.
And you cannot use the upgrade command since this requires a change of the version in the CONTROL file.

How to configure cmake for msys2

I'm using external cmake with msys2, since cmake-gui provided by msys2 won't run (invalid win32 application). Now the problem is there's only so much I can configure using cmake-gui. I downloaded OpenALSoft today and when I ran make install it installed to C:\Program Files (x86)\. How do I configure external cmake to install into mingw32 or mingw64 depending on what's running? On top of that, I'm having a problem differentiating between PATH RPATH and PREFIX (and how those correspond to msys2 install structure), so if you could, please, clarify those too, I'd really appreciate that.
I always use this invocation to make sure the install directory is set to /mingw32 or /mingw64:
MSYS2_ARG_CONV_EXCL=- cmake . -G"MSYS Makefiles" -DCMAKE_INSTALL_PREFIX=$MINGW_PREFIX
And then when you want to install the built project, you must do this:
make install DESTDIR=/
All of this trickiness is due to the fact that CMake is a native Windows program that does not understand MSYS2-style paths like /, and MSYS2 has some automatic conversions of paths that happen when it detects you are running a native Windows program like CMake.
By the way, MSYS2's cmake-gui works for me, so maybe you should try reinstalling the CMake package in MSYS2 or something. However, I expect my answer to work for both the external CMake and the one in MSYS2.

CMake not able to find Qt4

I'm working on a project using PCL (point cloud library) for which I need to configure some code files using CMake. But some of these files aren't getting configured and the error CMake shows for those files is "Qt4 not found". I already have Qt 4.8 installed and this is the only Qt version I have. Also, for some of the other files, CMake used Qt without showing any error. And when I run qmake.exe, it shows "Qt : Untested windows version 6.2 detected". And for all the Qt5 related entries, CMake shows "NOT FOUND". Have I installed the correct version of Qt? And how can I get CMake to detect Qt4?
I'm using windows 8.1 64bit
When I typed qmake -v in command prompt, I got this -
Qt: Untested Windows version 6.2 detected!
QMake version 2.01a
Using Qt version 4.8.0 in C:\Qt\4.8.0\lib
cmake to find Qt users qmake, so if you run it not from command line,
make sure that global environment variable PATH set to proper value, so cmake can find qmake
cmake cache libraries search results, bad results also. Because of that, if it can find some library, you install it, then rerun cmake it can show again "library not found" message, even if your setup is corrret. So make sure to remove CMakeCache.txt before rerun cmake.

wxWindows 2.9 binary for windows

After an upgrade to the new Haskell Platform, my existing wxHaskell programs are broken.
They all seem to now require wxWidgets 2.9, for which I can't find any binary versions.
wxPack has 2.8, and beyond that one has to get a compiler and build it locally from what I see.
There are tutorials on this from various sources, each a few pages long, with various advice on setup, changing configurations, etc. Install wxConfig, install minGW compilers, setup configurations, rebuild, etc.
Is there any source of a simple binary install? I'd hope for some simple apt-get or cabal like tool, Haskell library tools (on Windows?) seem less integrated than others that I'm familiar with.
(Update) I did install and compile wxWidgets locally, and still cannot get the wxHaskell components to install. I'm sure that all of this just requires some fairly simple details, but again after some time already, hope not to have to spend a lot more time on this, and wish it was more automated!
Configuring wxc-0.90.0.3...
Configuring wxc to build against wxWidgets 2.9
setup.exe: Missing dependencies on foreign libraries:
* Missing C libraries: wxmsw29ud_all, wxtiffd, wxjpegd, wxpngd, wxzlibd,
wxregexud, wxexpatd, wxregexud
This problem can usually be solved by installing the system packages that
provide these libraries (you may need the "-dev" versions). If the libraries
are already installed but in a non-standard location then you can use the
flags --extra-include-dirs= and --extra-lib-dirs= to specify where they are.
cabal: Error: some packages failed to install:
wx-0.90.0.1 depends on wxc-0.90.0.3 which failed to install.
wxc-0.90.0.3 failed during the configure step. The exception was: ExitFailure 1
wxcore-0.90.0.1 depends on wxc-0.90.0.3 which failed to install.
Yes, you can. CodeLite (C++ IDE I use) was recently upgraded to use wx29.
Since there are no binaries yet on repo, Dave set up some. Find all instruction in CodeLite's wiki below
wxWidgets 2.9 Packages and Repositories
If you are using windows Just go to download page for Codelite and download codelite with wxWidgets. Install it, copy the installed wxWidgets directory wherever it is needed!
Also it seems like there are official binaries. I have never tested download anything there so try yourself. The link is this one
Feel free to ask any question