Reputation: 13
I am attempting to learn c++ programming. I am writing these programs on Windows Vista using the Codeblocks IDE, but since I was to learn Linux, I would like to learn to write my programs with as much portability as I can.
I already downloaded the mingw compiler to use with Codeblocks, but while trying to download the GTK dependencies to try playing around with GUI, I downloaded msys2. I noticed that this program also has you to download Mingw32 and or mingw64. Are these packages complete enough that I can delete my previous instance of mingw, or do I need to keep the other mingw package that I had already downloaded in order to compile and run my programs?
Upvotes: 1
Views: 5023
Reputation: 87486
Yes, MSYS2 is a complete development environment with a package manager, compilers, and build tools. You do not need to have any kind of external tools installed in order to develop portable C++ code with MSYS2.
Keep in mind that MSYS2 supports three different subsystems. You select which subsystem to use when you click on one of the three shortcuts in the start menu for starting a shell. The Win64 and Win32 shells, and their compiler toolchain packages mingw-w64-x86_64-toolchain
and mingw-w64-i686-toolchain
, allow you to write native Windows applications that just depend on a few runtime DLLs. The MSYS2 shell allows you to write applications that depend on msys-2.0.dll, which is a fork of Cygwin that provides better emulation of POSIX (so programs designed for Linux are more likely to work). If you want your code to be portable, I think you want it work in all three of those environments. You can also use VirtualBox or VMware to install Linux on your machine and develop your code in a virtual machine.
Upvotes: 3
Reputation: 1736
Find gcc in your msys-git directory and you'll know. Normally, it is missing and in this case, you should keep your full mingw setup. Also, if you want an real linux emulation, use cygwin, not mingw wich just provide a compiler (but not the Linux syscalls etc.)
Upvotes: 0