Menu

PLplot and wxWidgets Help - unable to run

2009-06-19
2013-03-15
  • Frank Tuffner

    Frank Tuffner - 2009-06-19

    Hello everyone,
      I am trying to incorporate PLplot into a wxWidgets based application, but can't seem to figure out what I am doing wrong.  I am using Visual Studio 2005 and can get a wxWidgets only application working without issue.  I can also get the normal PLplot applications working fine (whether compiling with the -DBUILD_TEST=ON option or manually creating a project in VS and compiling them).  This includes running the demos and selecting the wxwidgets plotting method.  However, I can not get PLplot to work in wxWidgets directly.  Even the included wxPLplotDemo does not work via an NMake build or a manual project compilation.

    I've tried the demo under a couple scenarios.  The first one is to build PLplot with static libraries using

    "cmake -G "NMake Makefiles" -DCMAKE_INSTALL_PREFIX=install -DBUILD_SHARED_LIBS=OFF -DwxWidgets_LIB_DIR=%WXWIN%\lib\vc_lib -DwxWidgets_CONFIGURATION=mswud -DwxWidgets_MONOLITHIC=OFF -DwxWidgets_USE_UNICODE=ON -DBUILD_TEST=ON .."

    When compiled this way, nothing happens.  Running the NMake built or project built wxPLplotdemo results in no output.  The program just sits there and does nothing (no screen comes up or anything).  Stepping through the code in Visual Studio, it appears to be getting stuck on line 225 of the evtLoop.cpp in wxWidgets.  It will run fine up to that point, but once that line is called it never makes it out.

    I have also tried building PLplot as a shared library (but with the dynamically loaded plugins option off, otherwise everything fails) via

    "cmake -G "NMake Makefiles" -DCMAKE_INSTALL_PREFIX=install -DBUILD_SHARED_LIBS=ON -DENABLE_DYNDRIVERS=ON -DwxWidgets_LIB_DIR=%WXWIN%\lib\vc_lib -DwxWidgets_CONFIGURATION=mswud -DwxWidgets_MONOLITHIC=OFF -DwxWidgets_USE_UNICODE=ON -DBUILD_TEST=ON .."

    When compiled this way, the normal PLplot demos still work fine.  However, the wxPLplotdemo crashes.  When running the NMake compiled version, I end up with an application error.  When compiled under Visual Studio, I end up with an unhandled exception in plplotwxwidgetsd.dll.

    This makes me think I might be building something incorrectly initially.  I haven't tried building wxWidgets as a dynamic library yet (I'd prefer to keep everything as a static library), so I don't know if that will make a difference or not.  If anyone has any insight on this, please let me know.

     
    • Frank Tuffner

      Frank Tuffner - 2009-06-19

      I just realized I posted this under the Open Discussion instead of Help forum.  If someone with powers greater than myself can move this or delete this, I can stop derailing discussion groups.

       
      • Werner Smekal

        Werner Smekal - 2009-06-20

        Hi,

        it's only possible to use the wxWidgets driver in your wx application, if wxWidgets is compiled shared. Reason is, that otherwise some features get linked into your application and into the plplot library twice,and during runtime everything gets messed up. I'm not a compiler expert to maybe able to work around that, but the wxPLplotDemo works only with shared wxWidgets library.

        Regards,
        Werner

         

Log in to post a comment.