On 28/07/12 22:30, Mark Mikofski wrote:
>> Or, to express it more succinctly, you have a mix of MinGW and MSYS
>> headers in your build environment; you must NEVER do this. (Your first
>> mistake was probably to install ANY PART of the MSYS System Builder tool
>> chain; 99.9% of users don't need it, shouldn't install it, and only
>> incur a mass of grief when they mistakenly do so).
> Also, if I have used mingw-get install msys-*, will that pollute my
> mingw toolchain, if my PATH is /opt/bin:/local/bin:/mingw/bin:/bin,
> if I always use prefix=/mingw and install in /local?
You are reading too much into that "ANY PART of MSYS System Builder".
You DO need to "mingw-get install msys-*", for the the components of the
shell environment you will use to build MinGW applications; what you
don't need are the additional components which are provided for the
explicit purpose of building MSYS ITSELF, (hence the system builder
The general rule of thumb is, that where similarly named packages are
provided, one named as mingw32-* and one as msys-*, most users should
install the mingw32-* variant, as the msys-* variant is intended for use
when BUILDING MSYS. (A further clue is often provided in the
description shown when you "mingw-get show msys-package-name"; Chuck has
often noted that "this is not the package you are looking for", when
most users should be installing a mingw32-* alternative).
Of course, there are users who contribute to MSYS itself, or to MSYS
spin-off projects, who DO need to install both tool chains; such users
need to take care that only MinGW headers and libraries are seen by the
compiler, and associated tools, when they invoke the mingw32 compiler,
and conversely, only the MSYS headers and libraries are seen by the MSYS
compiler. This is achieved, not only by reordering $PATH, (as LRN has
already noted), such that /mingw/bin precedes /bin for the mingw32, for
the mingw32 compiler, and /bin precedes /mingw/bin, (or /mingw/bin is
omitted entirely), for the MSYS compiler, but also by ensuring that any
-I paths specified in the CPPFLAGS, CFLAGS, and CXXFLAGS refer only to
directories containing exclusively mingw32 compatible headers, when
invoking the mingw32 compilers, and vice-versa for the MSYS compilers.
(Similarly, the LDFLAGS should point to exclusively compiler specific
libraries, for each case).
Note that the above does not preclude segregating the core MinGW
offerings from any add-on libraries, (and their associated headers),
which you may have built yourself, (or acquired from an alternative
source). You will find tips on setting things up in the following wiki
(In the third case, in particular, be sure to read the comments
following the article).