Skip to content

Alternative to MSYS2

vmagnin edited this page Jan 27, 2020 · 3 revisions

You can try to use gtk-fortran under Windows without MSYS2, but do not expect much support in that case. You can read this interesting page about using "GTK-Fortran with Code::Blocks IDE" under Windows 7 64bits, and also Creating a GUI using GTK3 and gtk-fortran. See also the Fortran Tools document in the Useful links section.

Prerequisites

You will need:

Install

Install the dependencies manually.

PLplot

Windows binaries of PLplot are not distributed. Therefore you have to build your own binaries (after installation of MinGW and Cmake):

  • download from http://sourceforge.net/projects/plplot (latest version is 5.9.9)
  • extract the archive
  • cd to the extracted archive folder
  • mkdir build
  • cd build
  • cmake -DCMAKE_INSTALL_PREFIX=<installation directory> -DCMAKE_C_COMPILER=gcc -G "MinGW Makefiles" .. (be careful to use NO space in <installation directory>, e.g. C:\Program Files\PLplot will not work!!!)
  • mingw32-make
  • mingw32-make install
  • add <installation directory>\bin, <installation directory>\lib and <installation directory>\lib\plplot5.9.9\driversd to PATH
  • add <installation directory>\lib\pkgconfig to PKG_CONFIG_PATH

Known Problems and solutions

  • GTK libraries not found after installation: Do you have spaces in the installation directory name? (e.g. C:\Program Files\GTK will not work!!!) - Reinstall GTK in a directory without spaces.
  • Some GTK symbols are not found by the linker: Do you have older libgtk versions in PATH before the current version (installed by some other software, e.g. Graphviz)? - Prepend the directory with the current GTK libraries to PATH.

Status

gtk-fortran was successfully tested on the following Windows platforms:

  • Windows 7 (32 bits) with gfortran 4.6.0 20110115 (experimental) and the dll of GTK 2.22.1, put in the src directory.
  • Windows XP SP3 (32 bits) with gfortran 4.7.2-1 and GTK 2.24
  • Windows XP SP3 (32 bits) with gfortran 4.7.2-1 and GTK 3.6.1
Clone this wiki locally