Mingw vs msys2

I'm also confused about the difference between the shells, and which to use, even after reading the wiki, which currently says: "Use msys2 shell for running pacman, makepkg, makepkg-mingw and for building POSIX-dependent software that you don't intend to distribute.

Install gcc compiler on Windows with MSYS2 for C/C++

Use mingw shells for building native software and other tasks. Does it really matter which shell is used to run pacman? Do I really need to open an msys2 shell to run pacman? Is the msys2 shell pretty much for developers wanting to develop new msys2 packages? That's just too vague to be helpful. Does "other tasks" include running pacman? If so, the the description about msys2 is misleading. Bottom line, it would be nice if the wiki was clearer and more directly related to what a user needs to know.

I would take a stab at editing it, I can write well, but I don't know the answers. I can at least point out the problem areas and unanswered issues, as a user trying to understand msys2. I can't speak for all users, I expect some want to develop msys2 software or shell scripts or python or whatever and all that can be done without using native mingw-w64 software.

It depends. If you only need to run bits of mingw-w64 software occasionally then using the full path to it will sometimes work ok. A concrete example of that would be 'sed'. THis is just my opinion though.

We don't provide multilib builds of GCC so you can't use -m32 and -m At present multilib GCCs would compromise the choice of exception handling as it's not possible to specify different types for each arch.

Maybe we should write shell functions to switch the shells, that way it wouldn't seem like such a big upfront choice? You are welcome to submit suggested changes for the wiki to the msys2-users mailing list, or even open issues here since the formatting won't get mangled.

Well, if you can use any shell to run pacman, the the wiki seems misleading, because it says "Use msys2 shell for running pacman, I don't understand the sed example you offer. I ran pacman -S sed in all three shells, let it reinstall, and at the end there is still just one sed.

Using GCC with MinGW

And each time it installs, it's exactly the same file same md5sum. I guess it's re-installing from the cache directory. Anyway, I don't see how a post-install script could run the wrong variant, because there seems only one variant. I'm not saying you're wrong. You know better than me, I'm just reporting what I see. If there are really are potential problems, pacman should probably issue a warning when it starts up from a mingw shell.

If yes, maybe that would be a topic for the wiki, to explain the advantages over using shell scripts and make what I'm used to using. Directly related to the above paragraph, what do you mean by "build their own native software"?

Native windows? Native msys2? Something else? Thanks for clarifying cannot use -m32 and -m64 flags. That's OK with me. Here's a possible suggestion, have a FAQ or wiki section "Places where msys2 reported to differ from man page". Anytime one is reported, just add it, with a brief explanation.

I can start off with three possible examples: 1 ln -s makes a copy 2 gcc file requires windows paths 3 -m32 -m64 don't work.MSYS2 is a collection of tools and libraries providing you with an easy-to-use environment for building, installing and running native Windows software.

It consists of a command line terminal called minttybash, version control systems like git and subversion, tools like tar and awk and even build systems like autotools, all based on a modified version of Cygwin. Despite some of these central parts being based on Cygwin, the main focus of MSYS2 is to provide a build environment for native Windows software and the Cygwin-using parts are kept at a minimum.

To provide easy installation of packages and a way to keep them updated it features a package management system called Pacmanwhich should be familiar to Arch Linux users. It brings many powerful features such as dependency resolution and simple complete system upgrades, as well as straight-forward and reproducible package building. Our package repository contains more than pre-built packages ready to install.

SHA checksum: eeead63e0db08e1b7ac47f90a2ea43df0a1b53d9afcc5f To Paypal account: alexpux gmail. Skip to content. MSYS2 requires 64 bit Windows 7 or newer.Use this information at your own risk. If you are developing exclusively for Windows, that is the tool I would recommend.

We will cover how to install gcc using MSYS2. Another option for using gcc in Windows is to download Code::Blocks. They provide binary releases that come with the Mingw toolchain. Qt Creator is another free IDE that optionally comes with the mingw toolchain.

If you do not need to target Windows specifically, but you are just looking to learn and play with the GNU toolchain and you have a windows machine, I recommend installing Ubuntu or Suse on Windows through the Microsoft Store.

This will provide a Linux environment in Windows for you to work with. Download the. After installing, navigate to the directory where it was installed, and run msys2.

After opening it you should find yourself in a bash shell. After your initial install it is a good idea to update all the packages. Update everything using:. In the MSYS2 bash shell, use pacman again to install the build toolchain and compilers. Note that vim and cmake are optional, but handy to have.

Here is the list of packages that are installed with the above. After installing those packages, you will have gcc and the other tools available to be used while in the MSYS2 shell.

After installing the above the. Some of the executables that will be available are: awk, base64, curl, dd, diff, dos2unix, file, gcc, gdb, gpg, grep, gzip, head, hexdump, hostname, ld, ldd, ls, make, man, md5sum, merge, mkdir, more, mv, objdump, openssl, perl, python2, python2.

Keep this in mind when making the decision to add the bin directory to your Windows PATH environment variable. If you want to compile an SSL program that links to libssl and libcrypto with -lssl -lcrypto you will need to install openssl-devel as shown below. There are many other devel packages. For example, libbz2-devel, libelf-devel, libunrar-devel, and libyaml-devel. The environment is rather limited, but it can be useful for learning.

You also have a ton of other packages available via the pacman package manager.It is intended to supplement MinGW and the deficiencies of the cmd shell. An example would be building a library that uses the autotools build system. Users will typically run ". The configure shell script requires a shell script interpreter which is not present on Windows systems, but provided by MSYS. Users looking for such functionality should look to Cygwin or Microsoft's Interix instead.

Up to MSYS 1. While convenient, this made it difficult to update individual components. These instructions were based on the Enlightenment Wiki.

Thanks to Vincent Torri for pointing them out. Be sure to have enough space on your hard disk. Now you should have a cyan "M" link on the Desktop. When you double-click on it, a terminal should be launched. To install 3rd party library and applications which uses the autotools build system the following commands are often used. It should never be treated as a targeted platform. Resulting programs will only run under MSYS.

Normally, sed will append "! When running the post-install script, there is a couple of "- Cannot open" errors :. I think there might be some problem with the "sh" program. These are known issues. The LF vs.

CRLF line ending issue is a packaging bug, which should be addressed fairly quickly, but I am not the maintainer, and cannot say exactly when he will complete the repackaging exercise. The "cannot open" issue arises because, in fixing another problem, a dependency on a feature which is unsupported in Win9x was introduced.

mingw vs msys2

The cause is known, and a work around is under investigation. Please be patient. We will endeavour to continue to support you, but your choice of a now-obsolete operating system makes that more difficult for us, and you will become increasingly prone to this type of issue. I've just installed the release version 1. Without wanting to look ungrateful, I have some comments:. I didn't update bash or coreutils, because there are no links. Yes, I know I could go and look. I can indeed find some files that look like coreutils, but I'm then not sure what to do with them safely.

I didn't understand the command. The Enlightenment wiki suggests ". I had a working system except for this bug during several attempts to reinstall, and didn't realise!

mingw vs msys2

Also, I seem to have been hit by a restriction of how much memory can be allocated to a fixed-size array in a C program.By using our site, you acknowledge that you have read and understand our Cookie PolicyPrivacy Policyand our Terms of Service. Stack Overflow for Teams is a private, secure spot for you and your coworkers to find and share information. It enlightens on the subject and is essential preamble to my question.

Each system has its own repository of software packages in the MSYS2 distribution.

How to Install MSYS2 with MinGW-w64

It's not like we replaced every Linux API call ourselves; most of the upstream projects do this work for us since they already provide Windows ports, but yes sometimes we have to do it. We also add special relocation patches to a lot of the software so that you are free to install the root the whole thing e.

We never add MSYS2 packages without making sure there is a need for them. If you don't know that you need the MSYS2 version of something, then install the appropriate Native Windows one instead. IMHO Python is doing a bad job of abstracting the OSes here and that's a fundamental thing that a scripting language should do, and fcntl and pyWin32 should not exist, but I'm not the boss of Python. Fortunately, Pacman has dependency management and will install the stuff needed for whatever packages you are actually interested in.

GNU Autotools will never work well except via a FHS compliant system with a POSIX shell, and this naturally leads to other tools needing to exist in the same filesystem namespace, such as make, perl, m4, bison, flex etc etc. There are other minor env.

As regards, pacman it is not totally true that it is not affected, as from David Grayson comment. MSYS2 wiki vaguely affirms that:. Use msys2 shell for running pacman, makepkg, makepkg-mingw and for building POSIX-dependent software that you don't intend to distribute. Use mingw shells for building native software and other tasks. Ray Donnelly clarifies the things again in another post :. A concrete example of that would be 'sed'. The immediate significant differences are in the related values of the path variables identified by David Grayson.

Are there any binaries that make a specific use of this variable? The intention behind the three choices was to give you the option of two different development environments:. Think of this as where you will do your end-user development. Software that won't normally be run inside of the MSYS2 environment itself.

Think of this as where you will do development for the tools that are actually running inside Msys2. Or, you can think of this like you would Cygwin. You can get more information on this subject in this thread on the MSYS2 sourceforge forum. Learn more. MSYS vs. MinGW: internal environment variables Ask Question. Asked 4 years, 4 months ago. Active 3 years, 9 months ago. Viewed 13k times. Is pacman affected by the subsystem? Active Oldest Votes. MSYS2 wiki vaguely affirms that: Use msys2 shell for running pacman, makepkg, makepkg-mingw and for building POSIX-dependent software that you don't intend to distribute.

The intention behind the three choices was to give you the option of two different development environments: MinGW: intended for development of native Windows applications.We use optional third-party analytics cookies to understand how you use GitHub.

Learn more. You can always update your selection by clicking Cookie Preferences at the bottom of the page. For more information, see our Privacy Statement. We use essential cookies to perform essential website functions, e. We use analytics cookies to understand how you use our websites so we can make them better, e. Skip to content. Instantly share code, notes, and snippets. Code Revisions 1 Stars 16 Forks 2.

Subscribe to RSS

Embed What would you like to do? Embed Embed this gist in your website. Share Copy sharable link for this gist. Learn more about clone URLs. Download ZIP. MSYS is a fork of Cygwin msys. MinGW: It does not have a Unix emulation layer like Cygwin, but as a result your application needs to specifically be programmed to be able to run in Windows, MinGW forked from version 1. This means, other than Cygwin, MinGW does not attempt to offer a complete POSIX layer on top of Windows, but on the other hand it does not require you to link with a special compatibility library.

Cygwin comes with the MingW libaries and headers and you can compile without linking to the cygwin1. This does not work any more with cygwin 1. It is intended to supplement MinGW and the deficiencies of the cmd shell. An example would be building a library that uses the autotools build system. Users will typically run ". The configure shell script requires a shell script interpreter which is not present on Windows systems, but provided by MSYS.

Users looking for such functionality should look to Cygwin or Microsoft's Interix instead.

mingw vs msys2

The MSYS2 variant of this library is called msys MSYS is a fork of an old Cygwin version with a number of tweaks aimed at improved Windows integration, whereby the automatic POSIX path translation when invoking native Windows programs is arguably the most significant.

This comment has been minimized.Here are some topics and milestones that deserve more discussion or work. This page should serve as an overview of our long-term issues and goals and be a place to write down the decisions and open questions so that they don't get buried in IRC logs or mailing list archives. Each goal should be described in appropriate detail and should be broken up into smaller tasks for interested members to tackle the goal step by step.

People are sometimes often? It would be great if all the user-facing parts were on msys2. Back-ends can be wherever mailing lists and big file storage would be examples of things that we can't do with GitHub. Git for Windows sets a particularly good example. For a long time, alexpux was responsible for building all packages. Ray, Renato, Qian, and other people had tried to use various CI platforms, with varying results.

Now elieux is only responsible for uploading and signing them. MSYS2 is quite known but it's not obvious e. The naming clash of MSYS2 the distribution vs. There has been some talk about modifying Cygwin to make it pluggable so that the MSYS2 runtime can be reduced to a plugin DLL that will make all the desired behavior changes. It would be nice if people could just install one POSIX emulation layer and have everything available from there.

Where possible, we shouldn't maintain a bunch of patches, but rather polish them and have them accepted by upstreams. Another change to consider is to start building only release versions of the core packages. Although MSYS2 is a rolling release distro, there seems to be little need to use less tested, potentially more buggy code directly from git.

Currently the mingw-w64 toolchains are the most prominent examples.

mingw vs msys2

Altough we are probably not so big among end-users yet, a lot of cross-platform developers know about MSYS2 and support it and even some big projects use it for their official builds. Some applications and environments use MSYS2 internally. We should get in touch with them and help them it is, after all, one of the core goals of the project.

The MSYS2 team is pretty small and we could use more people. Some contributors become pretty active and motivated from time to time, but often they burn out after a while. Since there are so few of core people, the occasional interested users, contributors and issue reporters are often greeted by silence and turned off.

The runtime emulates extension-less executables by also looking for. There are more of these hacks, for example for symlink emulation. This is causing pacman to complain when two packages independently provide both foo and foo. People have to either disregard these conflicts with --force or re- install packages in a specific order. A possible solution to these conflicts would be to disable the.

Therefore there also has to be a change that will mitigate that. We can for example design some passes for makepkg :. It would be nice to allow people to have as complete as possible GNU-like environment without having to fall back to msys2 bash and the likes. Ideas for solutions:. Skip to content. Table of contents Unify public relations, solidify hosting Off-load package building and uploading Official release Merge with Cygwin Connect with upstreams Connect with downstreams Get more people Fix pacman errors wrt.


Leave a Reply

Your email address will not be published. Required fields are marked *