Configuration of wxWidgets driver

From PLplotWiki
Jump to: navigation, search

CMake Options

The following options let you specify to the CMake build system what options you used to compile your wxWidgets libraries:

  • -DwxWidgets_LIB_DIR=%WXWIN%\lib\gcc_lib: correct for your wxWidgets root directory and static vs. dynamic libraries
  • -DwxWidgets_CONFIGURATION=mswu: msw -> MicroSoft Windows; u -> Unicode; d -> Debug
  • -DwxWidgets_MONOLITHIC=ON: monolithic as opposed to individual libraries
  • -DwxWidgets_USE_UNICODE=ON: compiled with Unicode support

For more options refer to FindwxWidgets.cmake in your CMake installation.

More may be required for a successful Unicode build. Depending, incorrect Unicode configuration may result in errors during PLplot compilation or may not show up until later when compiling your actual application. Example errors are as follows:

[ 60%] Building CXX object bindings/wxwidgets/CMakeFiles/plplotwxwidgetsd.dir/wx
Linking CXX shared library ..\..\dll\libplplotwxwidgetsd.dll
Creating library file: ..\..\dll\libplplotwxwidgetsd.dll.a
12wxStringBaseC2EPKc[wxStringBase::wxStringBase(char const*)]+0x27): undefined r
eference to `_imp___ZN12wxStringBase8InitWithEPKcjj'
collect2: ld returned 1 exit status
undefined reference to `wxStringBase::InitWith(char const*, unsigned
int, unsigned int)'
undefined reference to `wxStringBase::InitWith(char const*, unsigned
int, unsigned int)'
- followed by a bunch more undefined references

Note that in both cases the errors do not specify a Unicode error but are string or character related. The follow was mentioned on the maillist and worked for me:

This is due a bug FindwxWidgets.cmake, either add


to CMakeLists.txt in the plplot main file. Or look for wxUNICODE in gcc_dll/mswu/setup.h
(or similar) and set it to 1. This flag is always 0 even if you compiled wxWidgets with 
UNICODE=1, you have to do it on your own, or set the _UNICODE flag on the command line.

If this still doesn't work (it didn't seem to have any effect for me), try editing the file flags.make in bindings/wxwidgets/CMakeFiles/plplotwxwidgetsd.dir and add /D_UNICODE /DUNICODE to the definition of CXX_FLAGS there.


The wxwidgets driver provides antialzing support, which can be turned on with the option antialized=1.

Output of example 1 with antializing OFF: non antialized

Output of example 1 with antializing ON: antialized

Personal tools