plplot 5.9.1 on Windows XP

  • charvey

    charvey - 2009-01-11


    I downloaded and compiled plplot 5.9.1 on Windows using cmake and mingw. It all seemed to go well. I then built some of the examples and that seemed to go fine. However when I run the program for any of the examples, it just quits with no error messages. I've no idea why.

    I'll be doing most of the developing on Mac OS and I successfully did all of that on my Mac just a few minutes prior. I need to distribute the project for Mac, Windows and Linux and I'm just making sure I compile the examples on all OS's before pushing ahead with the project.

    The only 'strange' thing I had to do was put absolute locations in the makefile and the header files to the plplot includes and the plplot libraries, i.e. C:\Program files\plplot\include and \lib\*.a. It wouldn't compile without this. Messy way of doing it I know, but for me it was the quickest fix. Everything else was according to the documentation.

    Sorry I haven't given much information. I don't know what else I can tell you.

    Any help is greatly appreciated,

    • Werner Smekal

      Werner Smekal - 2009-01-11


      regarding the examples, which quit without messages:

      * what is your exact call to cmake, how to you configure the build? It would also be helpful if you could post the output of cmake
      * where do you run the examples? In the build tree or in the install tree? How do you run them?

      regarding cross platfrom: I regularily compile and run plplot on Mac OS X, Linux and Windows, so no problem here, I also use it for a project which runs on all three platforms.

      regarding absolute paths: where do you put them? In the examples or in your code?


    • charvey

      charvey - 2009-01-11

      Hi Werner,

      Thanks for your prompt reply. I try to answer each of your questions below:

      - Exact calls to cmake

      I tried both of these (from\):

      cmake -G "MinGW Makefiles" -DCMAKE_INSTALL_PREFIX=install ..
      cmake -G "MinGW Makefiles" -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=install ..

      I thought I'd also try a static build in case it wasn't finding and loading the libraries. It made no difference.

      - Output from cmake

      C:\plplot-5.9.1\plplot-build>cmake -G "MinGW Makefiles" -DCMAKE_INSTALL_PREFIX=i
      nstall ..
      -- WARNING: bash shell not found, ctest will not work properly
      -- Checking whether system has ANSI C header files
      -- ANSI C header files - found
      -- SWIG was not found. Please specify Swig executable location
      -- Could NOT find Perl  (missing:  PERL_EXECUTABLE)
      -- Looking for pkg-config - not found
      -- WARNING: Install-tree build will be disabled.
      -- X11_FOUND =
      -- X11_INCLUDE_DIR =
      -- X11_COMPILE_FLAGS =
      -- X11_LIBRARIES =
      -- ENABLE_tcl is OFF so disabling everything else that is Tcl/Tk related
      -- WARNING: pango not found because pkg-config not available.
      -- Looking for gdi32 header and library
      -- Looking for gdi32 header and library - found

      Summary of CMake build system results for PLplot

      Install location variables which can be set by the user:
      CMAKE_INSTALL_PREFIX:      C:/plplot-5.9.1/plplot-build/install
      CMAKE_INSTALL_EXEC_PREFIX  C:/plplot-5.9.1/plplot-build/install
      CMAKE_INSTALL_BINDIR       C:/plplot-5.9.1/plplot-build/install/bin
      CMAKE_INSTALL_DATADIR      C:/plplot-5.9.1/plplot-build/install/share
      CMAKE_INSTALL_LIBDIR       C:/plplot-5.9.1/plplot-build/install/lib
      CMAKE_INSTALL_INCLUDEDIR   C:/plplot-5.9.1/plplot-build/install/include
      CMAKE_INSTALL_INFODIR      C:/plplot-5.9.1/plplot-build/install/share/info
      CMAKE_INSTALL_MANDIR       C:/plplot-5.9.1/plplot-build/install/share/man

      Derived install location variables:
      DATA_DIR        C:/plplot-5.9.1/plplot-build/install/share/plplot5.9.1
      LIB_DIR         C:/plplot-5.9.1/plplot-build/install/lib
      INCLUDE_DIR     C:/plplot-5.9.1/plplot-build/install/include/plplot
      BIN_DIR         C:/plplot-5.9.1/plplot-build/install/bin
      TCL_DIR         C:/plplot-5.9.1/plplot-build/install/share/plplot5.9.1/tcl
      ADA_INCLUDE_DIR C:/plplot-5.9.1/plplot-build/install/share/ada/adainclude/plplot
      ADA_LIB_DIR     C:/plplot-5.9.1/plplot-build/install/lib/ada/adalib/plplotadad
      DRV_DIR         C:/plplot-5.9.1/plplot-build/install/lib/plplot5.9.1/driversd
      DOC_DIR         C:/plplot-5.9.1/plplot-build/install/share/doc/plplot
      MAN_DIR         C:/plplot-5.9.1/plplot-build/install/share/man
      INFO_DIR        C:/plplot-5.9.1/plplot-build/install/share/info

      Other important CMake variables:

      CMAKE_SYSTEM_NAME:      Windows
      WIN32:                  1
      MSVC:                           (MSVC_VERSION:  )
      MINGW:                  1

      SWIG_FOUND:             FALSE
      PERL_FOUND:             FALSE

      CMAKE_C_COMPILER CMAKE_C_FLAGS:                 C:/MinGW/bin/gcc.exe
      CMAKE_CXX_COMPILER CMAKE_CXX_FLAGS:             C:/MinGW/bin/g++.exe
      LIB_TAG:                d

      DRIVERS_LIST: hpgl;mem;null;pbm;ps;svg;wingcc;xfig
      DEVICES_LIST: hp7470;hp7580;lj_hpgl;mem;null;pbm;ps;svg;wingcc;xfig

      Library options:
      BUILD_SHARED_LIBS:      OFF             PL_DOUBLE:      ON

      Optional libraries:
      HAVE_QHULL:             OFF             WITH_CSA:       ON
      HAVE_FREETYPE:                          HAVE_PTHREAD:

      Language Bindings:
      ENABLE_f77:             OFF             ENABLE_f95:             OFF
      ENABLE_cxx:             ON              ENABLE_java:            OFF
      ENABLE_python:          OFF             ENABLE_octave:          OFF
      ENABLE_tcl:             OFF             ENABLE_itcl:            OFF
      ENABLE_tk:              OFF             ENABLE_itk:             OFF
      ENABLE_pdl:             OFF             ENABLE_wxwidgets:       OFF
      ENABLE_gnome2:          OFF             ENABLE_pygcw:           OFF
      ENABLE_ada:             OFF             ENABLE_d:
      ENABLE_ocaml:           OFF

      -- Configuring done
      -- Generating done
      -- Build files have been written to: C:/plplot-5.9.1/plplot-build

      - Examples

      I was running the examples from the build tree. I also just compiled and ran a simple program which just calls plinit() in main(), i.e. the most basic case I could think of. On the mac, the gives me a choice of output devices. On Windows, it just quits immediately.

      I ran them from the command line (i.e. cmd) and I tried just a double-click on the exe in explorer as well.

      - Absolute paths

      I haven't done any of my own coding with PLplot yet (this is icing on the cake hopefully squeezed into the project just a couple of days before an interim submission to my uni tutor). The absolute paths were added to the example codes.

      i.e. in it has:
      #include "plevent.h" which I changed to #include "C:/Program Files/plplot/include/plplot/plevent.h"
      and in plc++demos.h it has:
      #include "plstream.h" which I changed to #include "C:/Program Files/plplot/include/plplot/plstream.h"

      Making the changes allowed it to compile.

      When linking it, this doesn't work:
      g++ x01.o -lplplotd -lplplotcxx -o x01.exe
      I therefore did:
      g++ x01.o "C:\PROGRA~1\plplot\lib\libplplotcxxd.dll.a" "C:\PROGRA~1\plplot\lib\libplplotd.dll.a" -o x01.exe

      It then links fine but won't run.

      I know I need to set up my MinGW environment to find the PLplot includes and libraries, but I don't know how to do that (I'll google it later). Surley the fact it compiles and links indicates it's probably not absolute paths causing the problem? It don't know though, which is why I'm here.

      Thanks very much,

      • Werner Smekal

        Werner Smekal - 2009-01-13

        Hi Chris,

        this seems all to be ok, apart from the way how you compile the examples. As in Mac OS X and Linux you tell gcc where the header files can be found with "-IC:/Program Files/plplot/include/plplot" and where the libraries are found with "-LC:\PROGRA~1\plplot\lib -lplplotcxxd.dll". The libraries may also be linked in as you did.

        CMake can be configured so that all examples are build automatically and this is what you should try first. The corresponding option is


        (see\). The examples are then in build_tree/examples/c. cd into this directory and run the examples. If you have a shared library you must first set the path in the cli so that the dlls can be found:

        set PATH=build_tree/dll:%PATH%

        It seems that the examples don't run, since the dlls can't be found, and if you alway linked to "C:\PROGRA~1\plplot\lib\libplplotd.dll.a" also the static build won't work. If this works ok, then you should have a look how the examples are build. First clean the build tree

        mingw32-make clean

        and then run make again with the VERBOSE=1 option

        mingw32-make VERBOSE=1

        This time the make process is verbose about what it is doing and you can see in the CLI then what options are used to build the examples. Copy them more or less in you Makefile/Batch file/whatever and you should be ok.


    • charvey

      charvey - 2009-01-13


      Thanks very much for your help. It all works now.

      I ran the build cmake with -DBUILD=ON and all the examples compiled.

      Running mingw32-make VERBOSE=1 was the most helpful - I could see exactly what I need to put in my makefile. I must remember this tool!

      Thanks again,


Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks