Changes between Version 34 and Version 35 of CompilationGuide/MinGW


Ignore:
Timestamp:
Jun 15, 2016, 10:37:42 AM (3 years ago)
Author:
rogerdpack
Comment:

try to spruce up the msys2 docs, move mingw mainline down lower :|

Legend:

Unmodified
Added
Removed
Modified
  • CompilationGuide/MinGW

    v34 v35  
    1515== MinGW/MSys ==
    1616
    17 You basically have two options for a compiler: mingw "mainline" or mingw-w64.  Both offer working gcc's for windows.  The latter tends to be slightly more up to date than the former, and offers more library compatibility, like DirectShow headers, so preferably use mingw-w64.  The instructions here are basically for mingw "mainline", but the two are interchangeable.  Basically, you will install one "MinGW" package (MinGW or mingw-w64) and one ("MSys" or "Msys2"), MinGW provides gcc and headers, MSys provides shell utilities like make and bash.  Also of note is that the Msys2 system appears to include some packages like "mingw-w64-i686-gcc" (i.e. cross compilers) that might be useful if you want to go the cross compiling [but still in windows land] route, similar to cross compiling using cygwin.
     17You basically have two options for a compiler: mingw "mainline" or mingw-w64.  Both offer working gcc's for windows.  The latter tends to be slightly more up to date than the former, and offers more library compatibility, like DirectShow headers, so preferably use mingw-w64.  The instructions here are basically for mingw "mainline", but the two are interchangeable.  Basically, you will install one "MinGW" package (MinGW or mingw-w64) and one ("MSys" or "Msys2"), MinGW provides gcc and headers and change, Msys provides shell utilities like make and bash.  Also of note is that the Msys2 system appears to include some packages like "mingw-w64-i686-gcc" (i.e. cross compilers) that might be useful if you want to go the cross compiling [but still in windows land] route, similar to cross compiling using cygwin.
     18
     19=== mingw-w64 ===
     20
     21MinGW-w64 (arguably like MinGW but with better header files) can be found at:
     22
     23http://mingw-w64.sourceforge.net (note this project does not have downloadable compilers by default, you'll probably want the "mingw-builds" project, which provide pre-built compilers, see list of options here: http://stackoverflow.com/a/20502212/32453 and here http://mingw-w64.org/doku.php/download).
     24
     25To use mingw-w64, basically install Msys using the MinGW setup, as above, but only check the "msys for developers option".  Then install a mingw-w64 compiler (see http://ingar.satgnu.net/devenv/mingw32/base.html).  Here is an example: http://www.helyar.net/2014/compile-ffmpeg-64-bit-on-windows-with-msysmingw-w64
     26
     27Then configure your PATH appropriately, for instance mine looks like this: c:\installs\mingw-w64\i686-4.9.2-posix-dwarf-rt_v3-rev0\mingw32\bin;c:\MinGW\msys\1.0\bin... being the beginning of the PATH.  In this case, the MINGW_PATH would be C:\installs\mingw-w64\i686-4.9.2-posix-dwarf-rt_v3-rev0\mingw32
     28
     29Also note that to access directshow input devices you have to use the mingw-w64 as the compiler (or cross compiler), as straight MinGW headers don't have this functionality apparently.
     30
     31And to install libraries you'd either use ./configure --prefix=/usr/local or--prefix=/c/installs/mingw-w64/i686-4.9.2-posix-dwarf-rt_v3-rev0/mingw32/i686-w64-mingw32
     32
     33The latter if you wanted to install something to your MINGW_PATH itself...
     34
    1835
    1936=== MinGW ===
     
    5471}}}
    5572
    56 === mingw-w64 ===
    57 
    58 MinGW-w64 (arguably like MinGW but with better header files) can be found at:
    59 
    60 http://mingw-w64.sourceforge.net (note this project does not have downloadable compilers by default, you'll probably want the "mingw-builds" project, which provide pre-built compilers, see list of options here: http://stackoverflow.com/a/20502212/32453 and here http://mingw-w64.org/doku.php/download).
    61 
    62 To use mingw-w64, basically install Msys using the MinGW setup, as above, but only check the "msys for developers option".  Then install a mingw-w64 compiler (see http://ingar.satgnu.net/devenv/mingw32/base.html).  Here is an example: http://www.helyar.net/2014/compile-ffmpeg-64-bit-on-windows-with-msysmingw-w64
    63 
    64 Then configure your PATH appropriately, for instance mine looks like this: c:\installs\mingw-w64\i686-4.9.2-posix-dwarf-rt_v3-rev0\mingw32\bin;c:\MinGW\msys\1.0\bin... being the beginning of the PATH.  In this case, the MINGW_PATH would be C:\installs\mingw-w64\i686-4.9.2-posix-dwarf-rt_v3-rev0\mingw32
    65 
    66 Also note that to access directshow input devices you have to use the mingw-w64 as the compiler (or cross compiler), as straight MinGW headers don't have this functionality apparently.
    67 
    68 And to install libraries you'd either use ./configure --prefix=/usr/local or--prefix=/c/installs/mingw-w64/i686-4.9.2-posix-dwarf-rt_v3-rev0/mingw32/i686-w64-mingw32
    69 
    70 The latter if you wanted to install something to your MINGW_PATH itself...
    71 
    72 Alternatively, you can install the MSYS2 system:
     73=== MSYS2 ===
     74
     75Alternatively, you can install GCC along with the MSYS2 system:
    7376
    7477https://msys2.github.io/
     
    7881pacman -S mingw-w64-x86_64-gcc
    7982pacman -S mingw-w64-i686-gcc
     83pacman -S make
     84pacman -S diffutils
    8085}}}
    8186
    82 and run the {{{mingw32_shell.bat}}} or {{{mingw64_shell.bat}}} command in the MSYS2 installation home. If you use MSYS2 many packages can be easily installed by using {{{pacman}}} (for example {{{pacman -S pkg-config}}}). Then proceed to compile it using the cross compilation.
     87This installs "gcc.exe" commands that are actually built for MSYS2 but are the windows gcc compilers.
     88
     89and run the {{{mingw32_shell.bat}}} or {{{mingw64_shell.bat}}} command in the MSYS2 installation home. If you use MSYS2 many packages can be easily installed by using {{{pacman}}} (for example {{{pacman -S pkg-config}}}). Then configure and make as normal.
    8390
    8491=== MinGW installation style ===