Difference between revisions of "Setup mingw"

From PLplotWiki
Jump to: navigation, search
(Setup)
Line 24: Line 24:
 
set PATH=%PLPLOTDIR%\dll;%PATH%
 
set PATH=%PLPLOTDIR%\dll;%PATH%
 
</pre>
 
</pre>
and save this to e.g. <tt>mingwvars.bat</tt>. If you installed the MinGW 3.4.5 command line tools, exchange in the script <tt>4.3.1</tt> with <tt>3.4.5</tt> (twice). Start you Windows CLI, cd into the directory where the batch file was saved and run <tt>mingwvars.bat</tt>. Run <tt>gcc --info</tt>, <tt>gfortran --info</tt> and <tt>gnat --info</tt> to see if everything works. Your MinGW developing environment is now ready.
+
and save this to e.g. <tt>mingwvars.bat</tt>. If you installed the MinGW 3.4.5 command line tools, exchange in the script <tt>4.3.1</tt> with <tt>3.4.5</tt> (twice). Start you Windows CLI, cd into the directory where the batch file was saved and run <tt>mingwvars.bat</tt>. Run <tt>gcc --version</tt>, <tt>gfortran --version</tt> and <tt>gnat --version</tt> to see if everything works. Your MinGW developing environment is now ready.
  
 
=== Links ===
 
=== Links ===
 
* MinGW Homepage: http://www.mingw.org
 
* MinGW Homepage: http://www.mingw.org
 
* TDM's Experimental GCC/MinGW32 Builds: http://www.tdragon.net/recentgcc/
 
* TDM's Experimental GCC/MinGW32 Builds: http://www.tdragon.net/recentgcc/

Revision as of 00:49, 29 August 2008

Setup MinGW command line tools

MinGW A collection of freely available and freely distributable Windows specific header files and import libraries, augmenting the GNU Compiler Collection, (GCC), and its associated tools, (GNU binutils). MinGW provides a complete Open Source programming tool set which is suitable for the development of native Windows programs that do not depend on any 3rd-party C runtime DLLs.

Download and install

  • The easiest way is to download the On demand TDM/MinGW Installer 1.808.1 and run it. This installer allows you to download and install the official MinGW command line tools 3.4.5 and then unofficial TDM's experimental GCC/MinGW32 builds (gcc 4.3.1).
  • Run the installer and press 'Create'. As installation directory I chose c:\MinGW-3.4.5 or c:\MinGW-4.3.1 depending on the gcc version I selected. To install gcc 4.3.1 choose the 'TDM-GCC Recommended, C/C++' type of install for gcc 3.4.5 choose 'MinGW stable, C/C++'. In addtion you can choose a fortran, ada, objc and objc++ language extension. After clicking 'Install' the packages will be downloaded and installed in the given directory.

Setup

To configure and compile plplot with MinGW it is best to use the Windows CLI. Please follow the instructions in [setup_cli Setup CLI] to get the Windows Command Line Interface ready for development. Then open your favorite text editor and enter the following CLI commands

@echo off

rem setup MinGW compiler
set MINGWDIR=C:\MinGW-4.3.1
set PATH=%MINGWDIR%\bin;%PATH%

rem add Ada support if you installed the ada package
set CMAKE_LIBRARY_PATH=%MINGWDIR%\lib\gcc\mingw32\4.3.1\adalib;%CMAKE_LIBRARY_PATH%

rem setup PLplot library
set PLPLOTDIR=path_to_plplot
set PLPLOT_LIB=%PLPLOTDIR%\data
set PATH=%PLPLOTDIR%\dll;%PATH%

and save this to e.g. mingwvars.bat. If you installed the MinGW 3.4.5 command line tools, exchange in the script 4.3.1 with 3.4.5 (twice). Start you Windows CLI, cd into the directory where the batch file was saved and run mingwvars.bat. Run gcc --version, gfortran --version and gnat --version to see if everything works. Your MinGW developing environment is now ready.

Links