Menu

wxwidgets driver on windows xp

John Smith
2008-09-02
2013-03-15
  • John Smith

    John Smith - 2008-09-02

    Hi,

    I managed to install Plplot (from svn 31/08/2008) on xp sp3 and run the examples with the wiki instructions but I would like to use plplot with wxwidgets (2.8.8) to have "interactive" plots. For example I clic on a plot to select a range, and then do some action on the datas in this range.

    I tried to use the cmake (2.4.8) GUI to activate the use of wxwidgets driver but I'm having a few problems :

    1. When I clic configure, a big "Error" windows appears with all the parameters. If I press tab and enter, I get 3 parameter lines in red at the top of the GUI. I clic configure again, same "Error" window, tab and enter then the ok button become available and I can configure and go out.

    2. After that, I get a Visual studio (2005) sln project which compile without errors (with the examples).

    3. But when I run an example, I get a plot that is completely black. If I run the wxWidget example, it crashes.

    Is there someone who knows what is happening ?

    Is there a method to make the wxwidgets available on xp ?

    thanks.

    John

     
    • Werner Smekal

      Werner Smekal - 2008-09-06

      Hi John,

      I'm the developer of the wxWidgets driver and I work regularilry with Windows XP, Mac OS X and Linux and the driver works more or less on all three platforms. I've never used the project files, but only the nmake Makefiles cmake generator, so in principal it should work with Visual C++ 2005 (I actually use VC++ 2008, but that shouldn't make too much difference).

      So I would need to follow your instructions to see if I get the same problems, but for the next two weeks I have not much time available, so you have to wait a little. Especially for the example where a crash occurs you could use the debugger (which is very good for VC++) to find the problem or being able to give me some more information. This black screen plots occured before and had to do with libraries not being available, which I normally use - so some code was not proper #ifdef out.

      You could try to use 5.8.0 or better 5.9.0 of plplot, since I rewrite major parts of the wxWidgets driver after that releases, without adding features.

      HTH,
      Werner

       
    • Michele

      Michele - 2009-01-28

      Hello Werner,

      I am trying to develop a "portable" application which has a GUI displaying some scientific plots. I thought wxWidgets and PlPlot could have done for me, but I cannot have it working. I tried many configurations, including the last versions of all the packages (January 28th 2009: PlPlot 5.9.2, wxWidgets 2.8.9, mingw32-make 3.81, GNU gcc 3.4.5).

      Could you please mention one WORKING configuration (versions, command lines to be used) to compile applications with PlPlot and wxWidgets using MinGW (GNU gcc) on WindowsXP/Vista?

      Cheers,
      Michele

       
      • Werner Smekal

        Werner Smekal - 2009-01-28

        Hi Michele,

        PlPlot 5.9.2, wxWidgets 2.8.9, mingw32-make 3.81, GNU gcc 3.4.5 sound good to me (since I use the same). In addition you need cmake 2.6.2. First try to compile wxWidgets - to get things going, exactly follow the instructions here:

        http://www.miscdebris.net/plplot_wiki/index.php?title=WxWidgets#Instructions_for_Windows

        Then cd into the same directory as plplot was unzipped.

        mkdir build
        cd build
        cmake -G "MinGW Makefiles" -DBUILD_TEST=ON -DENABLE_f77=OFF -DwxWidgets_CONFIGURATION=mswu -DENABLE_MIX_CXX=ON ..\plplot-5.9.2
        mingw32-make

        After the cmake call check if wxwidgets is listed for the available drivers. After mingw32-make run

        examples\c\x01c.exe

        wxWidgets should be available as driver. CHoose it. Enjoy.

        If not, please post the complete output of cmake. And the complete output of mingw32-make VERBOSE=1.

        Regards,
        Werner

         
    • Michele

      Michele - 2009-02-02

      Hello Werner,
      thank you for the swift reply.
      I unzipped wxWidgets into c:\wx and plplot into c:\plplot
      wxWidgets compiles fine.
      Then I create and move in c:\plplot\build

      Your command needs to be modified as follows:

      cmake -G "MinGW Makefiles" -DBUILD_TEST=ON -DENABLE_f77=OFF -DwxWidgets_LIB_DIR=%WXWIN%/lib/gcc_dll -DwxWidgets_CONFIGURATION=mswu -DENABLE_MIX_CXX=ON ..\

      otherwise it won't work. Please note that I have to modify
      - C:\plplot\bindings\wxwidgets\CMakeLists.txt
      - C:\plplot\drivers\CMakeLists.txt
      - C:\plplot\examples\c++\CMakeLists.txt
      adding

      if(COMMAND cmake_policy)
          cmake_policy(SET CMP0003 NEW)
      endif(COMMAND cmake_policy)

      where requested.

      Then, first I get the following error message:

      mingw32-make[2]: Leaving directory `C:/plplot/build'
      mingw32-make -f bindings\CMakeFiles\pkgIndex.tcl.dir\build.make bindings/CMakeFiles/pkgIndex.tcl.dir/build
      mingw32-make[2]: Entering directory `C:/plplot/build'
      cd C:\plplot\build\bindings && copy C:/plplot/build/bindings/tcl/pkgIndex.tcl pkgIndex.tcl
      The syntax of the command is incorrect.
      mingw32-make[2]: *** [bindings/CMakeFiles/pkgIndex.tcl] Error 1
      mingw32-make[2]: Leaving directory `C:/plplot/build'
      mingw32-make[1]: *** [bindings/CMakeFiles/pkgIndex.tcl.dir/all] Error 2
      mingw32-make[1]: Leaving directory `C:/plplot/build'
      mingw32-make: *** [all] Error 2

      Then correcting the command line in "C:/plplot/build/bindings/CMakeFiles/pkgIndex.tcl.dir/build.make" to use the right slashes, I get this:

      Linking CXX shared library ..\..\dll\libplplotwxwidgetsd.dll
      cd C:\plplot\build\bindings\wxwidgets && "C:\Program Files\CMake 2.6\bin\cmake.exe" -E cmake_link_script CMakeFiles\plplotwxwidg
      etsd.dir\link.txt --verbose=1
      C:\MinGW\bin\g++.exe    -shared -o ..\..\dll\libplplotwxwidgetsd.dll -Wl,--out-implib,..\..\dll\libplplotwxwidgetsd.dll.a -Wl,--
      major-image-version,0,--minor-image-version,0 CMakeFiles\plplotwxwidgetsd.dir\wxPLplotstream.obj CMakeFiles\plplotwxwidgetsd.dir
      \wxPLplotwindow.obj ..\..\dll\libplplotcxxd.dll.a C:\wx\lib\gcc_dll\libwxbase28u.a C:\wx\lib\gcc_dll\libwxmsw28u_core.a C:\wx\li
      b\gcc_dll\libwxpng.a C:\wx\lib\gcc_dll\libwxtiff.a C:\wx\lib\gcc_dll\libwxjpeg.a C:\wx\lib\gcc_dll\libwxzlib.a C:\wx\lib\gcc_dll
      \libwxregexu.a C:\wx\lib\gcc_dll\libwxexpat.a -lwinmm -lcomctl32 -lrpcrt4 -lwsock32 ..\..\dll\libplplotd.dll.a ..\..\dll\libcsir
      ocsa.dll.a
      Creating library file: ..\..\dll\libplplotwxwidgetsd.dll.a
      CMakeFiles\plplotwxwidgetsd.dir\wxPLplotwindow.obj:wxPLplotwindow.cpp:(.text$_ZN12wxStringBaseC2EPKc[wxStringBase::wxStringBase(
      char const*)]+0x27): undefined reference to `_imp___ZN12wxStringBase8InitWithEPKcjj'
      collect2: ld returned 1 exit status
      mingw32-make[2]: *** [dll/libplplotwxwidgetsd.dll] Error 1
      mingw32-make[2]: Leaving directory `C:/plplot/build'
      mingw32-make[1]: *** [bindings/wxwidgets/CMakeFiles/plplotwxwidgetsd.dir/all] Error 2
      mingw32-make[1]: Leaving directory `C:/plplot/build'
      mingw32-make: *** [all] Error 2

      Arrrrgh!
      Michele

       
      • Michele

        Michele - 2009-02-03

        Ok,
        I added

        add_definitions(-D_UNICODE)

        to c:\plplot\CMakeLists.txt

        and now it works. Still, I had to add c:\wx\lib\gcc_dll and c:\plplot\build\dll to the path.

        Cheers,
        Michele

         
        • Werner Smekal

          Werner Smekal - 2009-02-09

          Yes, the missing _UNICODE flag is a known bug in CMake 2.6.2 (FindwxWidgets.cmake). And yes you need to add the dll directories to your PATH environment variable, otherwise they won't be found. After all this is Windows ;).

          Good, that you figured it out yourself.

          Regards,
          Werner

           

Log in to post a comment.