
<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://www.miscdebris.net/plplot_wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Philrosenberg</id>
		<title>PLplotWiki - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="http://www.miscdebris.net/plplot_wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Philrosenberg"/>
		<link rel="alternate" type="text/html" href="http://www.miscdebris.net/plplot_wiki/index.php?title=Special:Contributions/Philrosenberg"/>
		<updated>2026-04-29T20:15:52Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.24.4</generator>

	<entry>
		<id>http://www.miscdebris.net/plplot_wiki/index.php?title=Configure_PLplot_for_the_Visual_Studio_IDE&amp;diff=3022</id>
		<title>Configure PLplot for the Visual Studio IDE</title>
		<link rel="alternate" type="text/html" href="http://www.miscdebris.net/plplot_wiki/index.php?title=Configure_PLplot_for_the_Visual_Studio_IDE&amp;diff=3022"/>
				<updated>2013-09-27T14:48:11Z</updated>
		
		<summary type="html">&lt;p&gt;Philrosenberg: Typo in version number&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page details how to build PLplot using the Visual Studio integrated development environment via project and solution files. If you wish to use NMake from the command line see [[Configure PLplot for Visual CXX CLI]]&lt;br /&gt;
&lt;br /&gt;
== Walkthrough building PLPLot with Visual Studio ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Why can’t I just include all the code files in a project and press the build button?&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
PLplot makes every effort to be compatible with multiple different compilers on multiple OSs. It also uses third party libraries for backends/drivers. If every compiler exactly conformed to the (same) C++ and C standards and included nothing else and if every other library did the same then this would be easy. But they don’t and it isn’t. Some libraries only work on Linux or Windows and different compilers add extra features and although often the same additional features exist in different compilers they sometimes have different names or are in different header files. This all can make writing a cross platform library quite tricky.&lt;br /&gt;
&lt;br /&gt;
PLplot addresses this by using a build system called CMake. This is an extra layer of code between the C/C++ code and the compiler. The CMake code is run before you try to compile the library and it attempts to detect the various platform specific differences and create (in the case of Visual Studio) .sln and .proj files and a config.h file that fits your configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;A Walkthrough&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
I have spent some time trying to get CMake to work with my setup and the PLplot developers have helped with bug fixes to get this right so PLplot should now be straightforward to compile on windows. Fundamentally I want to end up with a visual studio sln file which I can use to build PLplot. It should ensure I have access to the libraries and backends/drivers that I want to use which include shapelib, wxWidgets, AGG and FreeType. Ideally it should include the examples and allow me to specify all the project properties I need so that if I update my code to the latest trunk version (which I do quite often) I don’t have to manually change lots of settings. Unfortunately there is a bit of a Linux bias to Cmake so here are some things that may catch you out, here are a few of those:&lt;br /&gt;
*When specifying paths to CMAKE, capitalisation matters.&lt;br /&gt;
*When CMAKE looks for additional libraries it sometimes only looks in the default Linux path so you might have to specify library locations&lt;br /&gt;
*All the defaults are to build dynamically linked dynamic libraries with dynamic runtime linkage – if you want anything else then you must specify so.&lt;br /&gt;
*If you need to recreate your sln files then it’s best to delete everything in your build directory and start again from scratch.&lt;br /&gt;
Anyhow here is a walkthrough of how I got everything working.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Backends/Drivers&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
PLplot could include code to write your plots to screen, memory, and the myriad of different file formats that you may want to use. However, if this was the case the developers would spend all their time looking at details of jpeg file formats or the different operating system device contexts. Instead PLplot has built in support for a few output devices and then uses other libraries referred to as drivers to output to most file types. In the walkthrough I’ll show you how to compile with just the built in outputs first, then I’ll add in shapefile support for maps using shapelib, and the wxWidgets driver with options for rendering with, AGG and Freetype.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Compiling a Basic PLplot Library&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
To build PLplot you will need some extra tools first. Download and install CMAKE from http://www.cmake.org/. Next if you want to use the very latest version of PLplot with the most up to date bug fixes you will need to access the Subversion repository to get the latest trunk version. To do this download tortoiseSVN from http://tortoisesvn.net/, then create a folder where you want to store the PLPlot source code (mine is D:\SourceCode\Libraries\plplot_trunk). Right click the folder and go to TortoiseSVN, Checkout. Enter the URL from http://plplot.sourceforge.net/download.php and click OK. If you ever need to update then right click the folder and click SVN Update. If you want the latest release version then you can download it from the same download link and just unzip it to a location of your choosing. If you have any doubt about whether you want the trunk version or the release version then my recommendation would be the trunk version. At the very least get the latest development release rather than the stable release as there have been a lot of updates and bug fixes since version 5.8.&lt;br /&gt;
&lt;br /&gt;
Now we can start the build process. open a cmd window and run the following batch file&lt;br /&gt;
&lt;br /&gt;
   C:\Program files\Microsoft Visual Studio 9.0\Common7\Tools\vsvars32.bat&lt;br /&gt;
&lt;br /&gt;
If you installed Visual Studio elsewhere then change the path accordingly and note that on 64 bit machines the default path is in Program Files(x86). This will define environment variables that CMAKE will use so keep this cmd prompt open and do all the following commands in it.&lt;br /&gt;
&lt;br /&gt;
Rather than compile PLplot ‘in place’ we’ll be building it in a separate directory, in fact we need two directories, one for release and one for debug. So create a these build directories. Mine are at D:\Sourcecode\Libraries\plplot_staticbuild_release, with another in the same location but ending debug. I think it is possible to create a release and debug version together in one .sln but i think there are potential clashes so I highly recommend creating a separate release and debug version in separate folders. In your cmd prompt navigate to the release directory.&lt;br /&gt;
&lt;br /&gt;
If you wish to add any extra compiler flags do so by setting the environment variables CXXFLAGS and CFLAGS in your cmd prompt. I use this facility to set the Unicode options&lt;br /&gt;
&lt;br /&gt;
   set CXXFLAGS=/DUNICODE /D_UNICODE&lt;br /&gt;
   set CFLAGS=/DUNICODE /D_UNICODE&lt;br /&gt;
&lt;br /&gt;
Note that you almost always want CXXFLAGS and CFLAGS to be identical.&lt;br /&gt;
&lt;br /&gt;
If you already have wxWidgets installed then you may wish to stop PLplot finding it for this basic build. To do so type &lt;br /&gt;
&lt;br /&gt;
   %WXWIN%&lt;br /&gt;
&lt;br /&gt;
and make a note of the path for later. Then enter&lt;br /&gt;
&lt;br /&gt;
   set WXWIN=&lt;br /&gt;
&lt;br /&gt;
Now call CMAKE as follows:&lt;br /&gt;
&lt;br /&gt;
   cmake &amp;quot;D:/SourceCode/Libraries/plplot trunk&amp;quot; -G &amp;quot;Visual Studio 9 2008&amp;quot; -DPL_DOUBLE=ON -DLIB_TAG=&amp;quot;sud&amp;quot; -DBUILD_TEST=ON -DCMAKE_INSTALL_PREFIX=&amp;quot;D:\SourceCode\Libraries\plplotinstall&amp;quot;  -DCMAKE_CONFIGURATION_TYPES=&amp;quot;Debug&amp;quot; -DBUILD_SHARED_LIBS=OFF -DSTATIC_RUNTIME=ON&lt;br /&gt;
&lt;br /&gt;
A full description of the parameters can be found in the reference below. You can obviously change them to suit your needs. Hopefully after a minute or two the screen output should end with &lt;br /&gt;
&lt;br /&gt;
   --Configuring done&lt;br /&gt;
   --Generating done&lt;br /&gt;
   --Build files have been written to D:/SourceCode/Libraries/plplot_staticbuild_release&lt;br /&gt;
&lt;br /&gt;
If you now go to your build directory you should see a solution which you can open in Visual Studio. Just open it up, right click the INSTALL project and select build, this will build your library and put it in the install directory. I use the LIB_TAG parameter to identify this as a static (s), Unicode (u) debug (d) library. Unfortunately some of the built libraries do not get your LIB_TAG added. So go to your install directory and do this manually, this stops them getting overwritten when you build the release version. You should now be able to find the examples in the build directory and try them out. You get a choice of which built in driver you want to use. There is a memory one, a Windows one that outputs to screen and ones that output to ps, svg and xfig files. Once you have a debug version, you can repeat the process in a new directory to create a debug version, make sure you change the LIB_TAG or install directory to avoid overwriting. Well done you now have PLplot up and running.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Other Libraries and Backends&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
PLplot relies on a number of drivers and backends to extend its output capabilities and allow reading of certain data files. I use a few of these and will guide you through adding them. Don’t be tempted to download precompiled .lib and .dll files. If you do then they may not have been compiled with the same setting that you use and may generate hard to fix linker errors. Problem setting can include character set (Unicode, vs multibyte vs not set) and static/dynamic linking to the runtime libraries (multithreaded, multithreaded dll, multithreaded debug, multithreaded debug dll). If you don’t know what static and dynamic linking are then find out because it will be the bane of your programming life if you don’t. I tend to add u to the end of a library name to indicate Unicode and s to indicate static (not dynamic) linkage to the runtime library and d to indicate debug.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Shapelib&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Shapelib allows you to read in .shp shapefileswhich contain vector map information into PLplot . PLPlot already has a coarse resolution global map included, but if you would like higher resolution then you need to add Shapelib. Global files with 10, 50 or 110 mile resolution are available from http://www.naturalearthdata.com and you can find other files online as you need. Shapelib itself is easy to compile, download it from http://shapelib.maptools.org/ create a new windows library project, add all the files and build debug and release versions as needed. There is no need to specify Unicode. To use it in PLplot add the following commands to your CMake call&lt;br /&gt;
&lt;br /&gt;
   -DHAVE_SHAPELIB=ON -DSHAPELIB_INCLUDE_DIR=&amp;quot;D:/SourceCode/Libraries/shapelib-1.3.0/include/shapelib&amp;quot; -DSHAPELIB_LIBRARY=&amp;quot;D:/SourceCode/Libraries/shapelib-1.3.0/lib/shapelibsd.lib&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Of course replace the values with ones appropriate for your system and make sure you use the debug or release library appropriately. Now in calls to plmap you can replace the map name with the path to a shapefile and the lines from this file will be used to draw the map.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;wxWidgets&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
I use wxWidgets for GUI output, it also allows output to various other graphics types like png, bmp, jpg, ps. If you wish to do the same then the best way is to install wxPack which is a fully working version of wxWidgets for Windows. It comes with a Visual Studio .sln file so saves you a lot of hassle. There are loads of instructions for compiling wxWidgets online, so I won’t repeat it all here. However you may wish to enable wxGraphicsContext (which gives anti-aliased output) and wxPostscriptDC to output to ps files. To do this, go through all the various setup.h and setup0.h and set &lt;br /&gt;
&lt;br /&gt;
   #define wxUSE_GRAPHICS_CONTEXT 1&lt;br /&gt;
   #define wxUSE_POSTSCRIPT 1&lt;br /&gt;
&lt;br /&gt;
Open the wxWidgets .sln file and if you wish to change between static and dynamic Runtime then change this in the project properties. Finally go to build, batch build and build all the versions of the library. This can take some time.&lt;br /&gt;
&lt;br /&gt;
For Visual Studio 2012 Users – I have found a few problems with building wxWidgets in VS2012 so I thought I’d add them here. &lt;br /&gt;
*First the Batch Build option is hidden. You can display it by going to Tools, customize, Commands and select the build menu.&lt;br /&gt;
*If you get a lot of build errors talking about CL.exe then this is caused by clashes between intermediate files of different projects. To fix it select all the projects in the solution explorer then right click them and select properties. Change the configuration to All Configurations then go to Configuration properties, General and change Intermediate Directory to $(ProjectName)\$(Platform)\$(Configuration)\.&lt;br /&gt;
*If you get a compilation error saying that the file pbt.h cannot be found in windows.cpp then go to the relevant line and comment it out. This header is no longer needed in wxWidgets and no longer included with Visual Studio but the #include got forgotten and left in the source.&lt;br /&gt;
*Finally if you want to build a 64 bit version do not try changing the Build Target in the project properties, this causes various linker errors. Instead go to Build, Configuration Manager... and in the active solution platform select &amp;lt;new&amp;gt; then select x64. This will create 64 bit configurations for all projects. Unfortunately you cannot build 64 bit and 32 bit libraries at the same time and if you have built a 32 bit library and want to build the 64 bit version (or vice versa) then you must clean the project first. See the install-msw-2.8.12.txt file shipped with wxWidgets for more info.&lt;br /&gt;
&lt;br /&gt;
Once you have wxWidgets built PLplot will automatically look for the WXWIN environmental variable which is created by wxPack, or should have been created by you if you set up wxWidgets manually. If you disabled wxWidgets above, then enter the following at the command prompt&lt;br /&gt;
&lt;br /&gt;
   set WXWIN=path/you/wrote/down/earlier&lt;br /&gt;
&lt;br /&gt;
If PLplot finds this environmental variable then it will include wxWidgets in the build. However, it seems that CMAKE doesn’t automatically determine if you are building with Unicode, so if you are then you must specify which wxWidgets build to use by adding the following parameter to your CMake command&lt;br /&gt;
&lt;br /&gt;
   DwxWidgets_CONFIGURATION=mswud&lt;br /&gt;
&lt;br /&gt;
Or for the release version use mswu, just like the suffix at the end of the wxWidgets library files.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;AGG and FreeType&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The wxWidgets driver can use three backends. The wxDC and wxGraphicsContect are part of wxWidgets and use Windows drawing routines. This means if you port your software to Linux the code will then use Linux drawing routines which may be slightly different. This might not be a big deal, but in case it is you can also make use of the cross platform AGG library to render anti-aliased graphics and AGG can either use PLplot’s basic text or the FreeType library for Unicode fonts. If you wish to use them then download the code for these projects. Both are quite straightforward. AGG seem to pride themselves on only using ‘pure’ C so for AGG you can just download the source from http://www.antigrain.com/ and add all the files to a visual studio project and build it. &lt;br /&gt;
If you are using FreeType then you can download the source form http://www.freetype.org/. The download includes a .sln file to build with Visual Studio.&lt;br /&gt;
&lt;br /&gt;
If using both FreeType and AGG then you should copy the files from your_agg_directory\font_freetype to your_agg_directory\include\agg2. You may wish to do the same with those in font_win32_tt, but it’s not needed for PLplot at present.&lt;br /&gt;
&lt;br /&gt;
Also don’t forget to ensure your character set and run time library linkage are set as you want them. To include AGG when you compile PLplot add the following parameters&lt;br /&gt;
&lt;br /&gt;
   DHAVE_AGG=ON -DAGG_INCLUDE_DIR=&amp;quot;D:/SourceCode/Libraries/agg-2.4/include&amp;quot; -DAGG_LIBRARIES=&amp;quot;D:/SourceCode/Libraries/agg-2.4/VC++/AGG/lib/AGGsud.lib&amp;quot;&lt;br /&gt;
&lt;br /&gt;
For FreeType use&lt;br /&gt;
&lt;br /&gt;
   -DWITH_FREETYPE=ON -DFREETYPE_INCLUDE_DIR=&amp;quot;D:/SourceCode/Libraries/freetype-2.4.8/include&amp;quot; -DFREETYPE_LIBRARY=&amp;quot;D:/SourceCode/Libraries/freetype-2.4.8/objs/win32/vc2008/freetypesud.lib&amp;quot;&lt;br /&gt;
But of course change the paths to match your system.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Summary and reference&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
So just so you see the whole thing, my final CMake command for a debug build is&lt;br /&gt;
&lt;br /&gt;
 cmake &amp;quot;D:/SourceCode/Libraries/plplot_trunk&amp;quot; -G &amp;quot;Visual Studio 9 2008&amp;quot; -DPL_DOUBLE=ON -DLIB_TAG=&amp;quot;su&amp;quot; -DBUILD_TEST=ON -DCMAKE_INSTALL_PREFIX=&amp;quot;D:\SourceCode\Libraries\plplotinstall&amp;quot; -DBUILD_SHARED_LIBS=OFF -DCMAKE_CONFIGURATION_TYPES=&amp;quot;Debug&amp;quot; -DSTATIC_RUNTIME=ON -DwxWidgets_CONFIGURATION=mswud -DHAVE_SHAPELIB=ON -DSHAPELIB_INCLUDE_DIR=&amp;quot;D:/SourceCode/Libraries/shapelib-1.3.0/include/shapelib&amp;quot; -DSHAPELIB_LIBRARY=&amp;quot;D:/SourceCode/Libraries/shapelib-1.3.0/lib/shapelibsd.lib&amp;quot;  -DHAVE_AGG=ON -DAGG_INCLUDE_DIR=&amp;quot;D:/SourceCode/Libraries/agg-2.4/include&amp;quot; -DAGG_LIBRARIES=&amp;quot;D:/SourceCode/Libraries/agg-2.4/VC++/AGG/lib/AGGsud.lib&amp;quot; -DWITH_FREETYPE=ON -DFREETYPE_INCLUDE_DIR=&amp;quot;D:/SourceCode/Libraries/freetype-2.4.8/include&amp;quot; -DFREETYPE_LIBRARY=&amp;quot;D:/SourceCode/Libraries/freetype-2.4.8/objs/win32/vc2008/freetypesud.lib&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
For reference here is a quick rundown of each of the parameters&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;“D:/SourceCode/Libraries/plplot trunk”:&amp;#039;&amp;#039;&amp;#039; the path to my source directory – case sensitive.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;-G “Visual Studio 9 2008”:&amp;#039;&amp;#039;&amp;#039; the compiler I want to generate a project/solution for.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;-DPL_DOUBLE=ON:&amp;#039;&amp;#039;&amp;#039; use doubles, rather than floats in PLplot. Also adds d to the library names.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;-DLIB_TAG=”su”:&amp;#039;&amp;#039;&amp;#039; this will append “su” to the end of the library name and is an indicator to me that I’m using static linkage with the Unicode character set. I use sud for static Unicode debug etc.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;-DBUILD_TEST=ON:&amp;#039;&amp;#039;&amp;#039; Indicates I want to create projects for the examples. Set to OFF to not build them.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;-DCMAKE_INSTALL_PREFIX=”D:\SourceCode\Libraries\plplotinstall”&amp;#039;&amp;#039;&amp;#039; The directory you want your final libraries to end up in, it will be created if it doesn’t exist. If you leave this blank it defaults to C:\Program Files\PLplot, however in Windows Vista or later UAC will stop the file being written here unless you run Visual Studio as administrator.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;-DCMAKE_CONFIGURATION_TYPES=”Release”:&amp;#039;&amp;#039;&amp;#039; The configuration to use in the project. You can run create multiple configurations in one solution by listing them separated by semicolons, but if using Shapelib, FreeType or AGG this causes linking problems with the examples as you can’t specify linkage against the release and debug versions separated by semicolons. It also causes issues with installing to one directory so it’s best to create on sln for each configuration. You can include Release, Debug, MinSizeRel and RelWithDebInfo. &lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;-DSTATIC_RUNTIME=ON:&amp;#039;&amp;#039;&amp;#039; This causes us to link against the static runtime (equivalent to /MT or /MTd flags). Set it to OFF if you want to link against the dynamic runtime (equivalent to /MD or /MDd). &lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;-DBUILD_SHARED_LIBS=OFF&amp;#039;&amp;#039;&amp;#039; Build a .lib rather than a .dll. If you don’t set this the default will be to build dlls.All the options above except the source directory and compiler are optional and will be set to default values if excluded. &lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Anything with AGG in:&amp;#039;&amp;#039;&amp;#039; These point out that I want to use AGG and specifies the location of header files and the library itself. The library is only needed if –DBUILD_TEST is ON. None are needed if you are not using AGG.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Anything with FREETYPE in:&amp;#039;&amp;#039;&amp;#039; As with the AGG stuff it indicates I want to use FreeType and gives the location of the headers and library. Note that the variables have slightly different names to the AGG ones. Again the library is only needed when building the examples.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Anything with SHAPELIB in:&amp;#039;&amp;#039;&amp;#039; As for the FREETYPE and AGG parameters, but for shapelib.&lt;br /&gt;
&lt;br /&gt;
There are also other customisable options and after you’ve run CMAKE you can examine the CMakeCache.txt file that is created in your build directory to see others (prepend -D to define them on the command line) or look at the wiki page or CMAKE documentation.&lt;br /&gt;
&lt;br /&gt;
== Bugs and Issues ==&lt;br /&gt;
&lt;br /&gt;
Using version 2.8.2 of CMake there are some snags you may find.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Common Errors&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;I see linker errors regarding strings or wxStrings or chars and wchars&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Unicode and non Unicode libraries often use strings made of either wchars or chars silently behind the scenes. If you have mixed libraries built with unicode with ones built with the charecter set not set then these clash during linking. Did you specify the wxWidget configuration to ensure you get the Unicode version of wxWidgets? Or perhaps one of the other libraries you are using has this set differently to PLplot.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;I see linker errors which mention function which have dbg in&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Microsoft supply four different versions of the C++ runtime with either static/dynamic linkage and for either debug/release. It sounds like you have mixed libraries which use debug with ones that use release. I&amp;#039;m afraid you have to go through and check them all.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;I see linker errors which mention functions which have imp_ in&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
See the dbg linker errors, except this is likely due to mixing libraries with static and dynamic linkage.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Problems with old PLplot versions (5.9.9 and before)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Here are some snags which may affect older versions of PLplot, if you see these symptoms please upgrade to version 2.9.10 or the latest trunk version via SVN&lt;br /&gt;
&lt;br /&gt;
*When embedding a PLplot in a wxWidgets application the application may hang during initialisation. Caused by both PLplot and your application trying to initialise message loops.&lt;br /&gt;
&lt;br /&gt;
*Linker errors occur in release builds of software which includes the PLplot library and the wxWidget driver. They reference functions which have dbg in their name. This was caused by a CMAKE bug which defined the _DEBUG and __WXDEUG__ preprocessor variables in release mode when using wxWidgets. A workaround has been added to PLplot. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Intel Fortran&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
If you use Intel Fortran, the solution/project files may cause errors when building. These affect only the Fortran libraries and examples. It is due to a small bug in CMake that should be fixed with the next release.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Workaround for examples built with Visual Studio&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
There have been some reported problems with running the examples when building ith Visual Studio. This seems fine when building static libraries, but may still persist with dynamic ones. If you have problems then try the folowing&lt;br /&gt;
&lt;br /&gt;
* Build the PLplot libraries and examples via the ALL_BUILD project&lt;br /&gt;
* Open a DOS box in the Debug directory for any one of these examples&lt;br /&gt;
* Set the following environment variables:&lt;br /&gt;
&lt;br /&gt;
   set path=&amp;lt;build&amp;gt;\dll\Debug;%PATH% &lt;br /&gt;
   set PLPLOT_DRV_DIR=&amp;lt;build&amp;gt;\drivers    &lt;br /&gt;
   set PLPLOT_LIB=&amp;lt;source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   where: &amp;lt;build&amp;gt; is the directory where PLplot was built&lt;br /&gt;
   and the directory &amp;quot;&amp;lt;source&amp;gt;\data&amp;quot; holds the .pal and .fnt files&lt;br /&gt;
* In this environment you can run the sample program&lt;/div&gt;</summary>
		<author><name>Philrosenberg</name></author>	</entry>

	<entry>
		<id>http://www.miscdebris.net/plplot_wiki/index.php?title=Talk:Setup_Visual_Studio_Express&amp;diff=3020</id>
		<title>Talk:Setup Visual Studio Express</title>
		<link rel="alternate" type="text/html" href="http://www.miscdebris.net/plplot_wiki/index.php?title=Talk:Setup_Visual_Studio_Express&amp;diff=3020"/>
				<updated>2013-09-27T14:44:57Z</updated>
		
		<summary type="html">&lt;p&gt;Philrosenberg: moved Talk:Setup visualc to Talk:Setup Visual Studio Express: Better name&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Did someone deleted the content?&lt;br /&gt;
&lt;br /&gt;
No, I just hadn&amp;#039;t time to write down the instructions. In fact I wrote them already down, but I didn&amp;#039;t restructured them, so that it&amp;#039;s useful for anybody else. This wiki is still work in progress.&lt;/div&gt;</summary>
		<author><name>Philrosenberg</name></author>	</entry>

	<entry>
		<id>http://www.miscdebris.net/plplot_wiki/index.php?title=Talk:Setup_visualc&amp;diff=3021</id>
		<title>Talk:Setup visualc</title>
		<link rel="alternate" type="text/html" href="http://www.miscdebris.net/plplot_wiki/index.php?title=Talk:Setup_visualc&amp;diff=3021"/>
				<updated>2013-09-27T14:44:57Z</updated>
		
		<summary type="html">&lt;p&gt;Philrosenberg: moved Talk:Setup visualc to Talk:Setup Visual Studio Express: Better name&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Talk:Setup Visual Studio Express]]&lt;/div&gt;</summary>
		<author><name>Philrosenberg</name></author>	</entry>

	<entry>
		<id>http://www.miscdebris.net/plplot_wiki/index.php?title=Setup_Visual_Studio_Express&amp;diff=3018</id>
		<title>Setup Visual Studio Express</title>
		<link rel="alternate" type="text/html" href="http://www.miscdebris.net/plplot_wiki/index.php?title=Setup_Visual_Studio_Express&amp;diff=3018"/>
				<updated>2013-09-27T14:44:56Z</updated>
		
		<summary type="html">&lt;p&gt;Philrosenberg: moved Setup visualc to Setup Visual Studio Express: Better name&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Setup Visual C++ ==&lt;br /&gt;
Visual C++ Express Edition&amp;lt;ref&amp;gt;[http://www.microsoft.com/express/vc/ Visual C++ Express Homepage]&amp;lt;/ref&amp;gt; is a integrated development environments (IDE) developed by Microsoft that is a lightweight version of the Microsoft Visual Studio C++ product line. The idea of express editions, according to Microsoft, is to provide streamlined, easy-to-use and easy-to-learn IDEs for users other than professional software developers, such as hobbyists and students.&amp;lt;ref&amp;gt;[http://en.wikipedia.org/wiki/Visual_Studio_Express Wikipedia entry about Visual Studio Express]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Download and install ===&lt;br /&gt;
Download the webinstaller from the [http://www.microsoft.com/express/vc/ Visual C++ Express Edition Website] and run it. Go through the installer wizard - Visual C++ will be downloaded and installed accordingly. Alternatively you could download the whole DVD containing the complete Visual Studio 2008 Express Edition set ([http://www.microsoft.com/express/download/ scroll to the bottom]) to install the tools offline.&lt;br /&gt;
&lt;br /&gt;
=== Setup ===&lt;br /&gt;
To configure and compile plplot with Visual C++ you can either use the command line interface or the integrated development environment. See the instructions at [[Configure PLplot for Visual CXX CLI]] or [[Configure PLplot for the Visual Studio IDE]].&lt;br /&gt;
&lt;br /&gt;
If you are using the CLI you may find it useful to set up a batch file to prepare the environment before you start. To do so open your [http://www.scintilla.org/SciTE.html favorite text editor] and enter the following CLI commands&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
@echo off&lt;br /&gt;
&lt;br /&gt;
rem setup Visual C++ compiler&lt;br /&gt;
call &amp;quot;%VS90COMNTOOLS%&amp;quot;\vsvars32.bat&lt;br /&gt;
&lt;br /&gt;
rem setup PLplot library&lt;br /&gt;
set PLPLOTDIR=path_to_plplot&lt;br /&gt;
set PLPLOT_LIB=%PLPLOTDIR%\data&lt;br /&gt;
set PATH=%PLPLOTDIR%\dll;%PATH%&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
and save this to e.g. &amp;lt;tt&amp;gt;vcvars.bat&amp;lt;/tt&amp;gt;. Start you Windows CLI, cd into the directory where the batch file was saved and run &amp;lt;tt&amp;gt;vcvars.bat&amp;lt;/tt&amp;gt;. Run &amp;lt;tt&amp;gt;nmake /?&amp;lt;/tt&amp;gt;, to see if everything works. Your Visual C++ developing environment is now ready.&lt;br /&gt;
&lt;br /&gt;
=== Links ===&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Philrosenberg</name></author>	</entry>

	<entry>
		<id>http://www.miscdebris.net/plplot_wiki/index.php?title=Setup_visualc&amp;diff=3019</id>
		<title>Setup visualc</title>
		<link rel="alternate" type="text/html" href="http://www.miscdebris.net/plplot_wiki/index.php?title=Setup_visualc&amp;diff=3019"/>
				<updated>2013-09-27T14:44:56Z</updated>
		
		<summary type="html">&lt;p&gt;Philrosenberg: moved Setup visualc to Setup Visual Studio Express: Better name&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Setup Visual Studio Express]]&lt;/div&gt;</summary>
		<author><name>Philrosenberg</name></author>	</entry>

	<entry>
		<id>http://www.miscdebris.net/plplot_wiki/index.php?title=Setup_Visual_Studio_Express&amp;diff=3017</id>
		<title>Setup Visual Studio Express</title>
		<link rel="alternate" type="text/html" href="http://www.miscdebris.net/plplot_wiki/index.php?title=Setup_Visual_Studio_Express&amp;diff=3017"/>
				<updated>2013-09-27T14:44:02Z</updated>
		
		<summary type="html">&lt;p&gt;Philrosenberg: Changed link name as it is no longer 2008&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Setup Visual C++ ==&lt;br /&gt;
Visual C++ Express Edition&amp;lt;ref&amp;gt;[http://www.microsoft.com/express/vc/ Visual C++ Express Homepage]&amp;lt;/ref&amp;gt; is a integrated development environments (IDE) developed by Microsoft that is a lightweight version of the Microsoft Visual Studio C++ product line. The idea of express editions, according to Microsoft, is to provide streamlined, easy-to-use and easy-to-learn IDEs for users other than professional software developers, such as hobbyists and students.&amp;lt;ref&amp;gt;[http://en.wikipedia.org/wiki/Visual_Studio_Express Wikipedia entry about Visual Studio Express]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Download and install ===&lt;br /&gt;
Download the webinstaller from the [http://www.microsoft.com/express/vc/ Visual C++ Express Edition Website] and run it. Go through the installer wizard - Visual C++ will be downloaded and installed accordingly. Alternatively you could download the whole DVD containing the complete Visual Studio 2008 Express Edition set ([http://www.microsoft.com/express/download/ scroll to the bottom]) to install the tools offline.&lt;br /&gt;
&lt;br /&gt;
=== Setup ===&lt;br /&gt;
To configure and compile plplot with Visual C++ you can either use the command line interface or the integrated development environment. See the instructions at [[Configure PLplot for Visual CXX CLI]] or [[Configure PLplot for the Visual Studio IDE]].&lt;br /&gt;
&lt;br /&gt;
If you are using the CLI you may find it useful to set up a batch file to prepare the environment before you start. To do so open your [http://www.scintilla.org/SciTE.html favorite text editor] and enter the following CLI commands&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
@echo off&lt;br /&gt;
&lt;br /&gt;
rem setup Visual C++ compiler&lt;br /&gt;
call &amp;quot;%VS90COMNTOOLS%&amp;quot;\vsvars32.bat&lt;br /&gt;
&lt;br /&gt;
rem setup PLplot library&lt;br /&gt;
set PLPLOTDIR=path_to_plplot&lt;br /&gt;
set PLPLOT_LIB=%PLPLOTDIR%\data&lt;br /&gt;
set PATH=%PLPLOTDIR%\dll;%PATH%&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
and save this to e.g. &amp;lt;tt&amp;gt;vcvars.bat&amp;lt;/tt&amp;gt;. Start you Windows CLI, cd into the directory where the batch file was saved and run &amp;lt;tt&amp;gt;vcvars.bat&amp;lt;/tt&amp;gt;. Run &amp;lt;tt&amp;gt;nmake /?&amp;lt;/tt&amp;gt;, to see if everything works. Your Visual C++ developing environment is now ready.&lt;br /&gt;
&lt;br /&gt;
=== Links ===&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Philrosenberg</name></author>	</entry>

	<entry>
		<id>http://www.miscdebris.net/plplot_wiki/index.php?title=Setup_Visual_Studio_Express&amp;diff=3016</id>
		<title>Setup Visual Studio Express</title>
		<link rel="alternate" type="text/html" href="http://www.miscdebris.net/plplot_wiki/index.php?title=Setup_Visual_Studio_Express&amp;diff=3016"/>
				<updated>2013-09-27T14:42:21Z</updated>
		
		<summary type="html">&lt;p&gt;Philrosenberg: changed details about IDE not working&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Setup Visual C++ (2008) ==&lt;br /&gt;
Visual C++ Express Edition&amp;lt;ref&amp;gt;[http://www.microsoft.com/express/vc/ Visual C++ Express Homepage]&amp;lt;/ref&amp;gt; is a integrated development environments (IDE) developed by Microsoft that is a lightweight version of the Microsoft Visual Studio C++ product line. The idea of express editions, according to Microsoft, is to provide streamlined, easy-to-use and easy-to-learn IDEs for users other than professional software developers, such as hobbyists and students.&amp;lt;ref&amp;gt;[http://en.wikipedia.org/wiki/Visual_Studio_Express Wikipedia entry about Visual Studio Express]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Download and install ===&lt;br /&gt;
Download the webinstaller from the [http://www.microsoft.com/express/vc/ Visual C++ 2008 Express Edition Website] and run it. Go through the installer wizard - Visual C++ will be downloaded and installed accordingly. Alternatively you could download the whole DVD containing the complete Visual Studio 2008 Express Edition set ([http://www.microsoft.com/express/download/ scroll to the bottom]) to install the tools offline.&lt;br /&gt;
&lt;br /&gt;
=== Setup ===&lt;br /&gt;
To configure and compile plplot with Visual C++ you can either use the command line interface or the integrated development environment. See the instructions at [[Configure PLplot for Visual CXX CLI]] or [[Configure PLplot for the Visual Studio IDE]].&lt;br /&gt;
&lt;br /&gt;
If you are using the CLI you may find it useful to set up a batch file to prepare the environment before you start. To do so open your [http://www.scintilla.org/SciTE.html favorite text editor] and enter the following CLI commands&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
@echo off&lt;br /&gt;
&lt;br /&gt;
rem setup Visual C++ compiler&lt;br /&gt;
call &amp;quot;%VS90COMNTOOLS%&amp;quot;\vsvars32.bat&lt;br /&gt;
&lt;br /&gt;
rem setup PLplot library&lt;br /&gt;
set PLPLOTDIR=path_to_plplot&lt;br /&gt;
set PLPLOT_LIB=%PLPLOTDIR%\data&lt;br /&gt;
set PATH=%PLPLOTDIR%\dll;%PATH%&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
and save this to e.g. &amp;lt;tt&amp;gt;vcvars.bat&amp;lt;/tt&amp;gt;. Start you Windows CLI, cd into the directory where the batch file was saved and run &amp;lt;tt&amp;gt;vcvars.bat&amp;lt;/tt&amp;gt;. Run &amp;lt;tt&amp;gt;nmake /?&amp;lt;/tt&amp;gt;, to see if everything works. Your Visual C++ developing environment is now ready.&lt;br /&gt;
&lt;br /&gt;
=== Links ===&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Philrosenberg</name></author>	</entry>

	<entry>
		<id>http://www.miscdebris.net/plplot_wiki/index.php?title=Specifics_for_various_platforms&amp;diff=3015</id>
		<title>Specifics for various platforms</title>
		<link rel="alternate" type="text/html" href="http://www.miscdebris.net/plplot_wiki/index.php?title=Specifics_for_various_platforms&amp;diff=3015"/>
				<updated>2013-09-27T14:35:12Z</updated>
		
		<summary type="html">&lt;p&gt;Philrosenberg: fixed VS IDE link&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Before reading this section you should consult [[Building_PLplot]] to obtain generic build instructions.&lt;br /&gt;
==== Linux ====&lt;br /&gt;
* [[Linux]]&lt;br /&gt;
* [[List of Debian/Ubuntu packages]] - in order to be able to configure and compile the PLplot library this page contains a list of Debian/Ubuntu packages needed.&lt;br /&gt;
* [[Additional notes for ifort users]]&lt;br /&gt;
&lt;br /&gt;
==== Mac OSX ====&lt;br /&gt;
* [[Mac OSX]] instructions&lt;br /&gt;
&lt;br /&gt;
==== Windows ====&lt;br /&gt;
&lt;br /&gt;
===== Free and open-source tools to help build a powerful version of PLplot on Windows =====&lt;br /&gt;
&lt;br /&gt;
* [[Install MinGW/MSYS]]&lt;br /&gt;
* [[Install SWIG]]&lt;br /&gt;
* [[Install Python]]&lt;br /&gt;
* [[Install Lua]]&lt;br /&gt;
* [[Install Tcl]]&lt;br /&gt;
* [[Install Octave]]&lt;br /&gt;
* [[Install 3rd party libraries]]&lt;br /&gt;
&lt;br /&gt;
===== Instructions per Windows platform =====&lt;br /&gt;
&lt;br /&gt;
* [[Configure PLplot for the Visual Studio IDE]]&lt;br /&gt;
* [[Configure PLplot for Visual CXX CLI]]&lt;br /&gt;
* [[Configure PLplot for MinGW/CLI]]&lt;br /&gt;
* [[Configure PLplot for cygwin]]&lt;br /&gt;
* [[Configure PLplot for Borland CXX 5.5 (free command line tools)]]&lt;br /&gt;
* [[Configure PLplot for Borland Turbo C++ Explorer Edition (free IDE and compiler)]]&lt;/div&gt;</summary>
		<author><name>Philrosenberg</name></author>	</entry>

	<entry>
		<id>http://www.miscdebris.net/plplot_wiki/index.php?title=Configure_PLplot_for_the_Visual_Studio_IDE&amp;diff=3014</id>
		<title>Configure PLplot for the Visual Studio IDE</title>
		<link rel="alternate" type="text/html" href="http://www.miscdebris.net/plplot_wiki/index.php?title=Configure_PLplot_for_the_Visual_Studio_IDE&amp;diff=3014"/>
				<updated>2013-09-27T14:32:36Z</updated>
		
		<summary type="html">&lt;p&gt;Philrosenberg: Added a Bugs and Issues section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page details how to build PLplot using the Visual Studio integrated development environment via project and solution files. If you wish to use NMake from the command line see [[Configure PLplot for Visual CXX CLI]]&lt;br /&gt;
&lt;br /&gt;
== Walkthrough building PLPLot with Visual Studio ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Why can’t I just include all the code files in a project and press the build button?&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
PLplot makes every effort to be compatible with multiple different compilers on multiple OSs. It also uses third party libraries for backends/drivers. If every compiler exactly conformed to the (same) C++ and C standards and included nothing else and if every other library did the same then this would be easy. But they don’t and it isn’t. Some libraries only work on Linux or Windows and different compilers add extra features and although often the same additional features exist in different compilers they sometimes have different names or are in different header files. This all can make writing a cross platform library quite tricky.&lt;br /&gt;
&lt;br /&gt;
PLplot addresses this by using a build system called CMake. This is an extra layer of code between the C/C++ code and the compiler. The CMake code is run before you try to compile the library and it attempts to detect the various platform specific differences and create (in the case of Visual Studio) .sln and .proj files and a config.h file that fits your configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;A Walkthrough&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
I have spent some time trying to get CMake to work with my setup and the PLplot developers have helped with bug fixes to get this right so PLplot should now be straightforward to compile on windows. Fundamentally I want to end up with a visual studio sln file which I can use to build PLplot. It should ensure I have access to the libraries and backends/drivers that I want to use which include shapelib, wxWidgets, AGG and FreeType. Ideally it should include the examples and allow me to specify all the project properties I need so that if I update my code to the latest trunk version (which I do quite often) I don’t have to manually change lots of settings. Unfortunately there is a bit of a Linux bias to Cmake so here are some things that may catch you out, here are a few of those:&lt;br /&gt;
*When specifying paths to CMAKE, capitalisation matters.&lt;br /&gt;
*When CMAKE looks for additional libraries it sometimes only looks in the default Linux path so you might have to specify library locations&lt;br /&gt;
*All the defaults are to build dynamically linked dynamic libraries with dynamic runtime linkage – if you want anything else then you must specify so.&lt;br /&gt;
*If you need to recreate your sln files then it’s best to delete everything in your build directory and start again from scratch.&lt;br /&gt;
Anyhow here is a walkthrough of how I got everything working.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Backends/Drivers&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
PLplot could include code to write your plots to screen, memory, and the myriad of different file formats that you may want to use. However, if this was the case the developers would spend all their time looking at details of jpeg file formats or the different operating system device contexts. Instead PLplot has built in support for a few output devices and then uses other libraries referred to as drivers to output to most file types. In the walkthrough I’ll show you how to compile with just the built in outputs first, then I’ll add in shapefile support for maps using shapelib, and the wxWidgets driver with options for rendering with, AGG and Freetype.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Compiling a Basic PLplot Library&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
To build PLplot you will need some extra tools first. Download and install CMAKE from http://www.cmake.org/. Next if you want to use the very latest version of PLplot with the most up to date bug fixes you will need to access the Subversion repository to get the latest trunk version. To do this download tortoiseSVN from http://tortoisesvn.net/, then create a folder where you want to store the PLPlot source code (mine is D:\SourceCode\Libraries\plplot_trunk). Right click the folder and go to TortoiseSVN, Checkout. Enter the URL from http://plplot.sourceforge.net/download.php and click OK. If you ever need to update then right click the folder and click SVN Update. If you want the latest release version then you can download it from the same download link and just unzip it to a location of your choosing. If you have any doubt about whether you want the trunk version or the release version then my recommendation would be the trunk version. At the very least get the latest development release rather than the stable release as there have been a lot of updates and bug fixes since version 5.8.&lt;br /&gt;
&lt;br /&gt;
Now we can start the build process. open a cmd window and run the following batch file&lt;br /&gt;
&lt;br /&gt;
   C:\Program files\Microsoft Visual Studio 9.0\Common7\Tools\vsvars32.bat&lt;br /&gt;
&lt;br /&gt;
If you installed Visual Studio elsewhere then change the path accordingly and note that on 64 bit machines the default path is in Program Files(x86). This will define environment variables that CMAKE will use so keep this cmd prompt open and do all the following commands in it.&lt;br /&gt;
&lt;br /&gt;
Rather than compile PLplot ‘in place’ we’ll be building it in a separate directory, in fact we need two directories, one for release and one for debug. So create a these build directories. Mine are at D:\Sourcecode\Libraries\plplot_staticbuild_release, with another in the same location but ending debug. I think it is possible to create a release and debug version together in one .sln but i think there are potential clashes so I highly recommend creating a separate release and debug version in separate folders. In your cmd prompt navigate to the release directory.&lt;br /&gt;
&lt;br /&gt;
If you wish to add any extra compiler flags do so by setting the environment variables CXXFLAGS and CFLAGS in your cmd prompt. I use this facility to set the Unicode options&lt;br /&gt;
&lt;br /&gt;
   set CXXFLAGS=/DUNICODE /D_UNICODE&lt;br /&gt;
   set CFLAGS=/DUNICODE /D_UNICODE&lt;br /&gt;
&lt;br /&gt;
Note that you almost always want CXXFLAGS and CFLAGS to be identical.&lt;br /&gt;
&lt;br /&gt;
If you already have wxWidgets installed then you may wish to stop PLplot finding it for this basic build. To do so type &lt;br /&gt;
&lt;br /&gt;
   %WXWIN%&lt;br /&gt;
&lt;br /&gt;
and make a note of the path for later. Then enter&lt;br /&gt;
&lt;br /&gt;
   set WXWIN=&lt;br /&gt;
&lt;br /&gt;
Now call CMAKE as follows:&lt;br /&gt;
&lt;br /&gt;
   cmake &amp;quot;D:/SourceCode/Libraries/plplot trunk&amp;quot; -G &amp;quot;Visual Studio 9 2008&amp;quot; -DPL_DOUBLE=ON -DLIB_TAG=&amp;quot;sud&amp;quot; -DBUILD_TEST=ON -DCMAKE_INSTALL_PREFIX=&amp;quot;D:\SourceCode\Libraries\plplotinstall&amp;quot;  -DCMAKE_CONFIGURATION_TYPES=&amp;quot;Debug&amp;quot; -DBUILD_SHARED_LIBS=OFF -DSTATIC_RUNTIME=ON&lt;br /&gt;
&lt;br /&gt;
A full description of the parameters can be found in the reference below. You can obviously change them to suit your needs. Hopefully after a minute or two the screen output should end with &lt;br /&gt;
&lt;br /&gt;
   --Configuring done&lt;br /&gt;
   --Generating done&lt;br /&gt;
   --Build files have been written to D:/SourceCode/Libraries/plplot_staticbuild_release&lt;br /&gt;
&lt;br /&gt;
If you now go to your build directory you should see a solution which you can open in Visual Studio. Just open it up, right click the INSTALL project and select build, this will build your library and put it in the install directory. I use the LIB_TAG parameter to identify this as a static (s), Unicode (u) debug (d) library. Unfortunately some of the built libraries do not get your LIB_TAG added. So go to your install directory and do this manually, this stops them getting overwritten when you build the release version. You should now be able to find the examples in the build directory and try them out. You get a choice of which built in driver you want to use. There is a memory one, a Windows one that outputs to screen and ones that output to ps, svg and xfig files. Once you have a debug version, you can repeat the process in a new directory to create a debug version, make sure you change the LIB_TAG or install directory to avoid overwriting. Well done you now have PLplot up and running.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Other Libraries and Backends&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
PLplot relies on a number of drivers and backends to extend its output capabilities and allow reading of certain data files. I use a few of these and will guide you through adding them. Don’t be tempted to download precompiled .lib and .dll files. If you do then they may not have been compiled with the same setting that you use and may generate hard to fix linker errors. Problem setting can include character set (Unicode, vs multibyte vs not set) and static/dynamic linking to the runtime libraries (multithreaded, multithreaded dll, multithreaded debug, multithreaded debug dll). If you don’t know what static and dynamic linking are then find out because it will be the bane of your programming life if you don’t. I tend to add u to the end of a library name to indicate Unicode and s to indicate static (not dynamic) linkage to the runtime library and d to indicate debug.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Shapelib&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Shapelib allows you to read in .shp shapefileswhich contain vector map information into PLplot . PLPlot already has a coarse resolution global map included, but if you would like higher resolution then you need to add Shapelib. Global files with 10, 50 or 110 mile resolution are available from http://www.naturalearthdata.com and you can find other files online as you need. Shapelib itself is easy to compile, download it from http://shapelib.maptools.org/ create a new windows library project, add all the files and build debug and release versions as needed. There is no need to specify Unicode. To use it in PLplot add the following commands to your CMake call&lt;br /&gt;
&lt;br /&gt;
   -DHAVE_SHAPELIB=ON -DSHAPELIB_INCLUDE_DIR=&amp;quot;D:/SourceCode/Libraries/shapelib-1.3.0/include/shapelib&amp;quot; -DSHAPELIB_LIBRARY=&amp;quot;D:/SourceCode/Libraries/shapelib-1.3.0/lib/shapelibsd.lib&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Of course replace the values with ones appropriate for your system and make sure you use the debug or release library appropriately. Now in calls to plmap you can replace the map name with the path to a shapefile and the lines from this file will be used to draw the map.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;wxWidgets&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
I use wxWidgets for GUI output, it also allows output to various other graphics types like png, bmp, jpg, ps. If you wish to do the same then the best way is to install wxPack which is a fully working version of wxWidgets for Windows. It comes with a Visual Studio .sln file so saves you a lot of hassle. There are loads of instructions for compiling wxWidgets online, so I won’t repeat it all here. However you may wish to enable wxGraphicsContext (which gives anti-aliased output) and wxPostscriptDC to output to ps files. To do this, go through all the various setup.h and setup0.h and set &lt;br /&gt;
&lt;br /&gt;
   #define wxUSE_GRAPHICS_CONTEXT 1&lt;br /&gt;
   #define wxUSE_POSTSCRIPT 1&lt;br /&gt;
&lt;br /&gt;
Open the wxWidgets .sln file and if you wish to change between static and dynamic Runtime then change this in the project properties. Finally go to build, batch build and build all the versions of the library. This can take some time.&lt;br /&gt;
&lt;br /&gt;
For Visual Studio 2012 Users – I have found a few problems with building wxWidgets in VS2012 so I thought I’d add them here. &lt;br /&gt;
*First the Batch Build option is hidden. You can display it by going to Tools, customize, Commands and select the build menu.&lt;br /&gt;
*If you get a lot of build errors talking about CL.exe then this is caused by clashes between intermediate files of different projects. To fix it select all the projects in the solution explorer then right click them and select properties. Change the configuration to All Configurations then go to Configuration properties, General and change Intermediate Directory to $(ProjectName)\$(Platform)\$(Configuration)\.&lt;br /&gt;
*If you get a compilation error saying that the file pbt.h cannot be found in windows.cpp then go to the relevant line and comment it out. This header is no longer needed in wxWidgets and no longer included with Visual Studio but the #include got forgotten and left in the source.&lt;br /&gt;
*Finally if you want to build a 64 bit version do not try changing the Build Target in the project properties, this causes various linker errors. Instead go to Build, Configuration Manager... and in the active solution platform select &amp;lt;new&amp;gt; then select x64. This will create 64 bit configurations for all projects. Unfortunately you cannot build 64 bit and 32 bit libraries at the same time and if you have built a 32 bit library and want to build the 64 bit version (or vice versa) then you must clean the project first. See the install-msw-2.8.12.txt file shipped with wxWidgets for more info.&lt;br /&gt;
&lt;br /&gt;
Once you have wxWidgets built PLplot will automatically look for the WXWIN environmental variable which is created by wxPack, or should have been created by you if you set up wxWidgets manually. If you disabled wxWidgets above, then enter the following at the command prompt&lt;br /&gt;
&lt;br /&gt;
   set WXWIN=path/you/wrote/down/earlier&lt;br /&gt;
&lt;br /&gt;
If PLplot finds this environmental variable then it will include wxWidgets in the build. However, it seems that CMAKE doesn’t automatically determine if you are building with Unicode, so if you are then you must specify which wxWidgets build to use by adding the following parameter to your CMake command&lt;br /&gt;
&lt;br /&gt;
   DwxWidgets_CONFIGURATION=mswud&lt;br /&gt;
&lt;br /&gt;
Or for the release version use mswu, just like the suffix at the end of the wxWidgets library files.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;AGG and FreeType&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The wxWidgets driver can use three backends. The wxDC and wxGraphicsContect are part of wxWidgets and use Windows drawing routines. This means if you port your software to Linux the code will then use Linux drawing routines which may be slightly different. This might not be a big deal, but in case it is you can also make use of the cross platform AGG library to render anti-aliased graphics and AGG can either use PLplot’s basic text or the FreeType library for Unicode fonts. If you wish to use them then download the code for these projects. Both are quite straightforward. AGG seem to pride themselves on only using ‘pure’ C so for AGG you can just download the source from http://www.antigrain.com/ and add all the files to a visual studio project and build it. &lt;br /&gt;
If you are using FreeType then you can download the source form http://www.freetype.org/. The download includes a .sln file to build with Visual Studio.&lt;br /&gt;
&lt;br /&gt;
If using both FreeType and AGG then you should copy the files from your_agg_directory\font_freetype to your_agg_directory\include\agg2. You may wish to do the same with those in font_win32_tt, but it’s not needed for PLplot at present.&lt;br /&gt;
&lt;br /&gt;
Also don’t forget to ensure your character set and run time library linkage are set as you want them. To include AGG when you compile PLplot add the following parameters&lt;br /&gt;
&lt;br /&gt;
   DHAVE_AGG=ON -DAGG_INCLUDE_DIR=&amp;quot;D:/SourceCode/Libraries/agg-2.4/include&amp;quot; -DAGG_LIBRARIES=&amp;quot;D:/SourceCode/Libraries/agg-2.4/VC++/AGG/lib/AGGsud.lib&amp;quot;&lt;br /&gt;
&lt;br /&gt;
For FreeType use&lt;br /&gt;
&lt;br /&gt;
   -DWITH_FREETYPE=ON -DFREETYPE_INCLUDE_DIR=&amp;quot;D:/SourceCode/Libraries/freetype-2.4.8/include&amp;quot; -DFREETYPE_LIBRARY=&amp;quot;D:/SourceCode/Libraries/freetype-2.4.8/objs/win32/vc2008/freetypesud.lib&amp;quot;&lt;br /&gt;
But of course change the paths to match your system.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Summary and reference&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
So just so you see the whole thing, my final CMake command for a debug build is&lt;br /&gt;
&lt;br /&gt;
 cmake &amp;quot;D:/SourceCode/Libraries/plplot_trunk&amp;quot; -G &amp;quot;Visual Studio 9 2008&amp;quot; -DPL_DOUBLE=ON -DLIB_TAG=&amp;quot;su&amp;quot; -DBUILD_TEST=ON -DCMAKE_INSTALL_PREFIX=&amp;quot;D:\SourceCode\Libraries\plplotinstall&amp;quot; -DBUILD_SHARED_LIBS=OFF -DCMAKE_CONFIGURATION_TYPES=&amp;quot;Debug&amp;quot; -DSTATIC_RUNTIME=ON -DwxWidgets_CONFIGURATION=mswud -DHAVE_SHAPELIB=ON -DSHAPELIB_INCLUDE_DIR=&amp;quot;D:/SourceCode/Libraries/shapelib-1.3.0/include/shapelib&amp;quot; -DSHAPELIB_LIBRARY=&amp;quot;D:/SourceCode/Libraries/shapelib-1.3.0/lib/shapelibsd.lib&amp;quot;  -DHAVE_AGG=ON -DAGG_INCLUDE_DIR=&amp;quot;D:/SourceCode/Libraries/agg-2.4/include&amp;quot; -DAGG_LIBRARIES=&amp;quot;D:/SourceCode/Libraries/agg-2.4/VC++/AGG/lib/AGGsud.lib&amp;quot; -DWITH_FREETYPE=ON -DFREETYPE_INCLUDE_DIR=&amp;quot;D:/SourceCode/Libraries/freetype-2.4.8/include&amp;quot; -DFREETYPE_LIBRARY=&amp;quot;D:/SourceCode/Libraries/freetype-2.4.8/objs/win32/vc2008/freetypesud.lib&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
For reference here is a quick rundown of each of the parameters&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;“D:/SourceCode/Libraries/plplot trunk”:&amp;#039;&amp;#039;&amp;#039; the path to my source directory – case sensitive.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;-G “Visual Studio 9 2008”:&amp;#039;&amp;#039;&amp;#039; the compiler I want to generate a project/solution for.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;-DPL_DOUBLE=ON:&amp;#039;&amp;#039;&amp;#039; use doubles, rather than floats in PLplot. Also adds d to the library names.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;-DLIB_TAG=”su”:&amp;#039;&amp;#039;&amp;#039; this will append “su” to the end of the library name and is an indicator to me that I’m using static linkage with the Unicode character set. I use sud for static Unicode debug etc.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;-DBUILD_TEST=ON:&amp;#039;&amp;#039;&amp;#039; Indicates I want to create projects for the examples. Set to OFF to not build them.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;-DCMAKE_INSTALL_PREFIX=”D:\SourceCode\Libraries\plplotinstall”&amp;#039;&amp;#039;&amp;#039; The directory you want your final libraries to end up in, it will be created if it doesn’t exist. If you leave this blank it defaults to C:\Program Files\PLplot, however in Windows Vista or later UAC will stop the file being written here unless you run Visual Studio as administrator.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;-DCMAKE_CONFIGURATION_TYPES=”Release”:&amp;#039;&amp;#039;&amp;#039; The configuration to use in the project. You can run create multiple configurations in one solution by listing them separated by semicolons, but if using Shapelib, FreeType or AGG this causes linking problems with the examples as you can’t specify linkage against the release and debug versions separated by semicolons. It also causes issues with installing to one directory so it’s best to create on sln for each configuration. You can include Release, Debug, MinSizeRel and RelWithDebInfo. &lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;-DSTATIC_RUNTIME=ON:&amp;#039;&amp;#039;&amp;#039; This causes us to link against the static runtime (equivalent to /MT or /MTd flags). Set it to OFF if you want to link against the dynamic runtime (equivalent to /MD or /MDd). &lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;-DBUILD_SHARED_LIBS=OFF&amp;#039;&amp;#039;&amp;#039; Build a .lib rather than a .dll. If you don’t set this the default will be to build dlls.All the options above except the source directory and compiler are optional and will be set to default values if excluded. &lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Anything with AGG in:&amp;#039;&amp;#039;&amp;#039; These point out that I want to use AGG and specifies the location of header files and the library itself. The library is only needed if –DBUILD_TEST is ON. None are needed if you are not using AGG.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Anything with FREETYPE in:&amp;#039;&amp;#039;&amp;#039; As with the AGG stuff it indicates I want to use FreeType and gives the location of the headers and library. Note that the variables have slightly different names to the AGG ones. Again the library is only needed when building the examples.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Anything with SHAPELIB in:&amp;#039;&amp;#039;&amp;#039; As for the FREETYPE and AGG parameters, but for shapelib.&lt;br /&gt;
&lt;br /&gt;
There are also other customisable options and after you’ve run CMAKE you can examine the CMakeCache.txt file that is created in your build directory to see others (prepend -D to define them on the command line) or look at the wiki page or CMAKE documentation.&lt;br /&gt;
&lt;br /&gt;
== Bugs and Issues ==&lt;br /&gt;
&lt;br /&gt;
Using version 2.8.2 of CMake there are some snags you may find.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Common Errors&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;I see linker errors regarding strings or wxStrings or chars and wchars&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Unicode and non Unicode libraries often use strings made of either wchars or chars silently behind the scenes. If you have mixed libraries built with unicode with ones built with the charecter set not set then these clash during linking. Did you specify the wxWidget configuration to ensure you get the Unicode version of wxWidgets? Or perhaps one of the other libraries you are using has this set differently to PLplot.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;I see linker errors which mention function which have dbg in&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Microsoft supply four different versions of the C++ runtime with either static/dynamic linkage and for either debug/release. It sounds like you have mixed libraries which use debug with ones that use release. I&amp;#039;m afraid you have to go through and check them all.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;I see linker errors which mention functions which have imp_ in&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
See the dbg linker errors, except this is likely due to mixing libraries with static and dynamic linkage.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Problems with old PLplot versions (2.9.9 and before)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Here are some snags which may affect older versions of PLplot, if you see these symptoms please upgrade to version 2.9.10 or the latest trunk version via SVN&lt;br /&gt;
&lt;br /&gt;
*When embedding a PLplot in a wxWidgets application the application may hang during initialisation. Caused by both PLplot and your application trying to initialise message loops.&lt;br /&gt;
&lt;br /&gt;
*Linker errors occur in release builds of software which includes the PLplot library and the wxWidget driver. They reference functions which have dbg in their name. This was caused by a CMAKE bug which defined the _DEBUG and __WXDEUG__ preprocessor variables in release mode when using wxWidgets. A workaround has been added to PLplot. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Intel Fortran&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
If you use Intel Fortran, the solution/project files may cause errors when building. These affect only the Fortran libraries and examples. It is due to a small bug in CMake that should be fixed with the next release.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Workaround for examples built with Visual Studio&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
There have been some reported problems with running the examples when building ith Visual Studio. This seems fine when building static libraries, but may still persist with dynamic ones. If you have problems then try the folowing&lt;br /&gt;
&lt;br /&gt;
* Build the PLplot libraries and examples via the ALL_BUILD project&lt;br /&gt;
* Open a DOS box in the Debug directory for any one of these examples&lt;br /&gt;
* Set the following environment variables:&lt;br /&gt;
&lt;br /&gt;
   set path=&amp;lt;build&amp;gt;\dll\Debug;%PATH% &lt;br /&gt;
   set PLPLOT_DRV_DIR=&amp;lt;build&amp;gt;\drivers    &lt;br /&gt;
   set PLPLOT_LIB=&amp;lt;source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   where: &amp;lt;build&amp;gt; is the directory where PLplot was built&lt;br /&gt;
   and the directory &amp;quot;&amp;lt;source&amp;gt;\data&amp;quot; holds the .pal and .fnt files&lt;br /&gt;
* In this environment you can run the sample program&lt;/div&gt;</summary>
		<author><name>Philrosenberg</name></author>	</entry>

	<entry>
		<id>http://www.miscdebris.net/plplot_wiki/index.php?title=Configure_PLplot_for_the_Visual_Studio_IDE&amp;diff=3013</id>
		<title>Configure PLplot for the Visual Studio IDE</title>
		<link rel="alternate" type="text/html" href="http://www.miscdebris.net/plplot_wiki/index.php?title=Configure_PLplot_for_the_Visual_Studio_IDE&amp;diff=3013"/>
				<updated>2013-09-27T14:10:31Z</updated>
		
		<summary type="html">&lt;p&gt;Philrosenberg: Added link to CLI page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page details how to build PLplot using the Visual Studio integrated development environment via project and solution files. If you wish to use NMake from the command line see [[Configure PLplot for Visual CXX CLI]]&lt;br /&gt;
&lt;br /&gt;
CMake allows you to generate Visual Studio solution and project files. &lt;br /&gt;
&lt;br /&gt;
As of version 2.8.2 of CMake, here are a few caveats:&lt;br /&gt;
&lt;br /&gt;
* If you use Intel Fortran, the solution/project files may cause errors when building. These affect only the Fortran libraries and examples. It is due to a small bug in CMake that should be fixed with the next release.&lt;br /&gt;
* For some reason you can not run the examples directly. We have not found out yet what is the matter, but there is a workaround - see below.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Workaround for examples built with Visual Studio&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
* Build the PLplot libraries and examples via the ALL_BUILD project&lt;br /&gt;
* Open a DOS box in the Debug directory for any one of these examples&lt;br /&gt;
* Set the following environment variables:&lt;br /&gt;
&lt;br /&gt;
   set path=&amp;lt;build&amp;gt;\dll\Debug;%PATH% &lt;br /&gt;
   set PLPLOT_DRV_DIR=&amp;lt;build&amp;gt;\drivers    &lt;br /&gt;
   set PLPLOT_LIB=&amp;lt;source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   where: &amp;lt;build&amp;gt; is the directory where PLplot was built&lt;br /&gt;
   and the directory &amp;quot;&amp;lt;source&amp;gt;\data&amp;quot; holds the .pal and .fnt files&lt;br /&gt;
* In this environment you can run the sample program&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Walkthrough building PLPLot with Visual Studio ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Why can’t I just include all the code files in a project and press the build button?&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
PLplot makes every effort to be compatible with multiple different compilers on multiple OSs. It also uses third party libraries for backends/drivers. If every compiler exactly conformed to the (same) C++ and C standards and included nothing else and if every other library did the same then this would be easy. But they don’t and it isn’t. Some libraries only work on Linux or Windows and different compilers add extra features and although often the same additional features exist in different compilers they sometimes have different names or are in different header files. This all can make writing a cross platform library quite tricky.&lt;br /&gt;
&lt;br /&gt;
PLplot addresses this by using a build system called CMake. This is an extra layer of code between the C/C++ code and the compiler. The CMake code is run before you try to compile the library and it attempts to detect the various platform specific differences and create (in the case of Visual Studio) .sln and .proj files and a config.h file that fits your configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;A Walkthrough&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
I have spent some time trying to get CMake to work with my setup and the PLplot developers have helped with bug fixes to get this right so PLplot should now be straightforward to compile on windows. Fundamentally I want to end up with a visual studio sln file which I can use to build PLplot. It should ensure I have access to the libraries and backends/drivers that I want to use which include shapelib, wxWidgets, AGG and FreeType. Ideally it should include the examples and allow me to specify all the project properties I need so that if I update my code to the latest trunk version (which I do quite often) I don’t have to manually change lots of settings. Unfortunately there is a bit of a Linux bias to Cmake so here are some things that may catch you out, here are a few of those:&lt;br /&gt;
*When specifying paths to CMAKE, capitalisation matters.&lt;br /&gt;
*When CMAKE looks for additional libraries it sometimes only looks in the default Linux path so you might have to specify library locations&lt;br /&gt;
*All the defaults are to build dynamically linked dynamic libraries with dynamic runtime linkage – if you want anything else then you must specify so.&lt;br /&gt;
*If you need to recreate your sln files then it’s best to delete everything in your build directory and start again from scratch.&lt;br /&gt;
Anyhow here is a walkthrough of how I got everything working.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Backends/Drivers&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
PLplot could include code to write your plots to screen, memory, and the myriad of different file formats that you may want to use. However, if this was the case the developers would spend all their time looking at details of jpeg file formats or the different operating system device contexts. Instead PLplot has built in support for a few output devices and then uses other libraries referred to as drivers to output to most file types. In the walkthrough I’ll show you how to compile with just the built in outputs first, then I’ll add in shapefile support for maps using shapelib, and the wxWidgets driver with options for rendering with, AGG and Freetype.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Compiling a Basic PLplot Library&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
To build PLplot you will need some extra tools first. Download and install CMAKE from http://www.cmake.org/. Next if you want to use the very latest version of PLplot with the most up to date bug fixes you will need to access the Subversion repository to get the latest trunk version. To do this download tortoiseSVN from http://tortoisesvn.net/, then create a folder where you want to store the PLPlot source code (mine is D:\SourceCode\Libraries\plplot_trunk). Right click the folder and go to TortoiseSVN, Checkout. Enter the URL from http://plplot.sourceforge.net/download.php and click OK. If you ever need to update then right click the folder and click SVN Update. If you want the latest release version then you can download it from the same download link and just unzip it to a location of your choosing. If you have any doubt about whether you want the trunk version or the release version then my recommendation would be the trunk version. At the very least get the latest development release rather than the stable release as there have been a lot of updates and bug fixes since version 5.8.&lt;br /&gt;
&lt;br /&gt;
Now we can start the build process. open a cmd window and run the following batch file&lt;br /&gt;
&lt;br /&gt;
   C:\Program files\Microsoft Visual Studio 9.0\Common7\Tools\vsvars32.bat&lt;br /&gt;
&lt;br /&gt;
If you installed Visual Studio elsewhere then change the path accordingly and note that on 64 bit machines the default path is in Program Files(x86). This will define environment variables that CMAKE will use so keep this cmd prompt open and do all the following commands in it.&lt;br /&gt;
&lt;br /&gt;
Rather than compile PLplot ‘in place’ we’ll be building it in a separate directory, in fact we need two directories, one for release and one for debug. So create a these build directories. Mine are at D:\Sourcecode\Libraries\plplot_staticbuild_release, with another in the same location but ending debug. I think it is possible to create a release and debug version together in one .sln but i think there are potential clashes so I highly recommend creating a separate release and debug version in separate folders. In your cmd prompt navigate to the release directory.&lt;br /&gt;
&lt;br /&gt;
If you wish to add any extra compiler flags do so by setting the environment variables CXXFLAGS and CFLAGS in your cmd prompt. I use this facility to set the Unicode options&lt;br /&gt;
&lt;br /&gt;
   set CXXFLAGS=/DUNICODE /D_UNICODE&lt;br /&gt;
   set CFLAGS=/DUNICODE /D_UNICODE&lt;br /&gt;
&lt;br /&gt;
Note that you almost always want CXXFLAGS and CFLAGS to be identical.&lt;br /&gt;
&lt;br /&gt;
If you already have wxWidgets installed then you may wish to stop PLplot finding it for this basic build. To do so type &lt;br /&gt;
&lt;br /&gt;
   %WXWIN%&lt;br /&gt;
&lt;br /&gt;
and make a note of the path for later. Then enter&lt;br /&gt;
&lt;br /&gt;
   set WXWIN=&lt;br /&gt;
&lt;br /&gt;
Now call CMAKE as follows:&lt;br /&gt;
&lt;br /&gt;
   cmake &amp;quot;D:/SourceCode/Libraries/plplot trunk&amp;quot; -G &amp;quot;Visual Studio 9 2008&amp;quot; -DPL_DOUBLE=ON -DLIB_TAG=&amp;quot;sud&amp;quot; -DBUILD_TEST=ON -DCMAKE_INSTALL_PREFIX=&amp;quot;D:\SourceCode\Libraries\plplotinstall&amp;quot;  -DCMAKE_CONFIGURATION_TYPES=&amp;quot;Debug&amp;quot; -DBUILD_SHARED_LIBS=OFF -DSTATIC_RUNTIME=ON&lt;br /&gt;
&lt;br /&gt;
A full description of the parameters can be found in the reference below. You can obviously change them to suit your needs. Hopefully after a minute or two the screen output should end with &lt;br /&gt;
&lt;br /&gt;
   --Configuring done&lt;br /&gt;
   --Generating done&lt;br /&gt;
   --Build files have been written to D:/SourceCode/Libraries/plplot_staticbuild_release&lt;br /&gt;
&lt;br /&gt;
If you now go to your build directory you should see a solution which you can open in Visual Studio. Just open it up, right click the INSTALL project and select build, this will build your library and put it in the install directory. I use the LIB_TAG parameter to identify this as a static (s), Unicode (u) debug (d) library. Unfortunately some of the built libraries do not get your LIB_TAG added. So go to your install directory and do this manually, this stops them getting overwritten when you build the release version. You should now be able to find the examples in the build directory and try them out. You get a choice of which built in driver you want to use. There is a memory one, a Windows one that outputs to screen and ones that output to ps, svg and xfig files. Once you have a debug version, you can repeat the process in a new directory to create a debug version, make sure you change the LIB_TAG or install directory to avoid overwriting. Well done you now have PLplot up and running.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Other Libraries and Backends&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
PLplot relies on a number of drivers and backends to extend its output capabilities and allow reading of certain data files. I use a few of these and will guide you through adding them. Don’t be tempted to download precompiled .lib and .dll files. If you do then they may not have been compiled with the same setting that you use and may generate hard to fix linker errors. Problem setting can include character set (Unicode, vs multibyte vs not set) and static/dynamic linking to the runtime libraries (multithreaded, multithreaded dll, multithreaded debug, multithreaded debug dll). If you don’t know what static and dynamic linking are then find out because it will be the bane of your programming life if you don’t. I tend to add u to the end of a library name to indicate Unicode and s to indicate static (not dynamic) linkage to the runtime library and d to indicate debug.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Shapelib&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Shapelib allows you to read in .shp shapefileswhich contain vector map information into PLplot . PLPlot already has a coarse resolution global map included, but if you would like higher resolution then you need to add Shapelib. Global files with 10, 50 or 110 mile resolution are available from http://www.naturalearthdata.com and you can find other files online as you need. Shapelib itself is easy to compile, download it from http://shapelib.maptools.org/ create a new windows library project, add all the files and build debug and release versions as needed. There is no need to specify Unicode. To use it in PLplot add the following commands to your CMake call&lt;br /&gt;
&lt;br /&gt;
   -DHAVE_SHAPELIB=ON -DSHAPELIB_INCLUDE_DIR=&amp;quot;D:/SourceCode/Libraries/shapelib-1.3.0/include/shapelib&amp;quot; -DSHAPELIB_LIBRARY=&amp;quot;D:/SourceCode/Libraries/shapelib-1.3.0/lib/shapelibsd.lib&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Of course replace the values with ones appropriate for your system and make sure you use the debug or release library appropriately. Now in calls to plmap you can replace the map name with the path to a shapefile and the lines from this file will be used to draw the map.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;wxWidgets&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
I use wxWidgets for GUI output, it also allows output to various other graphics types like png, bmp, jpg, ps. If you wish to do the same then the best way is to install wxPack which is a fully working version of wxWidgets for Windows. It comes with a Visual Studio .sln file so saves you a lot of hassle. There are loads of instructions for compiling wxWidgets online, so I won’t repeat it all here. However you may wish to enable wxGraphicsContext (which gives anti-aliased output) and wxPostscriptDC to output to ps files. To do this, go through all the various setup.h and setup0.h and set &lt;br /&gt;
&lt;br /&gt;
   #define wxUSE_GRAPHICS_CONTEXT 1&lt;br /&gt;
   #define wxUSE_POSTSCRIPT 1&lt;br /&gt;
&lt;br /&gt;
Open the wxWidgets .sln file and if you wish to change between static and dynamic Runtime then change this in the project properties. Finally go to build, batch build and build all the versions of the library. This can take some time.&lt;br /&gt;
&lt;br /&gt;
For Visual Studio 2012 Users – I have found a few problems with building wxWidgets in VS2012 so I thought I’d add them here. &lt;br /&gt;
*First the Batch Build option is hidden. You can display it by going to Tools, customize, Commands and select the build menu.&lt;br /&gt;
*If you get a lot of build errors talking about CL.exe then this is caused by clashes between intermediate files of different projects. To fix it select all the projects in the solution explorer then right click them and select properties. Change the configuration to All Configurations then go to Configuration properties, General and change Intermediate Directory to $(ProjectName)\$(Platform)\$(Configuration)\.&lt;br /&gt;
*If you get a compilation error saying that the file pbt.h cannot be found in windows.cpp then go to the relevant line and comment it out. This header is no longer needed in wxWidgets and no longer included with Visual Studio but the #include got forgotten and left in the source.&lt;br /&gt;
*Finally if you want to build a 64 bit version do not try changing the Build Target in the project properties, this causes various linker errors. Instead go to Build, Configuration Manager... and in the active solution platform select &amp;lt;new&amp;gt; then select x64. This will create 64 bit configurations for all projects. Unfortunately you cannot build 64 bit and 32 bit libraries at the same time and if you have built a 32 bit library and want to build the 64 bit version (or vice versa) then you must clean the project first. See the install-msw-2.8.12.txt file shipped with wxWidgets for more info.&lt;br /&gt;
&lt;br /&gt;
Once you have wxWidgets built PLplot will automatically look for the WXWIN environmental variable which is created by wxPack, or should have been created by you if you set up wxWidgets manually. If you disabled wxWidgets above, then enter the following at the command prompt&lt;br /&gt;
&lt;br /&gt;
   set WXWIN=path/you/wrote/down/earlier&lt;br /&gt;
&lt;br /&gt;
If PLplot finds this environmental variable then it will include wxWidgets in the build. However, it seems that CMAKE doesn’t automatically determine if you are building with Unicode, so if you are then you must specify which wxWidgets build to use by adding the following parameter to your CMake command&lt;br /&gt;
&lt;br /&gt;
   DwxWidgets_CONFIGURATION=mswud&lt;br /&gt;
&lt;br /&gt;
Or for the release version use mswu, just like the suffix at the end of the wxWidgets library files.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;AGG and FreeType&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The wxWidgets driver can use three backends. The wxDC and wxGraphicsContect are part of wxWidgets and use Windows drawing routines. This means if you port your software to Linux the code will then use Linux drawing routines which may be slightly different. This might not be a big deal, but in case it is you can also make use of the cross platform AGG library to render anti-aliased graphics and AGG can either use PLplot’s basic text or the FreeType library for Unicode fonts. If you wish to use them then download the code for these projects. Both are quite straightforward. AGG seem to pride themselves on only using ‘pure’ C so for AGG you can just download the source from http://www.antigrain.com/ and add all the files to a visual studio project and build it. &lt;br /&gt;
If you are using FreeType then you can download the source form http://www.freetype.org/. The download includes a .sln file to build with Visual Studio.&lt;br /&gt;
&lt;br /&gt;
If using both FreeType and AGG then you should copy the files from your_agg_directory\font_freetype to your_agg_directory\include\agg2. You may wish to do the same with those in font_win32_tt, but it’s not needed for PLplot at present.&lt;br /&gt;
&lt;br /&gt;
Also don’t forget to ensure your character set and run time library linkage are set as you want them. To include AGG when you compile PLplot add the following parameters&lt;br /&gt;
&lt;br /&gt;
   DHAVE_AGG=ON -DAGG_INCLUDE_DIR=&amp;quot;D:/SourceCode/Libraries/agg-2.4/include&amp;quot; -DAGG_LIBRARIES=&amp;quot;D:/SourceCode/Libraries/agg-2.4/VC++/AGG/lib/AGGsud.lib&amp;quot;&lt;br /&gt;
&lt;br /&gt;
For FreeType use&lt;br /&gt;
&lt;br /&gt;
   -DWITH_FREETYPE=ON -DFREETYPE_INCLUDE_DIR=&amp;quot;D:/SourceCode/Libraries/freetype-2.4.8/include&amp;quot; -DFREETYPE_LIBRARY=&amp;quot;D:/SourceCode/Libraries/freetype-2.4.8/objs/win32/vc2008/freetypesud.lib&amp;quot;&lt;br /&gt;
But of course change the paths to match your system.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Summary and reference&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
So just so you see the whole thing, my final CMake command for a debug build is&lt;br /&gt;
&lt;br /&gt;
 cmake &amp;quot;D:/SourceCode/Libraries/plplot_trunk&amp;quot; -G &amp;quot;Visual Studio 9 2008&amp;quot; -DPL_DOUBLE=ON -DLIB_TAG=&amp;quot;su&amp;quot; -DBUILD_TEST=ON -DCMAKE_INSTALL_PREFIX=&amp;quot;D:\SourceCode\Libraries\plplotinstall&amp;quot; -DBUILD_SHARED_LIBS=OFF -DCMAKE_CONFIGURATION_TYPES=&amp;quot;Debug&amp;quot; -DSTATIC_RUNTIME=ON -DwxWidgets_CONFIGURATION=mswud -DHAVE_SHAPELIB=ON -DSHAPELIB_INCLUDE_DIR=&amp;quot;D:/SourceCode/Libraries/shapelib-1.3.0/include/shapelib&amp;quot; -DSHAPELIB_LIBRARY=&amp;quot;D:/SourceCode/Libraries/shapelib-1.3.0/lib/shapelibsd.lib&amp;quot;  -DHAVE_AGG=ON -DAGG_INCLUDE_DIR=&amp;quot;D:/SourceCode/Libraries/agg-2.4/include&amp;quot; -DAGG_LIBRARIES=&amp;quot;D:/SourceCode/Libraries/agg-2.4/VC++/AGG/lib/AGGsud.lib&amp;quot; -DWITH_FREETYPE=ON -DFREETYPE_INCLUDE_DIR=&amp;quot;D:/SourceCode/Libraries/freetype-2.4.8/include&amp;quot; -DFREETYPE_LIBRARY=&amp;quot;D:/SourceCode/Libraries/freetype-2.4.8/objs/win32/vc2008/freetypesud.lib&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
For reference here is a quick rundown of each of the parameters&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;“D:/SourceCode/Libraries/plplot trunk”:&amp;#039;&amp;#039;&amp;#039; the path to my source directory – case sensitive.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;-G “Visual Studio 9 2008”:&amp;#039;&amp;#039;&amp;#039; the compiler I want to generate a project/solution for.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;-DPL_DOUBLE=ON:&amp;#039;&amp;#039;&amp;#039; use doubles, rather than floats in PLplot. Also adds d to the library names.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;-DLIB_TAG=”su”:&amp;#039;&amp;#039;&amp;#039; this will append “su” to the end of the library name and is an indicator to me that I’m using static linkage with the Unicode character set. I use sud for static Unicode debug etc.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;-DBUILD_TEST=ON:&amp;#039;&amp;#039;&amp;#039; Indicates I want to create projects for the examples. Set to OFF to not build them.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;-DCMAKE_INSTALL_PREFIX=”D:\SourceCode\Libraries\plplotinstall”&amp;#039;&amp;#039;&amp;#039; The directory you want your final libraries to end up in, it will be created if it doesn’t exist. If you leave this blank it defaults to C:\Program Files\PLplot, however in Windows Vista or later UAC will stop the file being written here unless you run Visual Studio as administrator.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;-DCMAKE_CONFIGURATION_TYPES=”Release”:&amp;#039;&amp;#039;&amp;#039; The configuration to use in the project. You can run create multiple configurations in one solution by listing them separated by semicolons, but if using Shapelib, FreeType or AGG this causes linking problems with the examples as you can’t specify linkage against the release and debug versions separated by semicolons. It also causes issues with installing to one directory so it’s best to create on sln for each configuration. You can include Release, Debug, MinSizeRel and RelWithDebInfo. &lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;-DSTATIC_RUNTIME=ON:&amp;#039;&amp;#039;&amp;#039; This causes us to link against the static runtime (equivalent to /MT or /MTd flags). Set it to OFF if you want to link against the dynamic runtime (equivalent to /MD or /MDd). &lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;-DBUILD_SHARED_LIBS=OFF&amp;#039;&amp;#039;&amp;#039; Build a .lib rather than a .dll. If you don’t set this the default will be to build dlls.All the options above except the source directory and compiler are optional and will be set to default values if excluded. &lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Anything with AGG in:&amp;#039;&amp;#039;&amp;#039; These point out that I want to use AGG and specifies the location of header files and the library itself. The library is only needed if –DBUILD_TEST is ON. None are needed if you are not using AGG.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Anything with FREETYPE in:&amp;#039;&amp;#039;&amp;#039; As with the AGG stuff it indicates I want to use FreeType and gives the location of the headers and library. Note that the variables have slightly different names to the AGG ones. Again the library is only needed when building the examples.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Anything with SHAPELIB in:&amp;#039;&amp;#039;&amp;#039; As for the FREETYPE and AGG parameters, but for shapelib.&lt;br /&gt;
&lt;br /&gt;
There are also other customisable options and after you’ve run CMAKE you can examine the CMakeCache.txt file that is created in your build directory to see others (prepend -D to define them on the command line) or look at the wiki page or CMAKE documentation.&lt;/div&gt;</summary>
		<author><name>Philrosenberg</name></author>	</entry>

	<entry>
		<id>http://www.miscdebris.net/plplot_wiki/index.php?title=Specifics_for_various_platforms&amp;diff=3012</id>
		<title>Specifics for various platforms</title>
		<link rel="alternate" type="text/html" href="http://www.miscdebris.net/plplot_wiki/index.php?title=Specifics_for_various_platforms&amp;diff=3012"/>
				<updated>2013-09-27T14:07:56Z</updated>
		
		<summary type="html">&lt;p&gt;Philrosenberg: Added link to Visual Studio IDE page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Before reading this section you should consult [[Building_PLplot]] to obtain generic build instructions.&lt;br /&gt;
==== Linux ====&lt;br /&gt;
* [[Linux]]&lt;br /&gt;
* [[List of Debian/Ubuntu packages]] - in order to be able to configure and compile the PLplot library this page contains a list of Debian/Ubuntu packages needed.&lt;br /&gt;
* [[Additional notes for ifort users]]&lt;br /&gt;
&lt;br /&gt;
==== Mac OSX ====&lt;br /&gt;
* [[Mac OSX]] instructions&lt;br /&gt;
&lt;br /&gt;
==== Windows ====&lt;br /&gt;
&lt;br /&gt;
===== Free and open-source tools to help build a powerful version of PLplot on Windows =====&lt;br /&gt;
&lt;br /&gt;
* [[Install MinGW/MSYS]]&lt;br /&gt;
* [[Install SWIG]]&lt;br /&gt;
* [[Install Python]]&lt;br /&gt;
* [[Install Lua]]&lt;br /&gt;
* [[Install Tcl]]&lt;br /&gt;
* [[Install Octave]]&lt;br /&gt;
* [[Install 3rd party libraries]]&lt;br /&gt;
&lt;br /&gt;
===== Instructions per Windows platform =====&lt;br /&gt;
&lt;br /&gt;
* [[Configure PLplot for Visual Studio IDE]]&lt;br /&gt;
* [[Configure PLplot for Visual CXX CLI]]&lt;br /&gt;
* [[Configure PLplot for MinGW/CLI]]&lt;br /&gt;
* [[Configure PLplot for cygwin]]&lt;br /&gt;
* [[Configure PLplot for Borland CXX 5.5 (free command line tools)]]&lt;br /&gt;
* [[Configure PLplot for Borland Turbo C++ Explorer Edition (free IDE and compiler)]]&lt;/div&gt;</summary>
		<author><name>Philrosenberg</name></author>	</entry>

	<entry>
		<id>http://www.miscdebris.net/plplot_wiki/index.php?title=Talk:Configure_PLplot_for_Visual_CXX_CLI&amp;diff=3010</id>
		<title>Talk:Configure PLplot for Visual CXX CLI</title>
		<link rel="alternate" type="text/html" href="http://www.miscdebris.net/plplot_wiki/index.php?title=Talk:Configure_PLplot_for_Visual_CXX_CLI&amp;diff=3010"/>
				<updated>2013-09-27T14:06:50Z</updated>
		
		<summary type="html">&lt;p&gt;Philrosenberg: moved Talk:Configure PLplot for Visual CXX to Talk:Configure PLplot for Visual CXX CLI: Differentiate IDE and CLI pages&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I have spent litterally dats trying to build PLplot and unfortunately I didn&amp;#039;t find the wiki very useful. I fully understand that the people working on the PLplot project are busy coding rather than documenting so that&amp;#039;s just the way open source is. Anyway, my big problem was that I&amp;#039;d never used CMake or nmake before so I struggled to get started. I&amp;#039;m also trying to build wxplplot so that added extra complications. Now that I&amp;#039;ve got it built I thought it would help others if I put a step by step on how I did it with a little background info for others who haven&amp;#039;t used CMake before. I hope this is okay and that it is useful to others.&lt;br /&gt;
&lt;br /&gt;
As an extra note, I had to rename the libraries after each build to avoid the libraries getting overwritten. I saw that each file was appended by the letter d (for debug?) and it seemed that this was set using the LIB_TAG variable, but adding -DLIB_TAG=&amp;#039;s&amp;#039; (for static for example) to the cmake call made no difference. Any ideas? If so please feel free to make the command a bit more elegant.&lt;br /&gt;
&lt;br /&gt;
Phil&lt;/div&gt;</summary>
		<author><name>Philrosenberg</name></author>	</entry>

	<entry>
		<id>http://www.miscdebris.net/plplot_wiki/index.php?title=Talk:Configure_PLplot_for_Visual_CXX&amp;diff=3011</id>
		<title>Talk:Configure PLplot for Visual CXX</title>
		<link rel="alternate" type="text/html" href="http://www.miscdebris.net/plplot_wiki/index.php?title=Talk:Configure_PLplot_for_Visual_CXX&amp;diff=3011"/>
				<updated>2013-09-27T14:06:50Z</updated>
		
		<summary type="html">&lt;p&gt;Philrosenberg: moved Talk:Configure PLplot for Visual CXX to Talk:Configure PLplot for Visual CXX CLI: Differentiate IDE and CLI pages&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Talk:Configure PLplot for Visual CXX CLI]]&lt;/div&gt;</summary>
		<author><name>Philrosenberg</name></author>	</entry>

	<entry>
		<id>http://www.miscdebris.net/plplot_wiki/index.php?title=Configure_PLplot_for_Visual_CXX_CLI&amp;diff=3008</id>
		<title>Configure PLplot for Visual CXX CLI</title>
		<link rel="alternate" type="text/html" href="http://www.miscdebris.net/plplot_wiki/index.php?title=Configure_PLplot_for_Visual_CXX_CLI&amp;diff=3008"/>
				<updated>2013-09-27T14:06:49Z</updated>
		
		<summary type="html">&lt;p&gt;Philrosenberg: moved Configure PLplot for Visual CXX to Configure PLplot for Visual CXX CLI: Differentiate IDE and CLI pages&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page describes how to build PLplot using Visual Studio from the command line. If you wish to use the Integrated Development Environment see [[Configure PLplot for the Visual Studio IDE]].&lt;br /&gt;
&lt;br /&gt;
You need a working Visual C++ and CMake installation. &lt;br /&gt;
&lt;br /&gt;
Start a DOS window (command window) - for instance via the Start menu item &amp;quot;Visual Studio Tools/Visual Studio 2008 command prompt&amp;quot;. CMake must be able to run the Visual C/C++ compiler. (You can also use the batch file vcvarsall.bat in the directory &amp;quot;&amp;lt;MSVC++ isntall directory&amp;gt;\VC&amp;quot; to take care of all settings).&lt;br /&gt;
&lt;br /&gt;
Create a new directory for building PLplot (say: d:\build-plplot) and change to that directory.&lt;br /&gt;
Add the directory &amp;quot;d:\build-plplot\dll&amp;quot; to the path.&lt;br /&gt;
&lt;br /&gt;
So the commands are:&lt;br /&gt;
&lt;br /&gt;
 d:&lt;br /&gt;
 mkdir build-plplot&lt;br /&gt;
 cd build-plplot&lt;br /&gt;
 set path=d:\build-plplot\dll;%path%&lt;br /&gt;
&lt;br /&gt;
Now run CMake (assuming CMake is already in the path and sources for PLplot are in &amp;quot;d:\plplot&amp;quot;: &lt;br /&gt;
&lt;br /&gt;
 cmake d:\plplot -G &amp;quot;NMake Makefiles&amp;quot; -DBUILD_TEST=ON&lt;br /&gt;
&lt;br /&gt;
(The latter option ensures that the examples are built. Many more options are available)&lt;br /&gt;
&lt;br /&gt;
Once CMake has generated all the makefiles, you can build the PLplot libraries and examples&lt;br /&gt;
via the nmake command:&lt;br /&gt;
&lt;br /&gt;
 nmake&lt;br /&gt;
&lt;br /&gt;
To install the libraries:&lt;br /&gt;
&lt;br /&gt;
 nmake install&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039; The above assumes you are &amp;#039;&amp;#039;not&amp;#039;&amp;#039; using wxWidgets.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039; With the above receipe you get one single build. You should get into the habit of using separate directories for different builds, even for the &amp;quot;Visual Studio&amp;quot; generator (see below), as this avoids any possibility of clashes and separate build directories are much easier to handle.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Using Python&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
If you want to use the Python bindings, please note that the MSVC compiler triggers some special handling within the Python interfacing. To avoid problems, it is best to add the following option to the CMake command:&lt;br /&gt;
&lt;br /&gt;
   -DCMAKE_BUILD_TYPE=Release &lt;br /&gt;
 &lt;br /&gt;
The background for this is described in the [[Install_Python]] page.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Using wxWidgets&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
If you do use wxWidgets, here is a slightly adjusted receipe:&lt;br /&gt;
&lt;br /&gt;
(Depending upon how you built wxWidgets you may need to specify additional parameters to the cmake call. Check [[Configuration of wxWidgets driver]] for more details.)&lt;br /&gt;
&lt;br /&gt;
Start a DOS window like before. Now (note the added commands and command options):&lt;br /&gt;
&lt;br /&gt;
 d:&lt;br /&gt;
 mkdir build-plplot&lt;br /&gt;
 cd build-plplot&lt;br /&gt;
 set path=d:\build-plplot\dll;%path%&lt;br /&gt;
&lt;br /&gt;
 set WXWINDLL=%WXWIN%\lib\vc_lib&lt;br /&gt;
&lt;br /&gt;
 cmake d:\plplot -G &amp;quot;NMake Makefiles&amp;quot; -DwxWidgets_LIB_DIR=%WXWINDLL% &lt;br /&gt;
 nmake&lt;br /&gt;
 nmake install&lt;br /&gt;
&lt;br /&gt;
For those who are not familiar with NMake and CMake here is an explanation of what we have just done. Nmake is a command line compiler included with Microsoft VC++ which can be used to build from source. Instead of project files it uses make files. To avoid creating make files for multiple compilers plplot includes CMake files. These are interpreted by CMake, along with the variables specified on the command line, to generate make files for many different compilers. So, in order, we performed the following actions:&lt;br /&gt;
&lt;br /&gt;
 Set up needed paths including MSVC++ paths using vcvarsall&lt;br /&gt;
 Called CMake to generate make files for a specific build&lt;br /&gt;
 Called &amp;quot;Nmake&amp;quot; to build PLplot&lt;br /&gt;
 Called &amp;quot;Nmake install&amp;quot; to move the libraries and header files to the install folder&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Note&amp;#039;&amp;#039;: during the build the various DLLs are put in the subdirectory &amp;quot;dll&amp;quot; under the build directory. It is important that this directory is contained in the path during the build if you use the dynamic drivers facility as otherwise calls to get-drv-info will fail and the drivers won&amp;#039;t be installed successfully. In addition, if you use wxWidgets driver you also must ensure that the wxWidgets DLL itself is in the path as well.&lt;br /&gt;
 &lt;br /&gt;
Alternatively you can use the GUI version of CMake, an easy-to-use user-interface that presents the available build options&lt;br /&gt;
and lets you set them. It is mostly a matter of taste, but:&lt;br /&gt;
* The GUI version provides an overview of the build opions that are available&lt;br /&gt;
* The command-line version is particularly useful if you are experimenting with these options, as it can be run from a batchfile&lt;br /&gt;
&lt;br /&gt;
Some of the options that are available for CMake:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;-DCMAKE_VERBOSE_MAKEFILE=ON&amp;lt;/tt&amp;gt;: makefiles provide verbose informations&lt;br /&gt;
* &amp;lt;tt&amp;gt;-DBUILD_TEST=ON&amp;lt;/tt&amp;gt;: all examples will be built also (for test purposes)&lt;br /&gt;
* [[Configuration of wxWidgets driver]]&lt;br /&gt;
&lt;br /&gt;
If you used the &amp;lt;tt&amp;gt;-DBUILD_TEST=ON&amp;lt;/tt&amp;gt; option, you may need to copy some files in order to run the examples:&lt;br /&gt;
&lt;br /&gt;
 cd examples\c&lt;br /&gt;
 copy ..\..\..\data\*.fnt .&lt;br /&gt;
&lt;br /&gt;
and additionally some dlls for a shared plplot built:&lt;br /&gt;
&lt;br /&gt;
 copy ..\..\dll\plplotd.dll .&lt;br /&gt;
 copy ..\..\dll\plplotcxxd.dll . (for c++ examples)&lt;br /&gt;
 copy ..\..\dll\csirocsa.dll . (if library was built)&lt;br /&gt;
&lt;br /&gt;
and for the wxWidgets driver (if wxWidgets library is shared):&lt;br /&gt;
&lt;br /&gt;
 copy %WXWIN%\lib\gcc_dll\wxmsw26d_vc_custom.dll .&lt;br /&gt;
&lt;br /&gt;
if this dll is not in the path.&lt;/div&gt;</summary>
		<author><name>Philrosenberg</name></author>	</entry>

	<entry>
		<id>http://www.miscdebris.net/plplot_wiki/index.php?title=Configure_PLplot_for_Visual_CXX&amp;diff=3009</id>
		<title>Configure PLplot for Visual CXX</title>
		<link rel="alternate" type="text/html" href="http://www.miscdebris.net/plplot_wiki/index.php?title=Configure_PLplot_for_Visual_CXX&amp;diff=3009"/>
				<updated>2013-09-27T14:06:49Z</updated>
		
		<summary type="html">&lt;p&gt;Philrosenberg: moved Configure PLplot for Visual CXX to Configure PLplot for Visual CXX CLI: Differentiate IDE and CLI pages&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Configure PLplot for Visual CXX CLI]]&lt;/div&gt;</summary>
		<author><name>Philrosenberg</name></author>	</entry>

	<entry>
		<id>http://www.miscdebris.net/plplot_wiki/index.php?title=Configure_PLplot_for_Visual_CXX_CLI&amp;diff=3007</id>
		<title>Configure PLplot for Visual CXX CLI</title>
		<link rel="alternate" type="text/html" href="http://www.miscdebris.net/plplot_wiki/index.php?title=Configure_PLplot_for_Visual_CXX_CLI&amp;diff=3007"/>
				<updated>2013-09-27T14:06:14Z</updated>
		
		<summary type="html">&lt;p&gt;Philrosenberg: Changed comment about using IDE as this now fully works&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page describes how to build PLplot using Visual Studio from the command line. If you wish to use the Integrated Development Environment see [[Configure PLplot for the Visual Studio IDE]].&lt;br /&gt;
&lt;br /&gt;
You need a working Visual C++ and CMake installation. &lt;br /&gt;
&lt;br /&gt;
Start a DOS window (command window) - for instance via the Start menu item &amp;quot;Visual Studio Tools/Visual Studio 2008 command prompt&amp;quot;. CMake must be able to run the Visual C/C++ compiler. (You can also use the batch file vcvarsall.bat in the directory &amp;quot;&amp;lt;MSVC++ isntall directory&amp;gt;\VC&amp;quot; to take care of all settings).&lt;br /&gt;
&lt;br /&gt;
Create a new directory for building PLplot (say: d:\build-plplot) and change to that directory.&lt;br /&gt;
Add the directory &amp;quot;d:\build-plplot\dll&amp;quot; to the path.&lt;br /&gt;
&lt;br /&gt;
So the commands are:&lt;br /&gt;
&lt;br /&gt;
 d:&lt;br /&gt;
 mkdir build-plplot&lt;br /&gt;
 cd build-plplot&lt;br /&gt;
 set path=d:\build-plplot\dll;%path%&lt;br /&gt;
&lt;br /&gt;
Now run CMake (assuming CMake is already in the path and sources for PLplot are in &amp;quot;d:\plplot&amp;quot;: &lt;br /&gt;
&lt;br /&gt;
 cmake d:\plplot -G &amp;quot;NMake Makefiles&amp;quot; -DBUILD_TEST=ON&lt;br /&gt;
&lt;br /&gt;
(The latter option ensures that the examples are built. Many more options are available)&lt;br /&gt;
&lt;br /&gt;
Once CMake has generated all the makefiles, you can build the PLplot libraries and examples&lt;br /&gt;
via the nmake command:&lt;br /&gt;
&lt;br /&gt;
 nmake&lt;br /&gt;
&lt;br /&gt;
To install the libraries:&lt;br /&gt;
&lt;br /&gt;
 nmake install&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039; The above assumes you are &amp;#039;&amp;#039;not&amp;#039;&amp;#039; using wxWidgets.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039; With the above receipe you get one single build. You should get into the habit of using separate directories for different builds, even for the &amp;quot;Visual Studio&amp;quot; generator (see below), as this avoids any possibility of clashes and separate build directories are much easier to handle.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Using Python&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
If you want to use the Python bindings, please note that the MSVC compiler triggers some special handling within the Python interfacing. To avoid problems, it is best to add the following option to the CMake command:&lt;br /&gt;
&lt;br /&gt;
   -DCMAKE_BUILD_TYPE=Release &lt;br /&gt;
 &lt;br /&gt;
The background for this is described in the [[Install_Python]] page.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Using wxWidgets&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
If you do use wxWidgets, here is a slightly adjusted receipe:&lt;br /&gt;
&lt;br /&gt;
(Depending upon how you built wxWidgets you may need to specify additional parameters to the cmake call. Check [[Configuration of wxWidgets driver]] for more details.)&lt;br /&gt;
&lt;br /&gt;
Start a DOS window like before. Now (note the added commands and command options):&lt;br /&gt;
&lt;br /&gt;
 d:&lt;br /&gt;
 mkdir build-plplot&lt;br /&gt;
 cd build-plplot&lt;br /&gt;
 set path=d:\build-plplot\dll;%path%&lt;br /&gt;
&lt;br /&gt;
 set WXWINDLL=%WXWIN%\lib\vc_lib&lt;br /&gt;
&lt;br /&gt;
 cmake d:\plplot -G &amp;quot;NMake Makefiles&amp;quot; -DwxWidgets_LIB_DIR=%WXWINDLL% &lt;br /&gt;
 nmake&lt;br /&gt;
 nmake install&lt;br /&gt;
&lt;br /&gt;
For those who are not familiar with NMake and CMake here is an explanation of what we have just done. Nmake is a command line compiler included with Microsoft VC++ which can be used to build from source. Instead of project files it uses make files. To avoid creating make files for multiple compilers plplot includes CMake files. These are interpreted by CMake, along with the variables specified on the command line, to generate make files for many different compilers. So, in order, we performed the following actions:&lt;br /&gt;
&lt;br /&gt;
 Set up needed paths including MSVC++ paths using vcvarsall&lt;br /&gt;
 Called CMake to generate make files for a specific build&lt;br /&gt;
 Called &amp;quot;Nmake&amp;quot; to build PLplot&lt;br /&gt;
 Called &amp;quot;Nmake install&amp;quot; to move the libraries and header files to the install folder&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Note&amp;#039;&amp;#039;: during the build the various DLLs are put in the subdirectory &amp;quot;dll&amp;quot; under the build directory. It is important that this directory is contained in the path during the build if you use the dynamic drivers facility as otherwise calls to get-drv-info will fail and the drivers won&amp;#039;t be installed successfully. In addition, if you use wxWidgets driver you also must ensure that the wxWidgets DLL itself is in the path as well.&lt;br /&gt;
 &lt;br /&gt;
Alternatively you can use the GUI version of CMake, an easy-to-use user-interface that presents the available build options&lt;br /&gt;
and lets you set them. It is mostly a matter of taste, but:&lt;br /&gt;
* The GUI version provides an overview of the build opions that are available&lt;br /&gt;
* The command-line version is particularly useful if you are experimenting with these options, as it can be run from a batchfile&lt;br /&gt;
&lt;br /&gt;
Some of the options that are available for CMake:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;-DCMAKE_VERBOSE_MAKEFILE=ON&amp;lt;/tt&amp;gt;: makefiles provide verbose informations&lt;br /&gt;
* &amp;lt;tt&amp;gt;-DBUILD_TEST=ON&amp;lt;/tt&amp;gt;: all examples will be built also (for test purposes)&lt;br /&gt;
* [[Configuration of wxWidgets driver]]&lt;br /&gt;
&lt;br /&gt;
If you used the &amp;lt;tt&amp;gt;-DBUILD_TEST=ON&amp;lt;/tt&amp;gt; option, you may need to copy some files in order to run the examples:&lt;br /&gt;
&lt;br /&gt;
 cd examples\c&lt;br /&gt;
 copy ..\..\..\data\*.fnt .&lt;br /&gt;
&lt;br /&gt;
and additionally some dlls for a shared plplot built:&lt;br /&gt;
&lt;br /&gt;
 copy ..\..\dll\plplotd.dll .&lt;br /&gt;
 copy ..\..\dll\plplotcxxd.dll . (for c++ examples)&lt;br /&gt;
 copy ..\..\dll\csirocsa.dll . (if library was built)&lt;br /&gt;
&lt;br /&gt;
and for the wxWidgets driver (if wxWidgets library is shared):&lt;br /&gt;
&lt;br /&gt;
 copy %WXWIN%\lib\gcc_dll\wxmsw26d_vc_custom.dll .&lt;br /&gt;
&lt;br /&gt;
if this dll is not in the path.&lt;/div&gt;</summary>
		<author><name>Philrosenberg</name></author>	</entry>

	<entry>
		<id>http://www.miscdebris.net/plplot_wiki/index.php?title=Configure_PLplot_for_the_Visual_Studio_IDE&amp;diff=3005</id>
		<title>Configure PLplot for the Visual Studio IDE</title>
		<link rel="alternate" type="text/html" href="http://www.miscdebris.net/plplot_wiki/index.php?title=Configure_PLplot_for_the_Visual_Studio_IDE&amp;diff=3005"/>
				<updated>2013-09-27T14:01:27Z</updated>
		
		<summary type="html">&lt;p&gt;Philrosenberg: moved Using the Visual Studio generator to Configure PLplot for the Visual Studio IDE: Consistency with other Configure PLplot for... pages&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;CMake allows you to generate Visual Studio solution and project files. &lt;br /&gt;
&lt;br /&gt;
As of version 2.8.2 of CMake, here are a few caveats:&lt;br /&gt;
&lt;br /&gt;
* If you use Intel Fortran, the solution/project files may cause errors when building. These affect only the Fortran libraries and examples. It is due to a small bug in CMake that should be fixed with the next release.&lt;br /&gt;
* For some reason you can not run the examples directly. We have not found out yet what is the matter, but there is a workaround - see below.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Workaround for examples built with Visual Studio&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
* Build the PLplot libraries and examples via the ALL_BUILD project&lt;br /&gt;
* Open a DOS box in the Debug directory for any one of these examples&lt;br /&gt;
* Set the following environment variables:&lt;br /&gt;
&lt;br /&gt;
   set path=&amp;lt;build&amp;gt;\dll\Debug;%PATH% &lt;br /&gt;
   set PLPLOT_DRV_DIR=&amp;lt;build&amp;gt;\drivers    &lt;br /&gt;
   set PLPLOT_LIB=&amp;lt;source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   where: &amp;lt;build&amp;gt; is the directory where PLplot was built&lt;br /&gt;
   and the directory &amp;quot;&amp;lt;source&amp;gt;\data&amp;quot; holds the .pal and .fnt files&lt;br /&gt;
* In this environment you can run the sample program&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Walkthrough building PLPLot with Visual Studio ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Why can’t I just include all the code files in a project and press the build button?&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
PLplot makes every effort to be compatible with multiple different compilers on multiple OSs. It also uses third party libraries for backends/drivers. If every compiler exactly conformed to the (same) C++ and C standards and included nothing else and if every other library did the same then this would be easy. But they don’t and it isn’t. Some libraries only work on Linux or Windows and different compilers add extra features and although often the same additional features exist in different compilers they sometimes have different names or are in different header files. This all can make writing a cross platform library quite tricky.&lt;br /&gt;
&lt;br /&gt;
PLplot addresses this by using a build system called CMake. This is an extra layer of code between the C/C++ code and the compiler. The CMake code is run before you try to compile the library and it attempts to detect the various platform specific differences and create (in the case of Visual Studio) .sln and .proj files and a config.h file that fits your configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;A Walkthrough&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
I have spent some time trying to get CMake to work with my setup and the PLplot developers have helped with bug fixes to get this right so PLplot should now be straightforward to compile on windows. Fundamentally I want to end up with a visual studio sln file which I can use to build PLplot. It should ensure I have access to the libraries and backends/drivers that I want to use which include shapelib, wxWidgets, AGG and FreeType. Ideally it should include the examples and allow me to specify all the project properties I need so that if I update my code to the latest trunk version (which I do quite often) I don’t have to manually change lots of settings. Unfortunately there is a bit of a Linux bias to Cmake so here are some things that may catch you out, here are a few of those:&lt;br /&gt;
*When specifying paths to CMAKE, capitalisation matters.&lt;br /&gt;
*When CMAKE looks for additional libraries it sometimes only looks in the default Linux path so you might have to specify library locations&lt;br /&gt;
*All the defaults are to build dynamically linked dynamic libraries with dynamic runtime linkage – if you want anything else then you must specify so.&lt;br /&gt;
*If you need to recreate your sln files then it’s best to delete everything in your build directory and start again from scratch.&lt;br /&gt;
Anyhow here is a walkthrough of how I got everything working.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Backends/Drivers&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
PLplot could include code to write your plots to screen, memory, and the myriad of different file formats that you may want to use. However, if this was the case the developers would spend all their time looking at details of jpeg file formats or the different operating system device contexts. Instead PLplot has built in support for a few output devices and then uses other libraries referred to as drivers to output to most file types. In the walkthrough I’ll show you how to compile with just the built in outputs first, then I’ll add in shapefile support for maps using shapelib, and the wxWidgets driver with options for rendering with, AGG and Freetype.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Compiling a Basic PLplot Library&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
To build PLplot you will need some extra tools first. Download and install CMAKE from http://www.cmake.org/. Next if you want to use the very latest version of PLplot with the most up to date bug fixes you will need to access the Subversion repository to get the latest trunk version. To do this download tortoiseSVN from http://tortoisesvn.net/, then create a folder where you want to store the PLPlot source code (mine is D:\SourceCode\Libraries\plplot_trunk). Right click the folder and go to TortoiseSVN, Checkout. Enter the URL from http://plplot.sourceforge.net/download.php and click OK. If you ever need to update then right click the folder and click SVN Update. If you want the latest release version then you can download it from the same download link and just unzip it to a location of your choosing. If you have any doubt about whether you want the trunk version or the release version then my recommendation would be the trunk version. At the very least get the latest development release rather than the stable release as there have been a lot of updates and bug fixes since version 5.8.&lt;br /&gt;
&lt;br /&gt;
Now we can start the build process. open a cmd window and run the following batch file&lt;br /&gt;
&lt;br /&gt;
   C:\Program files\Microsoft Visual Studio 9.0\Common7\Tools\vsvars32.bat&lt;br /&gt;
&lt;br /&gt;
If you installed Visual Studio elsewhere then change the path accordingly and note that on 64 bit machines the default path is in Program Files(x86). This will define environment variables that CMAKE will use so keep this cmd prompt open and do all the following commands in it.&lt;br /&gt;
&lt;br /&gt;
Rather than compile PLplot ‘in place’ we’ll be building it in a separate directory, in fact we need two directories, one for release and one for debug. So create a these build directories. Mine are at D:\Sourcecode\Libraries\plplot_staticbuild_release, with another in the same location but ending debug. I think it is possible to create a release and debug version together in one .sln but i think there are potential clashes so I highly recommend creating a separate release and debug version in separate folders. In your cmd prompt navigate to the release directory.&lt;br /&gt;
&lt;br /&gt;
If you wish to add any extra compiler flags do so by setting the environment variables CXXFLAGS and CFLAGS in your cmd prompt. I use this facility to set the Unicode options&lt;br /&gt;
&lt;br /&gt;
   set CXXFLAGS=/DUNICODE /D_UNICODE&lt;br /&gt;
   set CFLAGS=/DUNICODE /D_UNICODE&lt;br /&gt;
&lt;br /&gt;
Note that you almost always want CXXFLAGS and CFLAGS to be identical.&lt;br /&gt;
&lt;br /&gt;
If you already have wxWidgets installed then you may wish to stop PLplot finding it for this basic build. To do so type &lt;br /&gt;
&lt;br /&gt;
   %WXWIN%&lt;br /&gt;
&lt;br /&gt;
and make a note of the path for later. Then enter&lt;br /&gt;
&lt;br /&gt;
   set WXWIN=&lt;br /&gt;
&lt;br /&gt;
Now call CMAKE as follows:&lt;br /&gt;
&lt;br /&gt;
   cmake &amp;quot;D:/SourceCode/Libraries/plplot trunk&amp;quot; -G &amp;quot;Visual Studio 9 2008&amp;quot; -DPL_DOUBLE=ON -DLIB_TAG=&amp;quot;sud&amp;quot; -DBUILD_TEST=ON -DCMAKE_INSTALL_PREFIX=&amp;quot;D:\SourceCode\Libraries\plplotinstall&amp;quot;  -DCMAKE_CONFIGURATION_TYPES=&amp;quot;Debug&amp;quot; -DBUILD_SHARED_LIBS=OFF -DSTATIC_RUNTIME=ON&lt;br /&gt;
&lt;br /&gt;
A full description of the parameters can be found in the reference below. You can obviously change them to suit your needs. Hopefully after a minute or two the screen output should end with &lt;br /&gt;
&lt;br /&gt;
   --Configuring done&lt;br /&gt;
   --Generating done&lt;br /&gt;
   --Build files have been written to D:/SourceCode/Libraries/plplot_staticbuild_release&lt;br /&gt;
&lt;br /&gt;
If you now go to your build directory you should see a solution which you can open in Visual Studio. Just open it up, right click the INSTALL project and select build, this will build your library and put it in the install directory. I use the LIB_TAG parameter to identify this as a static (s), Unicode (u) debug (d) library. Unfortunately some of the built libraries do not get your LIB_TAG added. So go to your install directory and do this manually, this stops them getting overwritten when you build the release version. You should now be able to find the examples in the build directory and try them out. You get a choice of which built in driver you want to use. There is a memory one, a Windows one that outputs to screen and ones that output to ps, svg and xfig files. Once you have a debug version, you can repeat the process in a new directory to create a debug version, make sure you change the LIB_TAG or install directory to avoid overwriting. Well done you now have PLplot up and running.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Other Libraries and Backends&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
PLplot relies on a number of drivers and backends to extend its output capabilities and allow reading of certain data files. I use a few of these and will guide you through adding them. Don’t be tempted to download precompiled .lib and .dll files. If you do then they may not have been compiled with the same setting that you use and may generate hard to fix linker errors. Problem setting can include character set (Unicode, vs multibyte vs not set) and static/dynamic linking to the runtime libraries (multithreaded, multithreaded dll, multithreaded debug, multithreaded debug dll). If you don’t know what static and dynamic linking are then find out because it will be the bane of your programming life if you don’t. I tend to add u to the end of a library name to indicate Unicode and s to indicate static (not dynamic) linkage to the runtime library and d to indicate debug.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Shapelib&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Shapelib allows you to read in .shp shapefileswhich contain vector map information into PLplot . PLPlot already has a coarse resolution global map included, but if you would like higher resolution then you need to add Shapelib. Global files with 10, 50 or 110 mile resolution are available from http://www.naturalearthdata.com and you can find other files online as you need. Shapelib itself is easy to compile, download it from http://shapelib.maptools.org/ create a new windows library project, add all the files and build debug and release versions as needed. There is no need to specify Unicode. To use it in PLplot add the following commands to your CMake call&lt;br /&gt;
&lt;br /&gt;
   -DHAVE_SHAPELIB=ON -DSHAPELIB_INCLUDE_DIR=&amp;quot;D:/SourceCode/Libraries/shapelib-1.3.0/include/shapelib&amp;quot; -DSHAPELIB_LIBRARY=&amp;quot;D:/SourceCode/Libraries/shapelib-1.3.0/lib/shapelibsd.lib&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Of course replace the values with ones appropriate for your system and make sure you use the debug or release library appropriately. Now in calls to plmap you can replace the map name with the path to a shapefile and the lines from this file will be used to draw the map.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;wxWidgets&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
I use wxWidgets for GUI output, it also allows output to various other graphics types like png, bmp, jpg, ps. If you wish to do the same then the best way is to install wxPack which is a fully working version of wxWidgets for Windows. It comes with a Visual Studio .sln file so saves you a lot of hassle. There are loads of instructions for compiling wxWidgets online, so I won’t repeat it all here. However you may wish to enable wxGraphicsContext (which gives anti-aliased output) and wxPostscriptDC to output to ps files. To do this, go through all the various setup.h and setup0.h and set &lt;br /&gt;
&lt;br /&gt;
   #define wxUSE_GRAPHICS_CONTEXT 1&lt;br /&gt;
   #define wxUSE_POSTSCRIPT 1&lt;br /&gt;
&lt;br /&gt;
Open the wxWidgets .sln file and if you wish to change between static and dynamic Runtime then change this in the project properties. Finally go to build, batch build and build all the versions of the library. This can take some time.&lt;br /&gt;
&lt;br /&gt;
For Visual Studio 2012 Users – I have found a few problems with building wxWidgets in VS2012 so I thought I’d add them here. &lt;br /&gt;
*First the Batch Build option is hidden. You can display it by going to Tools, customize, Commands and select the build menu.&lt;br /&gt;
*If you get a lot of build errors talking about CL.exe then this is caused by clashes between intermediate files of different projects. To fix it select all the projects in the solution explorer then right click them and select properties. Change the configuration to All Configurations then go to Configuration properties, General and change Intermediate Directory to $(ProjectName)\$(Platform)\$(Configuration)\.&lt;br /&gt;
*If you get a compilation error saying that the file pbt.h cannot be found in windows.cpp then go to the relevant line and comment it out. This header is no longer needed in wxWidgets and no longer included with Visual Studio but the #include got forgotten and left in the source.&lt;br /&gt;
*Finally if you want to build a 64 bit version do not try changing the Build Target in the project properties, this causes various linker errors. Instead go to Build, Configuration Manager... and in the active solution platform select &amp;lt;new&amp;gt; then select x64. This will create 64 bit configurations for all projects. Unfortunately you cannot build 64 bit and 32 bit libraries at the same time and if you have built a 32 bit library and want to build the 64 bit version (or vice versa) then you must clean the project first. See the install-msw-2.8.12.txt file shipped with wxWidgets for more info.&lt;br /&gt;
&lt;br /&gt;
Once you have wxWidgets built PLplot will automatically look for the WXWIN environmental variable which is created by wxPack, or should have been created by you if you set up wxWidgets manually. If you disabled wxWidgets above, then enter the following at the command prompt&lt;br /&gt;
&lt;br /&gt;
   set WXWIN=path/you/wrote/down/earlier&lt;br /&gt;
&lt;br /&gt;
If PLplot finds this environmental variable then it will include wxWidgets in the build. However, it seems that CMAKE doesn’t automatically determine if you are building with Unicode, so if you are then you must specify which wxWidgets build to use by adding the following parameter to your CMake command&lt;br /&gt;
&lt;br /&gt;
   DwxWidgets_CONFIGURATION=mswud&lt;br /&gt;
&lt;br /&gt;
Or for the release version use mswu, just like the suffix at the end of the wxWidgets library files.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;AGG and FreeType&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The wxWidgets driver can use three backends. The wxDC and wxGraphicsContect are part of wxWidgets and use Windows drawing routines. This means if you port your software to Linux the code will then use Linux drawing routines which may be slightly different. This might not be a big deal, but in case it is you can also make use of the cross platform AGG library to render anti-aliased graphics and AGG can either use PLplot’s basic text or the FreeType library for Unicode fonts. If you wish to use them then download the code for these projects. Both are quite straightforward. AGG seem to pride themselves on only using ‘pure’ C so for AGG you can just download the source from http://www.antigrain.com/ and add all the files to a visual studio project and build it. &lt;br /&gt;
If you are using FreeType then you can download the source form http://www.freetype.org/. The download includes a .sln file to build with Visual Studio.&lt;br /&gt;
&lt;br /&gt;
If using both FreeType and AGG then you should copy the files from your_agg_directory\font_freetype to your_agg_directory\include\agg2. You may wish to do the same with those in font_win32_tt, but it’s not needed for PLplot at present.&lt;br /&gt;
&lt;br /&gt;
Also don’t forget to ensure your character set and run time library linkage are set as you want them. To include AGG when you compile PLplot add the following parameters&lt;br /&gt;
&lt;br /&gt;
   DHAVE_AGG=ON -DAGG_INCLUDE_DIR=&amp;quot;D:/SourceCode/Libraries/agg-2.4/include&amp;quot; -DAGG_LIBRARIES=&amp;quot;D:/SourceCode/Libraries/agg-2.4/VC++/AGG/lib/AGGsud.lib&amp;quot;&lt;br /&gt;
&lt;br /&gt;
For FreeType use&lt;br /&gt;
&lt;br /&gt;
   -DWITH_FREETYPE=ON -DFREETYPE_INCLUDE_DIR=&amp;quot;D:/SourceCode/Libraries/freetype-2.4.8/include&amp;quot; -DFREETYPE_LIBRARY=&amp;quot;D:/SourceCode/Libraries/freetype-2.4.8/objs/win32/vc2008/freetypesud.lib&amp;quot;&lt;br /&gt;
But of course change the paths to match your system.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Summary and reference&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
So just so you see the whole thing, my final CMake command for a debug build is&lt;br /&gt;
&lt;br /&gt;
 cmake &amp;quot;D:/SourceCode/Libraries/plplot_trunk&amp;quot; -G &amp;quot;Visual Studio 9 2008&amp;quot; -DPL_DOUBLE=ON -DLIB_TAG=&amp;quot;su&amp;quot; -DBUILD_TEST=ON -DCMAKE_INSTALL_PREFIX=&amp;quot;D:\SourceCode\Libraries\plplotinstall&amp;quot; -DBUILD_SHARED_LIBS=OFF -DCMAKE_CONFIGURATION_TYPES=&amp;quot;Debug&amp;quot; -DSTATIC_RUNTIME=ON -DwxWidgets_CONFIGURATION=mswud -DHAVE_SHAPELIB=ON -DSHAPELIB_INCLUDE_DIR=&amp;quot;D:/SourceCode/Libraries/shapelib-1.3.0/include/shapelib&amp;quot; -DSHAPELIB_LIBRARY=&amp;quot;D:/SourceCode/Libraries/shapelib-1.3.0/lib/shapelibsd.lib&amp;quot;  -DHAVE_AGG=ON -DAGG_INCLUDE_DIR=&amp;quot;D:/SourceCode/Libraries/agg-2.4/include&amp;quot; -DAGG_LIBRARIES=&amp;quot;D:/SourceCode/Libraries/agg-2.4/VC++/AGG/lib/AGGsud.lib&amp;quot; -DWITH_FREETYPE=ON -DFREETYPE_INCLUDE_DIR=&amp;quot;D:/SourceCode/Libraries/freetype-2.4.8/include&amp;quot; -DFREETYPE_LIBRARY=&amp;quot;D:/SourceCode/Libraries/freetype-2.4.8/objs/win32/vc2008/freetypesud.lib&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
For reference here is a quick rundown of each of the parameters&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;“D:/SourceCode/Libraries/plplot trunk”:&amp;#039;&amp;#039;&amp;#039; the path to my source directory – case sensitive.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;-G “Visual Studio 9 2008”:&amp;#039;&amp;#039;&amp;#039; the compiler I want to generate a project/solution for.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;-DPL_DOUBLE=ON:&amp;#039;&amp;#039;&amp;#039; use doubles, rather than floats in PLplot. Also adds d to the library names.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;-DLIB_TAG=”su”:&amp;#039;&amp;#039;&amp;#039; this will append “su” to the end of the library name and is an indicator to me that I’m using static linkage with the Unicode character set. I use sud for static Unicode debug etc.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;-DBUILD_TEST=ON:&amp;#039;&amp;#039;&amp;#039; Indicates I want to create projects for the examples. Set to OFF to not build them.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;-DCMAKE_INSTALL_PREFIX=”D:\SourceCode\Libraries\plplotinstall”&amp;#039;&amp;#039;&amp;#039; The directory you want your final libraries to end up in, it will be created if it doesn’t exist. If you leave this blank it defaults to C:\Program Files\PLplot, however in Windows Vista or later UAC will stop the file being written here unless you run Visual Studio as administrator.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;-DCMAKE_CONFIGURATION_TYPES=”Release”:&amp;#039;&amp;#039;&amp;#039; The configuration to use in the project. You can run create multiple configurations in one solution by listing them separated by semicolons, but if using Shapelib, FreeType or AGG this causes linking problems with the examples as you can’t specify linkage against the release and debug versions separated by semicolons. It also causes issues with installing to one directory so it’s best to create on sln for each configuration. You can include Release, Debug, MinSizeRel and RelWithDebInfo. &lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;-DSTATIC_RUNTIME=ON:&amp;#039;&amp;#039;&amp;#039; This causes us to link against the static runtime (equivalent to /MT or /MTd flags). Set it to OFF if you want to link against the dynamic runtime (equivalent to /MD or /MDd). &lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;-DBUILD_SHARED_LIBS=OFF&amp;#039;&amp;#039;&amp;#039; Build a .lib rather than a .dll. If you don’t set this the default will be to build dlls.All the options above except the source directory and compiler are optional and will be set to default values if excluded. &lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Anything with AGG in:&amp;#039;&amp;#039;&amp;#039; These point out that I want to use AGG and specifies the location of header files and the library itself. The library is only needed if –DBUILD_TEST is ON. None are needed if you are not using AGG.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Anything with FREETYPE in:&amp;#039;&amp;#039;&amp;#039; As with the AGG stuff it indicates I want to use FreeType and gives the location of the headers and library. Note that the variables have slightly different names to the AGG ones. Again the library is only needed when building the examples.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Anything with SHAPELIB in:&amp;#039;&amp;#039;&amp;#039; As for the FREETYPE and AGG parameters, but for shapelib.&lt;br /&gt;
&lt;br /&gt;
There are also other customisable options and after you’ve run CMAKE you can examine the CMakeCache.txt file that is created in your build directory to see others (prepend -D to define them on the command line) or look at the wiki page or CMAKE documentation.&lt;/div&gt;</summary>
		<author><name>Philrosenberg</name></author>	</entry>

	<entry>
		<id>http://www.miscdebris.net/plplot_wiki/index.php?title=Using_the_Visual_Studio_generator&amp;diff=3006</id>
		<title>Using the Visual Studio generator</title>
		<link rel="alternate" type="text/html" href="http://www.miscdebris.net/plplot_wiki/index.php?title=Using_the_Visual_Studio_generator&amp;diff=3006"/>
				<updated>2013-09-27T14:01:27Z</updated>
		
		<summary type="html">&lt;p&gt;Philrosenberg: moved Using the Visual Studio generator to Configure PLplot for the Visual Studio IDE: Consistency with other Configure PLplot for... pages&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Configure PLplot for the Visual Studio IDE]]&lt;/div&gt;</summary>
		<author><name>Philrosenberg</name></author>	</entry>

	<entry>
		<id>http://www.miscdebris.net/plplot_wiki/index.php?title=Configure_PLplot_for_the_Visual_Studio_IDE&amp;diff=3004</id>
		<title>Configure PLplot for the Visual Studio IDE</title>
		<link rel="alternate" type="text/html" href="http://www.miscdebris.net/plplot_wiki/index.php?title=Configure_PLplot_for_the_Visual_Studio_IDE&amp;diff=3004"/>
				<updated>2013-09-27T13:51:41Z</updated>
		
		<summary type="html">&lt;p&gt;Philrosenberg: Corrected some headings, boldened options and deleted old text&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;CMake allows you to generate Visual Studio solution and project files. &lt;br /&gt;
&lt;br /&gt;
As of version 2.8.2 of CMake, here are a few caveats:&lt;br /&gt;
&lt;br /&gt;
* If you use Intel Fortran, the solution/project files may cause errors when building. These affect only the Fortran libraries and examples. It is due to a small bug in CMake that should be fixed with the next release.&lt;br /&gt;
* For some reason you can not run the examples directly. We have not found out yet what is the matter, but there is a workaround - see below.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Workaround for examples built with Visual Studio&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
* Build the PLplot libraries and examples via the ALL_BUILD project&lt;br /&gt;
* Open a DOS box in the Debug directory for any one of these examples&lt;br /&gt;
* Set the following environment variables:&lt;br /&gt;
&lt;br /&gt;
   set path=&amp;lt;build&amp;gt;\dll\Debug;%PATH% &lt;br /&gt;
   set PLPLOT_DRV_DIR=&amp;lt;build&amp;gt;\drivers    &lt;br /&gt;
   set PLPLOT_LIB=&amp;lt;source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   where: &amp;lt;build&amp;gt; is the directory where PLplot was built&lt;br /&gt;
   and the directory &amp;quot;&amp;lt;source&amp;gt;\data&amp;quot; holds the .pal and .fnt files&lt;br /&gt;
* In this environment you can run the sample program&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Walkthrough building PLPLot with Visual Studio ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Why can’t I just include all the code files in a project and press the build button?&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
PLplot makes every effort to be compatible with multiple different compilers on multiple OSs. It also uses third party libraries for backends/drivers. If every compiler exactly conformed to the (same) C++ and C standards and included nothing else and if every other library did the same then this would be easy. But they don’t and it isn’t. Some libraries only work on Linux or Windows and different compilers add extra features and although often the same additional features exist in different compilers they sometimes have different names or are in different header files. This all can make writing a cross platform library quite tricky.&lt;br /&gt;
&lt;br /&gt;
PLplot addresses this by using a build system called CMake. This is an extra layer of code between the C/C++ code and the compiler. The CMake code is run before you try to compile the library and it attempts to detect the various platform specific differences and create (in the case of Visual Studio) .sln and .proj files and a config.h file that fits your configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;A Walkthrough&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
I have spent some time trying to get CMake to work with my setup and the PLplot developers have helped with bug fixes to get this right so PLplot should now be straightforward to compile on windows. Fundamentally I want to end up with a visual studio sln file which I can use to build PLplot. It should ensure I have access to the libraries and backends/drivers that I want to use which include shapelib, wxWidgets, AGG and FreeType. Ideally it should include the examples and allow me to specify all the project properties I need so that if I update my code to the latest trunk version (which I do quite often) I don’t have to manually change lots of settings. Unfortunately there is a bit of a Linux bias to Cmake so here are some things that may catch you out, here are a few of those:&lt;br /&gt;
*When specifying paths to CMAKE, capitalisation matters.&lt;br /&gt;
*When CMAKE looks for additional libraries it sometimes only looks in the default Linux path so you might have to specify library locations&lt;br /&gt;
*All the defaults are to build dynamically linked dynamic libraries with dynamic runtime linkage – if you want anything else then you must specify so.&lt;br /&gt;
*If you need to recreate your sln files then it’s best to delete everything in your build directory and start again from scratch.&lt;br /&gt;
Anyhow here is a walkthrough of how I got everything working.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Backends/Drivers&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
PLplot could include code to write your plots to screen, memory, and the myriad of different file formats that you may want to use. However, if this was the case the developers would spend all their time looking at details of jpeg file formats or the different operating system device contexts. Instead PLplot has built in support for a few output devices and then uses other libraries referred to as drivers to output to most file types. In the walkthrough I’ll show you how to compile with just the built in outputs first, then I’ll add in shapefile support for maps using shapelib, and the wxWidgets driver with options for rendering with, AGG and Freetype.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Compiling a Basic PLplot Library&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
To build PLplot you will need some extra tools first. Download and install CMAKE from http://www.cmake.org/. Next if you want to use the very latest version of PLplot with the most up to date bug fixes you will need to access the Subversion repository to get the latest trunk version. To do this download tortoiseSVN from http://tortoisesvn.net/, then create a folder where you want to store the PLPlot source code (mine is D:\SourceCode\Libraries\plplot_trunk). Right click the folder and go to TortoiseSVN, Checkout. Enter the URL from http://plplot.sourceforge.net/download.php and click OK. If you ever need to update then right click the folder and click SVN Update. If you want the latest release version then you can download it from the same download link and just unzip it to a location of your choosing. If you have any doubt about whether you want the trunk version or the release version then my recommendation would be the trunk version. At the very least get the latest development release rather than the stable release as there have been a lot of updates and bug fixes since version 5.8.&lt;br /&gt;
&lt;br /&gt;
Now we can start the build process. open a cmd window and run the following batch file&lt;br /&gt;
&lt;br /&gt;
   C:\Program files\Microsoft Visual Studio 9.0\Common7\Tools\vsvars32.bat&lt;br /&gt;
&lt;br /&gt;
If you installed Visual Studio elsewhere then change the path accordingly and note that on 64 bit machines the default path is in Program Files(x86). This will define environment variables that CMAKE will use so keep this cmd prompt open and do all the following commands in it.&lt;br /&gt;
&lt;br /&gt;
Rather than compile PLplot ‘in place’ we’ll be building it in a separate directory, in fact we need two directories, one for release and one for debug. So create a these build directories. Mine are at D:\Sourcecode\Libraries\plplot_staticbuild_release, with another in the same location but ending debug. I think it is possible to create a release and debug version together in one .sln but i think there are potential clashes so I highly recommend creating a separate release and debug version in separate folders. In your cmd prompt navigate to the release directory.&lt;br /&gt;
&lt;br /&gt;
If you wish to add any extra compiler flags do so by setting the environment variables CXXFLAGS and CFLAGS in your cmd prompt. I use this facility to set the Unicode options&lt;br /&gt;
&lt;br /&gt;
   set CXXFLAGS=/DUNICODE /D_UNICODE&lt;br /&gt;
   set CFLAGS=/DUNICODE /D_UNICODE&lt;br /&gt;
&lt;br /&gt;
Note that you almost always want CXXFLAGS and CFLAGS to be identical.&lt;br /&gt;
&lt;br /&gt;
If you already have wxWidgets installed then you may wish to stop PLplot finding it for this basic build. To do so type &lt;br /&gt;
&lt;br /&gt;
   %WXWIN%&lt;br /&gt;
&lt;br /&gt;
and make a note of the path for later. Then enter&lt;br /&gt;
&lt;br /&gt;
   set WXWIN=&lt;br /&gt;
&lt;br /&gt;
Now call CMAKE as follows:&lt;br /&gt;
&lt;br /&gt;
   cmake &amp;quot;D:/SourceCode/Libraries/plplot trunk&amp;quot; -G &amp;quot;Visual Studio 9 2008&amp;quot; -DPL_DOUBLE=ON -DLIB_TAG=&amp;quot;sud&amp;quot; -DBUILD_TEST=ON -DCMAKE_INSTALL_PREFIX=&amp;quot;D:\SourceCode\Libraries\plplotinstall&amp;quot;  -DCMAKE_CONFIGURATION_TYPES=&amp;quot;Debug&amp;quot; -DBUILD_SHARED_LIBS=OFF -DSTATIC_RUNTIME=ON&lt;br /&gt;
&lt;br /&gt;
A full description of the parameters can be found in the reference below. You can obviously change them to suit your needs. Hopefully after a minute or two the screen output should end with &lt;br /&gt;
&lt;br /&gt;
   --Configuring done&lt;br /&gt;
   --Generating done&lt;br /&gt;
   --Build files have been written to D:/SourceCode/Libraries/plplot_staticbuild_release&lt;br /&gt;
&lt;br /&gt;
If you now go to your build directory you should see a solution which you can open in Visual Studio. Just open it up, right click the INSTALL project and select build, this will build your library and put it in the install directory. I use the LIB_TAG parameter to identify this as a static (s), Unicode (u) debug (d) library. Unfortunately some of the built libraries do not get your LIB_TAG added. So go to your install directory and do this manually, this stops them getting overwritten when you build the release version. You should now be able to find the examples in the build directory and try them out. You get a choice of which built in driver you want to use. There is a memory one, a Windows one that outputs to screen and ones that output to ps, svg and xfig files. Once you have a debug version, you can repeat the process in a new directory to create a debug version, make sure you change the LIB_TAG or install directory to avoid overwriting. Well done you now have PLplot up and running.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Other Libraries and Backends&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
PLplot relies on a number of drivers and backends to extend its output capabilities and allow reading of certain data files. I use a few of these and will guide you through adding them. Don’t be tempted to download precompiled .lib and .dll files. If you do then they may not have been compiled with the same setting that you use and may generate hard to fix linker errors. Problem setting can include character set (Unicode, vs multibyte vs not set) and static/dynamic linking to the runtime libraries (multithreaded, multithreaded dll, multithreaded debug, multithreaded debug dll). If you don’t know what static and dynamic linking are then find out because it will be the bane of your programming life if you don’t. I tend to add u to the end of a library name to indicate Unicode and s to indicate static (not dynamic) linkage to the runtime library and d to indicate debug.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Shapelib&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Shapelib allows you to read in .shp shapefileswhich contain vector map information into PLplot . PLPlot already has a coarse resolution global map included, but if you would like higher resolution then you need to add Shapelib. Global files with 10, 50 or 110 mile resolution are available from http://www.naturalearthdata.com and you can find other files online as you need. Shapelib itself is easy to compile, download it from http://shapelib.maptools.org/ create a new windows library project, add all the files and build debug and release versions as needed. There is no need to specify Unicode. To use it in PLplot add the following commands to your CMake call&lt;br /&gt;
&lt;br /&gt;
   -DHAVE_SHAPELIB=ON -DSHAPELIB_INCLUDE_DIR=&amp;quot;D:/SourceCode/Libraries/shapelib-1.3.0/include/shapelib&amp;quot; -DSHAPELIB_LIBRARY=&amp;quot;D:/SourceCode/Libraries/shapelib-1.3.0/lib/shapelibsd.lib&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Of course replace the values with ones appropriate for your system and make sure you use the debug or release library appropriately. Now in calls to plmap you can replace the map name with the path to a shapefile and the lines from this file will be used to draw the map.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;wxWidgets&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
I use wxWidgets for GUI output, it also allows output to various other graphics types like png, bmp, jpg, ps. If you wish to do the same then the best way is to install wxPack which is a fully working version of wxWidgets for Windows. It comes with a Visual Studio .sln file so saves you a lot of hassle. There are loads of instructions for compiling wxWidgets online, so I won’t repeat it all here. However you may wish to enable wxGraphicsContext (which gives anti-aliased output) and wxPostscriptDC to output to ps files. To do this, go through all the various setup.h and setup0.h and set &lt;br /&gt;
&lt;br /&gt;
   #define wxUSE_GRAPHICS_CONTEXT 1&lt;br /&gt;
   #define wxUSE_POSTSCRIPT 1&lt;br /&gt;
&lt;br /&gt;
Open the wxWidgets .sln file and if you wish to change between static and dynamic Runtime then change this in the project properties. Finally go to build, batch build and build all the versions of the library. This can take some time.&lt;br /&gt;
&lt;br /&gt;
For Visual Studio 2012 Users – I have found a few problems with building wxWidgets in VS2012 so I thought I’d add them here. &lt;br /&gt;
*First the Batch Build option is hidden. You can display it by going to Tools, customize, Commands and select the build menu.&lt;br /&gt;
*If you get a lot of build errors talking about CL.exe then this is caused by clashes between intermediate files of different projects. To fix it select all the projects in the solution explorer then right click them and select properties. Change the configuration to All Configurations then go to Configuration properties, General and change Intermediate Directory to $(ProjectName)\$(Platform)\$(Configuration)\.&lt;br /&gt;
*If you get a compilation error saying that the file pbt.h cannot be found in windows.cpp then go to the relevant line and comment it out. This header is no longer needed in wxWidgets and no longer included with Visual Studio but the #include got forgotten and left in the source.&lt;br /&gt;
*Finally if you want to build a 64 bit version do not try changing the Build Target in the project properties, this causes various linker errors. Instead go to Build, Configuration Manager... and in the active solution platform select &amp;lt;new&amp;gt; then select x64. This will create 64 bit configurations for all projects. Unfortunately you cannot build 64 bit and 32 bit libraries at the same time and if you have built a 32 bit library and want to build the 64 bit version (or vice versa) then you must clean the project first. See the install-msw-2.8.12.txt file shipped with wxWidgets for more info.&lt;br /&gt;
&lt;br /&gt;
Once you have wxWidgets built PLplot will automatically look for the WXWIN environmental variable which is created by wxPack, or should have been created by you if you set up wxWidgets manually. If you disabled wxWidgets above, then enter the following at the command prompt&lt;br /&gt;
&lt;br /&gt;
   set WXWIN=path/you/wrote/down/earlier&lt;br /&gt;
&lt;br /&gt;
If PLplot finds this environmental variable then it will include wxWidgets in the build. However, it seems that CMAKE doesn’t automatically determine if you are building with Unicode, so if you are then you must specify which wxWidgets build to use by adding the following parameter to your CMake command&lt;br /&gt;
&lt;br /&gt;
   DwxWidgets_CONFIGURATION=mswud&lt;br /&gt;
&lt;br /&gt;
Or for the release version use mswu, just like the suffix at the end of the wxWidgets library files.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;AGG and FreeType&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The wxWidgets driver can use three backends. The wxDC and wxGraphicsContect are part of wxWidgets and use Windows drawing routines. This means if you port your software to Linux the code will then use Linux drawing routines which may be slightly different. This might not be a big deal, but in case it is you can also make use of the cross platform AGG library to render anti-aliased graphics and AGG can either use PLplot’s basic text or the FreeType library for Unicode fonts. If you wish to use them then download the code for these projects. Both are quite straightforward. AGG seem to pride themselves on only using ‘pure’ C so for AGG you can just download the source from http://www.antigrain.com/ and add all the files to a visual studio project and build it. &lt;br /&gt;
If you are using FreeType then you can download the source form http://www.freetype.org/. The download includes a .sln file to build with Visual Studio.&lt;br /&gt;
&lt;br /&gt;
If using both FreeType and AGG then you should copy the files from your_agg_directory\font_freetype to your_agg_directory\include\agg2. You may wish to do the same with those in font_win32_tt, but it’s not needed for PLplot at present.&lt;br /&gt;
&lt;br /&gt;
Also don’t forget to ensure your character set and run time library linkage are set as you want them. To include AGG when you compile PLplot add the following parameters&lt;br /&gt;
&lt;br /&gt;
   DHAVE_AGG=ON -DAGG_INCLUDE_DIR=&amp;quot;D:/SourceCode/Libraries/agg-2.4/include&amp;quot; -DAGG_LIBRARIES=&amp;quot;D:/SourceCode/Libraries/agg-2.4/VC++/AGG/lib/AGGsud.lib&amp;quot;&lt;br /&gt;
&lt;br /&gt;
For FreeType use&lt;br /&gt;
&lt;br /&gt;
   -DWITH_FREETYPE=ON -DFREETYPE_INCLUDE_DIR=&amp;quot;D:/SourceCode/Libraries/freetype-2.4.8/include&amp;quot; -DFREETYPE_LIBRARY=&amp;quot;D:/SourceCode/Libraries/freetype-2.4.8/objs/win32/vc2008/freetypesud.lib&amp;quot;&lt;br /&gt;
But of course change the paths to match your system.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Summary and reference&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
So just so you see the whole thing, my final CMake command for a debug build is&lt;br /&gt;
&lt;br /&gt;
 cmake &amp;quot;D:/SourceCode/Libraries/plplot_trunk&amp;quot; -G &amp;quot;Visual Studio 9 2008&amp;quot; -DPL_DOUBLE=ON -DLIB_TAG=&amp;quot;su&amp;quot; -DBUILD_TEST=ON -DCMAKE_INSTALL_PREFIX=&amp;quot;D:\SourceCode\Libraries\plplotinstall&amp;quot; -DBUILD_SHARED_LIBS=OFF -DCMAKE_CONFIGURATION_TYPES=&amp;quot;Debug&amp;quot; -DSTATIC_RUNTIME=ON -DwxWidgets_CONFIGURATION=mswud -DHAVE_SHAPELIB=ON -DSHAPELIB_INCLUDE_DIR=&amp;quot;D:/SourceCode/Libraries/shapelib-1.3.0/include/shapelib&amp;quot; -DSHAPELIB_LIBRARY=&amp;quot;D:/SourceCode/Libraries/shapelib-1.3.0/lib/shapelibsd.lib&amp;quot;  -DHAVE_AGG=ON -DAGG_INCLUDE_DIR=&amp;quot;D:/SourceCode/Libraries/agg-2.4/include&amp;quot; -DAGG_LIBRARIES=&amp;quot;D:/SourceCode/Libraries/agg-2.4/VC++/AGG/lib/AGGsud.lib&amp;quot; -DWITH_FREETYPE=ON -DFREETYPE_INCLUDE_DIR=&amp;quot;D:/SourceCode/Libraries/freetype-2.4.8/include&amp;quot; -DFREETYPE_LIBRARY=&amp;quot;D:/SourceCode/Libraries/freetype-2.4.8/objs/win32/vc2008/freetypesud.lib&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
For reference here is a quick rundown of each of the parameters&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;“D:/SourceCode/Libraries/plplot trunk”:&amp;#039;&amp;#039;&amp;#039; the path to my source directory – case sensitive.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;-G “Visual Studio 9 2008”:&amp;#039;&amp;#039;&amp;#039; the compiler I want to generate a project/solution for.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;-DPL_DOUBLE=ON:&amp;#039;&amp;#039;&amp;#039; use doubles, rather than floats in PLplot. Also adds d to the library names.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;-DLIB_TAG=”su”:&amp;#039;&amp;#039;&amp;#039; this will append “su” to the end of the library name and is an indicator to me that I’m using static linkage with the Unicode character set. I use sud for static Unicode debug etc.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;-DBUILD_TEST=ON:&amp;#039;&amp;#039;&amp;#039; Indicates I want to create projects for the examples. Set to OFF to not build them.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;-DCMAKE_INSTALL_PREFIX=”D:\SourceCode\Libraries\plplotinstall”&amp;#039;&amp;#039;&amp;#039; The directory you want your final libraries to end up in, it will be created if it doesn’t exist. If you leave this blank it defaults to C:\Program Files\PLplot, however in Windows Vista or later UAC will stop the file being written here unless you run Visual Studio as administrator.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;-DCMAKE_CONFIGURATION_TYPES=”Release”:&amp;#039;&amp;#039;&amp;#039; The configuration to use in the project. You can run create multiple configurations in one solution by listing them separated by semicolons, but if using Shapelib, FreeType or AGG this causes linking problems with the examples as you can’t specify linkage against the release and debug versions separated by semicolons. It also causes issues with installing to one directory so it’s best to create on sln for each configuration. You can include Release, Debug, MinSizeRel and RelWithDebInfo. &lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;-DSTATIC_RUNTIME=ON:&amp;#039;&amp;#039;&amp;#039; This causes us to link against the static runtime (equivalent to /MT or /MTd flags). Set it to OFF if you want to link against the dynamic runtime (equivalent to /MD or /MDd). &lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;-DBUILD_SHARED_LIBS=OFF&amp;#039;&amp;#039;&amp;#039; Build a .lib rather than a .dll. If you don’t set this the default will be to build dlls.All the options above except the source directory and compiler are optional and will be set to default values if excluded. &lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Anything with AGG in:&amp;#039;&amp;#039;&amp;#039; These point out that I want to use AGG and specifies the location of header files and the library itself. The library is only needed if –DBUILD_TEST is ON. None are needed if you are not using AGG.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Anything with FREETYPE in:&amp;#039;&amp;#039;&amp;#039; As with the AGG stuff it indicates I want to use FreeType and gives the location of the headers and library. Note that the variables have slightly different names to the AGG ones. Again the library is only needed when building the examples.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Anything with SHAPELIB in:&amp;#039;&amp;#039;&amp;#039; As for the FREETYPE and AGG parameters, but for shapelib.&lt;br /&gt;
&lt;br /&gt;
There are also other customisable options and after you’ve run CMAKE you can examine the CMakeCache.txt file that is created in your build directory to see others (prepend -D to define them on the command line) or look at the wiki page or CMAKE documentation.&lt;/div&gt;</summary>
		<author><name>Philrosenberg</name></author>	</entry>

	<entry>
		<id>http://www.miscdebris.net/plplot_wiki/index.php?title=Configure_PLplot_for_the_Visual_Studio_IDE&amp;diff=3003</id>
		<title>Configure PLplot for the Visual Studio IDE</title>
		<link rel="alternate" type="text/html" href="http://www.miscdebris.net/plplot_wiki/index.php?title=Configure_PLplot_for_the_Visual_Studio_IDE&amp;diff=3003"/>
				<updated>2013-09-27T13:46:56Z</updated>
		
		<summary type="html">&lt;p&gt;Philrosenberg: Rewrote the Visual Studio instructions to reflect changes for the new version&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;CMake allows you to generate Visual Studio solution and project files. &lt;br /&gt;
&lt;br /&gt;
As of version 2.8.2 of CMake, here are a few caveats:&lt;br /&gt;
&lt;br /&gt;
* If you use Intel Fortran, the solution/project files may cause errors when building. These affect only the Fortran libraries and examples. It is due to a small bug in CMake that should be fixed with the next release.&lt;br /&gt;
* For some reason you can not run the examples directly. We have not found out yet what is the matter, but there is a workaround - see below.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Workaround for examples built with Visual Studio&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
* Build the PLplot libraries and examples via the ALL_BUILD project&lt;br /&gt;
* Open a DOS box in the Debug directory for any one of these examples&lt;br /&gt;
* Set the following environment variables:&lt;br /&gt;
&lt;br /&gt;
   set path=&amp;lt;build&amp;gt;\dll\Debug;%PATH% &lt;br /&gt;
   set PLPLOT_DRV_DIR=&amp;lt;build&amp;gt;\drivers    &lt;br /&gt;
   set PLPLOT_LIB=&amp;lt;source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   where: &amp;lt;build&amp;gt; is the directory where PLplot was built&lt;br /&gt;
   and the directory &amp;quot;&amp;lt;source&amp;gt;\data&amp;quot; holds the .pal and .fnt files&lt;br /&gt;
* In this environment you can run the sample program&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Walkthrough building PLPLot with Visual Studio ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Why can’t I just include all the code files in a project and press the build button?&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
PLplot makes every effort to be compatible with multiple different compilers on multiple OSs. It also uses third party libraries for backends/drivers. If every compiler exactly conformed to the (same) C++ and C standards and included nothing else and if every other library did the same then this would be easy. But they don’t and it isn’t. Some libraries only work on Linux or Windows and different compilers add extra features and although often the same additional features exist in different compilers they sometimes have different names or are in different header files. This all can make writing a cross platform library quite tricky.&lt;br /&gt;
&lt;br /&gt;
PLplot addresses this by using a build system called CMake. This is an extra layer of code between the C/C++ code and the compiler. The CMake code is run before you try to compile the library and it attempts to detect the various platform specific differences and create (in the case of Visual Studio) .sln and .proj files and a config.h file that fits your configuration.&lt;br /&gt;
A Walkthrough&lt;br /&gt;
&lt;br /&gt;
I have spent some time trying to get CMake to work with my setup and the PLplot developers have helped with bug fixes to get this right so PLplot should now be straightforward to compile on windows. Fundamentally I want to end up with a visual studio sln file which I can use to build PLplot. It should ensure I have access to the libraries and backends/drivers that I want to use which include shapelib, wxWidgets, AGG and FreeType. Ideally it should include the examples and allow me to specify all the project properties I need so that if I update my code to the latest trunk version (which I do quite often) I don’t have to manually change lots of settings. Unfortunately there is a bit of a Linux bias to Cmake so here are some things that may catch you out, here are a few of those:&lt;br /&gt;
*When specifying paths to CMAKE, capitalisation matters.&lt;br /&gt;
*When CMAKE looks for additional libraries it sometimes only looks in the default Linux path so you might have to specify library locations&lt;br /&gt;
*All the defaults are to build dynamically linked dynamic libraries with dynamic runtime linkage – if you want anything else then you must specify so.&lt;br /&gt;
*If you need to recreate your sln files then it’s best to delete everything in your build directory and start again from scratch.&lt;br /&gt;
Anyhow here is a walkthrough of how I got everything working.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Backends/Drivers&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
PLplot could include code to write your plots to screen, memory, and the myriad of different file formats that you may want to use. However, if this was the case the developers would spend all their time looking at details of jpeg file formats or the different operating system device contexts. Instead PLplot has built in support for a few output devices and then uses other libraries referred to as drivers to output to most file types. In the walkthrough I’ll show you how to compile with just the built in outputs first, then I’ll add in shapefile support for maps using shapelib, and the wxWidgets driver with options for rendering with, AGG and Freetype.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Compiling a Basic PLplot Library&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
To build PLplot you will need some extra tools first. Download and install CMAKE from http://www.cmake.org/. Next if you want to use the very latest version of PLplot with the most up to date bug fixes you will need to access the Subversion repository to get the latest trunk version. To do this download tortoiseSVN from http://tortoisesvn.net/, then create a folder where you want to store the PLPlot source code (mine is D:\SourceCode\Libraries\plplot_trunk). Right click the folder and go to TortoiseSVN, Checkout. Enter the URL from http://plplot.sourceforge.net/download.php and click OK. If you ever need to update then right click the folder and click SVN Update. If you want the latest release version then you can download it from the same download link and just unzip it to a location of your choosing. If you have any doubt about whether you want the trunk version or the release version then my recommendation would be the trunk version. At the very least get the latest development release rather than the stable release as there have been a lot of updates and bug fixes since version 5.8.&lt;br /&gt;
&lt;br /&gt;
Now we can start the build process. open a cmd window and run the following batch file&lt;br /&gt;
&lt;br /&gt;
   C:\Program files\Microsoft Visual Studio 9.0\Common7\Tools\vsvars32.bat&lt;br /&gt;
&lt;br /&gt;
If you installed Visual Studio elsewhere then change the path accordingly and note that on 64 bit machines the default path is in Program Files(x86). This will define environment variables that CMAKE will use so keep this cmd prompt open and do all the following commands in it.&lt;br /&gt;
&lt;br /&gt;
Rather than compile PLplot ‘in place’ we’ll be building it in a separate directory, in fact we need two directories, one for release and one for debug. So create a these build directories. Mine are at D:\Sourcecode\Libraries\plplot_staticbuild_release, with another in the same location but ending debug. I think it is possible to create a release and debug version together in one .sln but i think there are potential clashes so I highly recommend creating a separate release and debug version in separate folders. In your cmd prompt navigate to the release directory.&lt;br /&gt;
&lt;br /&gt;
If you wish to add any extra compiler flags do so by setting the environment variables CXXFLAGS and CFLAGS in your cmd prompt. I use this facility to set the Unicode options&lt;br /&gt;
&lt;br /&gt;
   set CXXFLAGS=/DUNICODE /D_UNICODE&lt;br /&gt;
   set CFLAGS=/DUNICODE /D_UNICODE&lt;br /&gt;
&lt;br /&gt;
Note that you almost always want CXXFLAGS and CFLAGS to be identical.&lt;br /&gt;
&lt;br /&gt;
If you already have wxWidgets installed then you may wish to stop PLplot finding it for this basic build. To do so type &lt;br /&gt;
&lt;br /&gt;
   %WXWIN%&lt;br /&gt;
&lt;br /&gt;
and make a note of the path for later. Then enter&lt;br /&gt;
&lt;br /&gt;
   set WXWIN=&lt;br /&gt;
&lt;br /&gt;
Now call CMAKE as follows:&lt;br /&gt;
&lt;br /&gt;
   cmake &amp;quot;D:/SourceCode/Libraries/plplot trunk&amp;quot; -G &amp;quot;Visual Studio 9 2008&amp;quot; -DPL_DOUBLE=ON -DLIB_TAG=&amp;quot;sud&amp;quot; -DBUILD_TEST=ON -DCMAKE_INSTALL_PREFIX=&amp;quot;D:\SourceCode\Libraries\plplotinstall&amp;quot;  -DCMAKE_CONFIGURATION_TYPES=&amp;quot;Debug&amp;quot; -DBUILD_SHARED_LIBS=OFF -DSTATIC_RUNTIME=ON&lt;br /&gt;
&lt;br /&gt;
A full description of the parameters can be found in the reference below. You can obviously change them to suit your needs. Hopefully after a minute or two the screen output should end with &lt;br /&gt;
&lt;br /&gt;
   --Configuring done&lt;br /&gt;
   --Generating done&lt;br /&gt;
   --Build files have been written to D:/SourceCode/Libraries/plplot_staticbuild_release&lt;br /&gt;
&lt;br /&gt;
If you now go to your build directory you should see a solution which you can open in Visual Studio. Just open it up, right click the INSTALL project and select build, this will build your library and put it in the install directory. I use the LIB_TAG parameter to identify this as a static (s), Unicode (u) debug (d) library. Unfortunately some of the built libraries do not get your LIB_TAG added. So go to your install directory and do this manually, this stops them getting overwritten when you build the release version. You should now be able to find the examples in the build directory and try them out. You get a choice of which built in driver you want to use. There is a memory one, a Windows one that outputs to screen and ones that output to ps, svg and xfig files. Once you have a debug version, you can repeat the process in a new directory to create a debug version, make sure you change the LIB_TAG or install directory to avoid overwriting. Well done you now have PLplot up and running.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Other Libraries and Backends&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
PLplot relies on a number of drivers and backends to extend its output capabilities and allow reading of certain data files. I use a few of these and will guide you through adding them. Don’t be tempted to download precompiled .lib and .dll files. If you do then they may not have been compiled with the same setting that you use and may generate hard to fix linker errors. Problem setting can include character set (Unicode, vs multibyte vs not set) and static/dynamic linking to the runtime libraries (multithreaded, multithreaded dll, multithreaded debug, multithreaded debug dll). If you don’t know what static and dynamic linking are then find out because it will be the bane of your programming life if you don’t. I tend to add u to the end of a library name to indicate Unicode and s to indicate static (not dynamic) linkage to the runtime library and d to indicate debug.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Shapelib&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Shapelib allows you to read in .shp shapefileswhich contain vector map information into PLplot . PLPlot already has a coarse resolution global map included, but if you would like higher resolution then you need to add Shapelib. Global files with 10, 50 or 110 mile resolution are available from http://www.naturalearthdata.com and you can find other files online as you need. Shapelib itself is easy to compile, download it from http://shapelib.maptools.org/ create a new windows library project, add all the files and build debug and release versions as needed. There is no need to specify Unicode. To use it in PLplot add the following commands to your CMake call&lt;br /&gt;
&lt;br /&gt;
   -DHAVE_SHAPELIB=ON -DSHAPELIB_INCLUDE_DIR=&amp;quot;D:/SourceCode/Libraries/shapelib-1.3.0/include/shapelib&amp;quot; -DSHAPELIB_LIBRARY=&amp;quot;D:/SourceCode/Libraries/shapelib-1.3.0/lib/shapelibsd.lib&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Of course replace the values with ones appropriate for your system and make sure you use the debug or release library appropriately. Now in calls to plmap you can replace the map name with the path to a shapefile and the lines from this file will be used to draw the map.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;wxWidgets&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
I use wxWidgets for GUI output, it also allows output to various other graphics types like png, bmp, jpg, ps. If you wish to do the same then the best way is to install wxPack which is a fully working version of wxWidgets for Windows. It comes with a Visual Studio .sln file so saves you a lot of hassle. There are loads of instructions for compiling wxWidgets online, so I won’t repeat it all here. However you may wish to enable wxGraphicsContext (which gives anti-aliased output) and wxPostscriptDC to output to ps files. To do this, go through all the various setup.h and setup0.h and set &lt;br /&gt;
&lt;br /&gt;
   #define wxUSE_GRAPHICS_CONTEXT 1&lt;br /&gt;
   #define wxUSE_POSTSCRIPT 1&lt;br /&gt;
&lt;br /&gt;
Open the wxWidgets .sln file and if you wish to change between static and dynamic Runtime then change this in the project properties. Finally go to build, batch build and build all the versions of the library. This can take some time.&lt;br /&gt;
&lt;br /&gt;
For Visual Studio 2012 Users – I have found a few problems with building wxWidgets in VS2012 so I thought I’d add them here. &lt;br /&gt;
*First the Batch Build option is hidden. You can display it by going to Tools, customize, Commands and select the build menu.&lt;br /&gt;
*If you get a lot of build errors talking about CL.exe then this is caused by clashes between intermediate files of different projects. To fix it select all the projects in the solution explorer then right click them and select properties. Change the configuration to All Configurations then go to Configuration properties, General and change Intermediate Directory to $(ProjectName)\$(Platform)\$(Configuration)\.&lt;br /&gt;
*If you get a compilation error saying that the file pbt.h cannot be found in windows.cpp then go to the relevant line and comment it out. This header is no longer needed in wxWidgets and no longer included with Visual Studio but the #include got forgotten and left in the source.&lt;br /&gt;
*Finally if you want to build a 64 bit version do not try changing the Build Target in the project properties, this causes various linker errors. Instead go to Build, Configuration Manager... and in the active solution platform select &amp;lt;new&amp;gt; then select x64. This will create 64 bit configurations for all projects. Unfortunately you cannot build 64 bit and 32 bit libraries at the same time and if you have built a 32 bit library and want to build the 64 bit version (or vice versa) then you must clean the project first. See the install-msw-2.8.12.txt file shipped with wxWidgets for more info.&lt;br /&gt;
&lt;br /&gt;
Once you have wxWidgets built PLplot will automatically look for the WXWIN environmental variable which is created by wxPack, or should have been created by you if you set up wxWidgets manually. If you disabled wxWidgets above, then enter the following at the command prompt&lt;br /&gt;
&lt;br /&gt;
   set WXWIN=path/you/wrote/down/earlier&lt;br /&gt;
&lt;br /&gt;
If PLplot finds this environmental variable then it will include wxWidgets in the build. However, it seems that CMAKE doesn’t automatically determine if you are building with Unicode, so if you are then you must specify which wxWidgets build to use by adding the following parameter to your CMake command&lt;br /&gt;
&lt;br /&gt;
   DwxWidgets_CONFIGURATION=mswud&lt;br /&gt;
&lt;br /&gt;
Or for the release version use mswu, just like the suffix at the end of the wxWidgets library files.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;AGG and FreeType&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
The wxWidgets driver can use three backends. The wxDC and wxGraphicsContect are part of wxWidgets and use Windows drawing routines. This means if you port your software to Linux the code will then use Linux drawing routines which may be slightly different. This might not be a big deal, but in case it is you can also make use of the cross platform AGG library to render anti-aliased graphics and AGG can either use PLplot’s basic text or the FreeType library for Unicode fonts. If you wish to use them then download the code for these projects. Both are quite straightforward. AGG seem to pride themselves on only using ‘pure’ C so for AGG you can just download the source from http://www.antigrain.com/ and add all the files to a visual studio project and build it. &lt;br /&gt;
If you are using FreeType then you can download the source form http://www.freetype.org/. The download includes a .sln file to build with Visual Studio.&lt;br /&gt;
&lt;br /&gt;
If using both FreeType and AGG then you should copy the files from your_agg_directory\font_freetype to your_agg_directory\include\agg2. You may wish to do the same with those in font_win32_tt, but it’s not needed for PLplot at present.&lt;br /&gt;
&lt;br /&gt;
Also don’t forget to ensure your character set and run time library linkage are set as you want them. To include AGG when you compile PLplot add the following parameters&lt;br /&gt;
&lt;br /&gt;
   DHAVE_AGG=ON -DAGG_INCLUDE_DIR=&amp;quot;D:/SourceCode/Libraries/agg-2.4/include&amp;quot; -DAGG_LIBRARIES=&amp;quot;D:/SourceCode/Libraries/agg-2.4/VC++/AGG/lib/AGGsud.lib&amp;quot;&lt;br /&gt;
&lt;br /&gt;
For FreeType use&lt;br /&gt;
&lt;br /&gt;
   -DWITH_FREETYPE=ON -DFREETYPE_INCLUDE_DIR=&amp;quot;D:/SourceCode/Libraries/freetype-2.4.8/include&amp;quot; -DFREETYPE_LIBRARY=&amp;quot;D:/SourceCode/Libraries/freetype-2.4.8/objs/win32/vc2008/freetypesud.lib&amp;quot;&lt;br /&gt;
But of course change the paths to match your system.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Summary and reference&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
So just so you see the whole thing, my final CMake command for a debug build is&lt;br /&gt;
&lt;br /&gt;
 cmake &amp;quot;D:/SourceCode/Libraries/plplot_trunk&amp;quot; -G &amp;quot;Visual Studio 9 2008&amp;quot; -DPL_DOUBLE=ON -DLIB_TAG=&amp;quot;su&amp;quot; -DBUILD_TEST=ON -DCMAKE_INSTALL_PREFIX=&amp;quot;D:\SourceCode\Libraries\plplotinstall&amp;quot; -DBUILD_SHARED_LIBS=OFF -DCMAKE_CONFIGURATION_TYPES=&amp;quot;Debug&amp;quot; -DSTATIC_RUNTIME=ON -DwxWidgets_CONFIGURATION=mswud -DHAVE_SHAPELIB=ON -DSHAPELIB_INCLUDE_DIR=&amp;quot;D:/SourceCode/Libraries/shapelib-1.3.0/include/shapelib&amp;quot; -DSHAPELIB_LIBRARY=&amp;quot;D:/SourceCode/Libraries/shapelib-1.3.0/lib/shapelibsd.lib&amp;quot;  -DHAVE_AGG=ON -DAGG_INCLUDE_DIR=&amp;quot;D:/SourceCode/Libraries/agg-2.4/include&amp;quot; -DAGG_LIBRARIES=&amp;quot;D:/SourceCode/Libraries/agg-2.4/VC++/AGG/lib/AGGsud.lib&amp;quot; -DWITH_FREETYPE=ON -DFREETYPE_INCLUDE_DIR=&amp;quot;D:/SourceCode/Libraries/freetype-2.4.8/include&amp;quot; -DFREETYPE_LIBRARY=&amp;quot;D:/SourceCode/Libraries/freetype-2.4.8/objs/win32/vc2008/freetypesud.lib&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
For reference here is a quick rundown of each of the parameters&lt;br /&gt;
&lt;br /&gt;
“D:/SourceCode/Libraries/plplot trunk”: the path to my source directory – case sensitive.&lt;br /&gt;
&lt;br /&gt;
-G “Visual Studio 9 2008”: the compiler I want to generate a project/solution for.&lt;br /&gt;
&lt;br /&gt;
-DPL_DOUBLE=ON: use doubles, rather than floats in PLplot. Also adds d to the library names.&lt;br /&gt;
&lt;br /&gt;
-DLIB_TAG=”su”: this will append “su” to the end of the library name and is an indicator to me that I’m using static linkage with the Unicode character set. I use sud for static Unicode debug etc.&lt;br /&gt;
&lt;br /&gt;
-DBUILD_TEST=ON: Indicates I want to create projects for the examples. Set to OFF to not build them.&lt;br /&gt;
&lt;br /&gt;
-DCMAKE_INSTALL_PREFIX=”D:\SourceCode\Libraries\plplotinstall” The directory you want your final libraries to end up in, it will be created if it doesn’t exist. If you leave this blank it defaults to C:\Program Files\PLplot, however in Windows Vista or later UAC will stop the file being written here unless you run Visual Studio as administrator.&lt;br /&gt;
&lt;br /&gt;
-DCMAKE_CONFIGURATION_TYPES=”Release”: The configuration to use in the project. You can run create multiple configurations in one solution by listing them separated by semicolons, but if using Shapelib, FreeType or AGG this causes linking problems with the examples as you can’t specify linkage against the release and debug versions separated by semicolons. It also causes issues with installing to one directory so it’s best to create on sln for each configuration. You can include Release, Debug, MinSizeRel and RelWithDebInfo. &lt;br /&gt;
&lt;br /&gt;
-DSTATIC_RUNTIME=ON: This causes us to link against the static runtime (equivalent to /MT or /MTd flags). Set it to OFF if you want to link against the dynamic runtime (equivalent to /MD or /MDd). &lt;br /&gt;
&lt;br /&gt;
-DBUILD_SHARED_LIBS=OFF Build a .lib rather than a .dll. If you don’t set this the default will be to build dlls.All the options above except the source directory and compiler are optional and will be set to default values if excluded. &lt;br /&gt;
&lt;br /&gt;
Anything with AGG in: These point out that I want to use AGG and specifies the location of header files and the library itself. The library is only needed if –DBUILD_TEST is ON. None are needed if you are not using AGG.&lt;br /&gt;
&lt;br /&gt;
Anything with FREETYPE in: As with the AGG stuff it indicates I want to use FreeType and gives the location of the headers and library. Note that the variables have slightly different names to the AGG ones. Again the library is only needed when building the examples.&lt;br /&gt;
&lt;br /&gt;
Anything with SHAPELIB in: As for the FREETYPE and AGG parameters, but for shapelib.&lt;br /&gt;
&lt;br /&gt;
There are also other customisable options and after you’ve run CMAKE you can examine the CMakeCache.txt file that is created in your build directory to see others (prepend -D to define them on the command line) or look at the wiki page or CMAKE documentation. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Having just been throught this process I thought I&amp;#039;d make sure it was available online for others. I&amp;#039;ve just compiled PLPLot 5.9.9 with wxWidgets 2.8 using Microsoft Visual Studio 2008 Express on a Windows 7 machine. It is a bit of an arduous process but it should work. My reason for wanting to do this is that I have wxWidgets compiled using Visual Studio in various differet configurations (with/without unicode, static/dynamic) and needed PLPlot with matching configurations and similar ease of changing proerties/recompiling. Here are the instructions. If you are not using wxWidgets then you can ignore the wxWidget specific instructions.&lt;br /&gt;
&lt;br /&gt;
If you want to write GUI applications using wxWidgets then you probably already have a working sln file for compiling wxWidgets. If not then download one from wxPack - I found this the most reliable way to get a wxWidgets working on Windows. If you have just installed wxPack then navigate to the install folder and open the sln file. Now Go to Build-&amp;gt;Batch Build, select all and build. I think some projects in the solution depend on others so it might take three or four attempts to get everything to compile. I never got the Universal configurations to compile, but don&amp;#039;t use them so am not worried.&lt;br /&gt;
&lt;br /&gt;
Now, to get antialiased graphics to work with wxWidgets you can use wxWidgets Built in antialiasing using the graphics context or you can use the AGG library. I seem to remember AGG was quite easy to build, so I&amp;#039;ll leave that for you to work out. For Fonts again you have the option of wxWidgets internal or the FreeType library. Again you need to build FreeType if you want it.&lt;br /&gt;
&lt;br /&gt;
If you want to use wxWidgets antialiasing you must recompile wxWidgets. In your wxWidgets directory find all instances of setup.h or setup0.h and set&lt;br /&gt;
   #define wxUSE_GRAPHICS_CONTEXT 1&lt;br /&gt;
while I was at it I also set&lt;br /&gt;
   #define wxUSE_POSTSCRIPT 1&lt;br /&gt;
This isn&amp;#039;t needed for plplot but I thought as I was recompiling anyway I&amp;#039;d add it in. &lt;br /&gt;
&lt;br /&gt;
Now right click the project core, and select properties.&lt;br /&gt;
Under librarian-&amp;gt;General-&amp;gt;Additional dependancies or Linker-&amp;gt;Input additional Dependancies add gdiplus.lib&lt;br /&gt;
&lt;br /&gt;
Now go to Build-&amp;gt;Batch Build and Build all. If you get errors about a manifest then go to Build-&amp;gt; Batch Build and ReBuild all. You may need to do repeated builds to get everything built as above. If you got the manifest error and rebuilt then do additional builds, not rebuilds until everything is built.&lt;br /&gt;
&lt;br /&gt;
Download the PlPlot Source and unzip it. In this example I&amp;#039;ve chosen to unzip to D:\plplot-5.9.9. Make a new directory alongside this, I&amp;#039;ve chosen to call it D:\plplot-5.9.9_staticbuild.&lt;br /&gt;
&lt;br /&gt;
Install Cmake if you don&amp;#039;t already have it.&lt;br /&gt;
&lt;br /&gt;
open a command prompt and enter&lt;br /&gt;
   c:\program files\microsoft visual studio 9.0\common7\tools\vsvars32.bat&lt;br /&gt;
This may be different if you installed visual studio elsewhere, have a different version of visual studio or I guess the 32 may be a 64 on 64 bit machines.&lt;br /&gt;
&lt;br /&gt;
Then &lt;br /&gt;
   d:\&lt;br /&gt;
   cd d:\plplot-5.9.9_staticbuild&lt;br /&gt;
Obviously modify this if you want to build somewhere else&lt;br /&gt;
Now you can use Cmake to generate your visual studio solution/project files. The default command is&lt;br /&gt;
   cmake d:/plplot-5.9.9 -G &amp;quot;Visual Studio 9 2008&amp;quot; -DPL_DOUBLE=ON -DBUILD_SHARED_LIBS=OFF&lt;br /&gt;
This will make your project files with plplot using double precision (in theory) to generate static libraries. There are some other options you might want to add, such as&lt;br /&gt;
   -DENABLE_wxwidgets=ON&lt;br /&gt;
   -DHAVE_AGG=ON&lt;br /&gt;
   -DHAVE_FREETYPE=ON&lt;br /&gt;
   -DLIB_TAG=&amp;quot;s&amp;quot;&lt;br /&gt;
These are pretty self explanitory. The DLIB_TAG option adds s to the end of the project files. I use this to indicate static. You may wish to change the projects to unicode as the default for projects created with CMake is multibyte character set and the default for projects created in MSVC++ is unicode. The text type must match otherwise string related linking errors will occur. After a bit of googling the command to do this seems to be&lt;br /&gt;
      -DCMAKE_CXX_FLAGS=&amp;quot;/D_UNICODE /DUNICODE&amp;quot;&lt;br /&gt;
but wen I use this option the library will not build so I suggest you change to Unicode manually using project properties after the projects have been created.&lt;br /&gt;
&lt;br /&gt;
You can see [[CMake options for PLplot]] for more PLplot specific options. You can also set SHARED_LIBS to OFF to generate dynamic libraries but I haven&amp;#039;t tried this yet.&lt;br /&gt;
&lt;br /&gt;
After calling Cmake you should have a sln file in your directory and a config.h file with sensible settings. It might be worth checking your config.h file and your plconfig.h file. I had to uncomment the line&lt;br /&gt;
   #define PL_DOUBLE&lt;br /&gt;
despite using the DPL_DOUBLE option&lt;br /&gt;
&lt;br /&gt;
I had to do a bit of shuffling of code to get AGG and freetype to work. I had to copy the contents of my AGG include directory and the agg_font_freetype.h file from my agg folders to d:\plplot5.9.9_staticbuild\agg2&lt;br /&gt;
&lt;br /&gt;
Now open the sln file if you haven&amp;#039;t done so already. The projects you can see in the solution do all sorts of things it seems including copying libraries, reporting errors online and building the demos. The projects needed for building the libraries are &lt;br /&gt;
* plplot for the main C interface&lt;br /&gt;
* plplotcxx for the c++ interface&lt;br /&gt;
* plplotwxWidgets for the wxplplotstream and wxplplotwindow objects for use in wxWidget applications&lt;br /&gt;
* qsatime - don&amp;#039;t know what this does&lt;br /&gt;
* csirocsa - don&amp;#039;t know what this does either&lt;br /&gt;
I deleted all projects except for these ones to make life easier. You may want to include the examples or something. Instead of compiling these projects into 5 separate libraries I copied the source files from these projects into the plplot project to complile into one library. I didn&amp;#039;t copy the plplotwxwidgets files accross because I don&amp;#039;t intend to use these classes, but I presume you should be able to do so if you wish.&lt;br /&gt;
&lt;br /&gt;
I had to make some changes to the code to make the library build.&lt;br /&gt;
I had to add&lt;br /&gt;
   #ifdef __cplusplus&lt;br /&gt;
   extern &amp;quot;C&amp;quot; {&lt;br /&gt;
   #endif&lt;br /&gt;
to the beginning and&lt;br /&gt;
   #ifdef __cplusplus&lt;br /&gt;
   }&lt;br /&gt;
   #endif&lt;br /&gt;
to the end of csa.h and qsatime.h. You might also need to go through csa.c and add explicit typecasts to all calls to malloc.&lt;br /&gt;
&lt;br /&gt;
Now you need to go through the project properties to ensure everything is as you want it, eg you are linking against the correct runtime library, the resulting libs are called the correct names and in a folder where you want them, etc.&lt;br /&gt;
&lt;br /&gt;
I then went through a whole world of pain because whenever I tried to link one of my wxWidget projects to my new plplot library the code hung during wxWidgets initialisation. I&amp;#039;ve now traced this to a bug in the wxwidgets.h file. Open this file and search for a the lines&lt;br /&gt;
&lt;br /&gt;
   wxAppInitializer                                                 \&lt;br /&gt;
   wxAppInitializer( (wxAppInitializerFunction) wxPLCreateApp );    \&lt;br /&gt;
&lt;br /&gt;
and replace them with&lt;br /&gt;
&lt;br /&gt;
   wxAppInitializer                                                 \&lt;br /&gt;
   wxAppInitializer( (wxAppInitializerFunction) (wxApp::GetInitializerFunction()==NULL ? wxPLCreateApp : wxApp::GetInitializerFunction()) );    \&lt;br /&gt;
&lt;br /&gt;
You may want to create dlls as well as static libs. If so create a new folder called plplot-5.9.9_sharedlibs and start the process again from scratch using this folder. If you try to create a shared library solution in the same directory as the static library then your config files will be overwritten and your static build will stop working.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Using the latest development version&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
This morning (28th june 2012) I tried for the first time to build the latest development version (Trunk). This went rather smoother than when I tried version 5.9.9. Kudos to the developers for improving things and here are the instructions for using it. If you are using wxWidgets I would recommend using Trunk as there have been some bug fixes since 5.9.9.&lt;br /&gt;
&lt;br /&gt;
If you wish to use wxWidgets then install it as described above.&lt;br /&gt;
&lt;br /&gt;
If you wish to use AGG and/or FreeType then download and build those libraries.&lt;br /&gt;
&lt;br /&gt;
Install Tortoise SVN and use this to get the PLplot source from the repository. Details are at [[subversion access]]. If you have a preffered method for accessing repositories then you can obviously use this instead.&lt;br /&gt;
&lt;br /&gt;
Install CMake.&lt;br /&gt;
&lt;br /&gt;
As described above, create a working directory for the library, start a cmd prompt and cd to the new directory.&lt;br /&gt;
&lt;br /&gt;
Run the vsvars32.bat file as described above.&lt;br /&gt;
&lt;br /&gt;
Run CMake as described above with suitable options for static linkage and use of wxWidgets/AGG/FreeType.&lt;br /&gt;
&lt;br /&gt;
copy the needed AGG header files into a folder agg2 in your working directory as described above.&lt;br /&gt;
&lt;br /&gt;
Open the .sln file with Visual Studio&lt;br /&gt;
&lt;br /&gt;
In Visual Studio you will see a number of projects. the ones that actually create libraries are&lt;br /&gt;
csirocsa&lt;br /&gt;
plplotcxx&lt;br /&gt;
plplot&lt;br /&gt;
plplotwxwidgets&lt;br /&gt;
qsatime&lt;br /&gt;
You may wish to change settings in these projects. For example you may wish to change the filenames or locations of the generated libraries or the linkages or if you add the four other libraries as Additional Dependancies to plplot then they should be bundled together allowing you to include PLplot as a single library.&lt;br /&gt;
&lt;br /&gt;
Right click the ALL_BUILD and select build. This project will cause the necessary libraries to be built. If any of the 5 projects above fail then build again - it might be that if you&amp;#039;ve added dependancies the build order means the needed libraries don&amp;#039;t exist yet when a project that needs them is being built.&lt;br /&gt;
&lt;br /&gt;
I have just submitted the above fix for wxwindows.h as a patch so this should be available in development version soon.&lt;/div&gt;</summary>
		<author><name>Philrosenberg</name></author>	</entry>

	<entry>
		<id>http://www.miscdebris.net/plplot_wiki/index.php?title=Linux&amp;diff=2996</id>
		<title>Linux</title>
		<link rel="alternate" type="text/html" href="http://www.miscdebris.net/plplot_wiki/index.php?title=Linux&amp;diff=2996"/>
				<updated>2013-05-21T12:08:44Z</updated>
		
		<summary type="html">&lt;p&gt;Philrosenberg: Added a troubleshooting section with the first item being problems with old cairo versions&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Compiling plplot on GNU-Linux ==&lt;br /&gt;
&lt;br /&gt;
=== Prerequisites ===&lt;br /&gt;
[[List of Debian/Ubuntu packages]] provides a list of packages needed to configure and compile PLplot successfully.  The Debian/Ubuntu package names should be a rough guide for the names of required packages for other Linux distributions.&lt;br /&gt;
&lt;br /&gt;
=== Quick recipe for building and installing PLplot from a tarball ===&lt;br /&gt;
&lt;br /&gt;
This quick method should be relevant for most Linux users.  Assume the path /home/yourname/plplot exists and is empty, and assume you have put the latest released PLplot version string into the &amp;quot;PL_VERSION&amp;quot; environment variable (as of this writing do that using &amp;quot;export PL_VERSION=5.9.5&amp;quot;).   Then do the following steps:&lt;br /&gt;
&lt;br /&gt;
# cd /home/yourname/plplot&lt;br /&gt;
# rm -rf plplot-$PL_VERSION build_dir install_directory&lt;br /&gt;
# tar -zxf plplot-$PL_VERSION.tar.gz &lt;br /&gt;
# mkdir build_directory&lt;br /&gt;
# cd build_directory&lt;br /&gt;
# cmake  \ -DCMAKE_INSTALL_PREFIX:PATH=/home/yourname/plplot/install_directory \ ../plplot-$PL_VERSION &amp;gt;&amp;amp; cmake.out&lt;br /&gt;
# less cmake.out&lt;br /&gt;
# make VERBOSE=1 &amp;gt;&amp;amp; make.out&lt;br /&gt;
# less make.out&lt;br /&gt;
# make VERBOSE=1 install &amp;gt;&amp;amp; make_install.out&lt;br /&gt;
# less make_install.out &lt;br /&gt;
&lt;br /&gt;
Step (1) changes your directory to the correct starting directory; step(2) removes the stale source, build, and install trees (note be careful with rm -rf since that is a powerful and potentially dangerous command); step (3) unpacks the tarball into the plplot-$PL_VERSION subdirectory of your starting directory; step (4) creates a new subdirectory where the configuration and build steps will be done; step (5) changes to that subdirectory; step (6) configures PLplot using the cmake application and captures the resulting output in the cmake.out file. (n.b. the &amp;quot;../plplot-$PL_VERSION&amp;quot; refers to the top of the source directory tree); step (7) lets you look at that captured output for any error or warning messages; step (8) builds PLplot and captures the resulting output in the  make.out file; step (9) lets you look at that captured output for any error or warning messages; step (10) installs PLplot in the /home/yourname/plplot/install_directory specified in step (6) as the install prefix and captures the resulting output in the make_install.out file; and step (11) lets you look at that captured output for any error or warning messages.&lt;br /&gt;
&lt;br /&gt;
To summarize, the various directories are:&lt;br /&gt;
&lt;br /&gt;
# the source-tree with top-level directory /home/yourname/plplot/plplot-PL_VERSION&lt;br /&gt;
# the build-tree directory, /home/yourname/plplot/build_directory&lt;br /&gt;
# the install-tree directory, /home/yourname/plplot/install_directory&lt;br /&gt;
&lt;br /&gt;
For more details consult [[Building_PLplot#Generic Unix instructions for our build system|the generic Unix instructions for our build system]].&lt;br /&gt;
&lt;br /&gt;
=== Other options ===&lt;br /&gt;
&lt;br /&gt;
The Python and Java interfaces to PLplot are generated with SWIG so if you want those interfaces you must install SWIG.  If SWIG is installed and cmake cannot find it, then you must help cmake out by specifying the directory where swig.swg (an important SWIG file) is located using the CMAKE_INCLUDE_PATH environment variable.  For example, one of our users reported success with finding SWIG and generating our Python and Java interfaces for Arch Linux by specifying&lt;br /&gt;
&lt;br /&gt;
CMAKE_INCLUDE_PATH=/usr/share/swig/1.3.27&lt;br /&gt;
&lt;br /&gt;
Normally,  though, such extraordinary measures are not required on Linux.&lt;br /&gt;
&lt;br /&gt;
== Compiling the PLplot examples ==&lt;br /&gt;
&lt;br /&gt;
Following the previous quick recipe for building and installing PLplot, here is how to compile the examples and test them:&lt;br /&gt;
&lt;br /&gt;
# cd \ /home/yourname/plplot/install_directory/share/plplot$PL_VERSION/examples&lt;br /&gt;
# make test_noninteractive &amp;gt;&amp;amp; make_test.out&lt;br /&gt;
# less make_test.out&lt;br /&gt;
&lt;br /&gt;
The test takes a significant amount of time and a large number of plot files (pdf, png, xfig,...) that consume a couple of gigabytes of disk space are generated.  For more details consult [[Testing_PLplot|Testing PLplot]].&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
=== Cairo undefined references ===&lt;br /&gt;
&lt;br /&gt;
If during the make stage or when making examples or your own programs you see undefined references to pango_layout_get_baseline or cairo_ps_surface_set_eps then it is likely that your version of Cairo is older than required. This has been reported on more conservative distros e.g. CentOS/RedHat. You can turn off Cairo dependancies by using the cmake flag -DDEFAULT_NO_CAIRO_DEVICES=ON&lt;/div&gt;</summary>
		<author><name>Philrosenberg</name></author>	</entry>

	<entry>
		<id>http://www.miscdebris.net/plplot_wiki/index.php?title=Configure_PLplot_for_the_Visual_Studio_IDE&amp;diff=2990</id>
		<title>Configure PLplot for the Visual Studio IDE</title>
		<link rel="alternate" type="text/html" href="http://www.miscdebris.net/plplot_wiki/index.php?title=Configure_PLplot_for_the_Visual_Studio_IDE&amp;diff=2990"/>
				<updated>2012-07-01T19:40:42Z</updated>
		
		<summary type="html">&lt;p&gt;Philrosenberg: changed unicode info&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;CMake allows you to generate Visual Studio solution and project files. &lt;br /&gt;
&lt;br /&gt;
As of version 2.8.2 of CMake, here are a few caveats:&lt;br /&gt;
&lt;br /&gt;
* If you use Intel Fortran, the solution/project files may cause errors when building. These affect only the Fortran libraries and examples. It is due to a small bug in CMake that should be fixed with the next release.&lt;br /&gt;
* For some reason you can not run the examples directly. We have not found out yet what is the matter, but there is a workaround - see below.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Workaround for examples built with Visual Studio&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
* Build the PLplot libraries and examples via the ALL_BUILD project&lt;br /&gt;
* Open a DOS box in the Debug directory for any one of these examples&lt;br /&gt;
* Set the following environment variables:&lt;br /&gt;
&lt;br /&gt;
   set path=&amp;lt;build&amp;gt;\dll\Debug;%PATH% &lt;br /&gt;
   set PLPLOT_DRV_DIR=&amp;lt;build&amp;gt;\drivers    &lt;br /&gt;
   set PLPLOT_LIB=&amp;lt;source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   where: &amp;lt;build&amp;gt; is the directory where PLplot was built&lt;br /&gt;
   and the directory &amp;quot;&amp;lt;source&amp;gt;\data&amp;quot; holds the .pal and .fnt files&lt;br /&gt;
* In this environment you can run the sample program&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Walkthrough building PLPLot with Visual Studio&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Having just been throught this process I thought I&amp;#039;d make sure it was available online for others. I&amp;#039;ve just compiled PLPLot 5.9.9 with wxWidgets 2.8 using Microsoft Visual Studio 2008 Express on a Windows 7 machine. It is a bit of an arduous process but it should work. My reason for wanting to do this is that I have wxWidgets compiled using Visual Studio in various differet configurations (with/without unicode, static/dynamic) and needed PLPlot with matching configurations and similar ease of changing proerties/recompiling. Here are the instructions. If you are not using wxWidgets then you can ignore the wxWidget specific instructions.&lt;br /&gt;
&lt;br /&gt;
If you want to write GUI applications using wxWidgets then you probably already have a working sln file for compiling wxWidgets. If not then download one from wxPack - I found this the most reliable way to get a wxWidgets working on Windows. If you have just installed wxPack then navigate to the install folder and open the sln file. Now Go to Build-&amp;gt;Batch Build, select all and build. I think some projects in the solution depend on others so it might take three or four attempts to get everything to compile. I never got the Universal configurations to compile, but don&amp;#039;t use them so am not worried.&lt;br /&gt;
&lt;br /&gt;
Now, to get antialiased graphics to work with wxWidgets you can use wxWidgets Built in antialiasing using the graphics context or you can use the AGG library. I seem to remember AGG was quite easy to build, so I&amp;#039;ll leave that for you to work out. For Fonts again you have the option of wxWidgets internal or the FreeType library. Again you need to build FreeType if you want it.&lt;br /&gt;
&lt;br /&gt;
If you want to use wxWidgets antialiasing you must recompile wxWidgets. In your wxWidgets directory find all instances of setup.h or setup0.h and set&lt;br /&gt;
   #define wxUSE_GRAPHICS_CONTEXT 1&lt;br /&gt;
while I was at it I also set&lt;br /&gt;
   #define wxUSE_POSTSCRIPT 1&lt;br /&gt;
This isn&amp;#039;t needed for plplot but I thought as I was recompiling anyway I&amp;#039;d add it in. &lt;br /&gt;
&lt;br /&gt;
Now right click the project core, and select properties.&lt;br /&gt;
Under librarian-&amp;gt;General-&amp;gt;Additional dependancies or Linker-&amp;gt;Input additional Dependancies add gdiplus.lib&lt;br /&gt;
&lt;br /&gt;
Now go to Build-&amp;gt;Batch Build and Build all. If you get errors about a manifest then go to Build-&amp;gt; Batch Build and ReBuild all. You may need to do repeated builds to get everything built as above. If you got the manifest error and rebuilt then do additional builds, not rebuilds until everything is built.&lt;br /&gt;
&lt;br /&gt;
Download the PlPlot Source and unzip it. In this example I&amp;#039;ve chosen to unzip to D:\plplot-5.9.9. Make a new directory alongside this, I&amp;#039;ve chosen to call it D:\plplot-5.9.9_staticbuild.&lt;br /&gt;
&lt;br /&gt;
Install Cmake if you don&amp;#039;t already have it.&lt;br /&gt;
&lt;br /&gt;
open a command prompt and enter&lt;br /&gt;
   c:\program files\microsoft visual studio 9.0\common7\tools\vsvars32.bat&lt;br /&gt;
This may be different if you installed visual studio elsewhere, have a different version of visual studio or I guess the 32 may be a 64 on 64 bit machines.&lt;br /&gt;
&lt;br /&gt;
Then &lt;br /&gt;
   d:\&lt;br /&gt;
   cd d:\plplot-5.9.9_staticbuild&lt;br /&gt;
Obviously modify this if you want to build somewhere else&lt;br /&gt;
Now you can use Cmake to generate your visual studio solution/project files. The default command is&lt;br /&gt;
   cmake d:/plplot-5.9.9 -G &amp;quot;Visual Studio 9 2008&amp;quot; -DPL_DOUBLE=ON -DBUILD_SHARED_LIBS=OFF&lt;br /&gt;
This will make your project files with plplot using double precision (in theory) to generate static libraries. There are some other options you might want to add, such as&lt;br /&gt;
   -DENABLE_wxwidgets=ON&lt;br /&gt;
   -DHAVE_AGG=ON&lt;br /&gt;
   -DHAVE_FREETYPE=ON&lt;br /&gt;
   -DLIB_TAG=&amp;quot;s&amp;quot;&lt;br /&gt;
These are pretty self explanitory. The DLIB_TAG option adds s to the end of the project files. I use this to indicate static. You may wish to change the projects to unicode as the default for projects created with CMake is multibyte character set and the default for projects created in MSVC++ is unicode. The text type must match otherwise string related linking errors will occur. After a bit of googling the command to do this seems to be&lt;br /&gt;
      -DCMAKE_CXX_FLAGS=&amp;quot;/D_UNICODE /DUNICODE&amp;quot;&lt;br /&gt;
but wen I use this option the library will not build so I suggest you change to Unicode manually using project properties after the projects have been created.&lt;br /&gt;
&lt;br /&gt;
You can see [[CMake options for PLplot]] for more PLplot specific options. You can also set SHARED_LIBS to OFF to generate dynamic libraries but I haven&amp;#039;t tried this yet.&lt;br /&gt;
&lt;br /&gt;
After calling Cmake you should have a sln file in your directory and a config.h file with sensible settings. It might be worth checking your config.h file and your plconfig.h file. I had to uncomment the line&lt;br /&gt;
   #define PL_DOUBLE&lt;br /&gt;
despite using the DPL_DOUBLE option&lt;br /&gt;
&lt;br /&gt;
I had to do a bit of shuffling of code to get AGG and freetype to work. I had to copy the contents of my AGG include directory and the agg_font_freetype.h file from my agg folders to d:\plplot5.9.9_staticbuild\agg2&lt;br /&gt;
&lt;br /&gt;
Now open the sln file if you haven&amp;#039;t done so already. The projects you can see in the solution do all sorts of things it seems including copying libraries, reporting errors online and building the demos. The projects needed for building the libraries are &lt;br /&gt;
* plplot for the main C interface&lt;br /&gt;
* plplotcxx for the c++ interface&lt;br /&gt;
* plplotwxWidgets for the wxplplotstream and wxplplotwindow objects for use in wxWidget applications&lt;br /&gt;
* qsatime - don&amp;#039;t know what this does&lt;br /&gt;
* csirocsa - don&amp;#039;t know what this does either&lt;br /&gt;
I deleted all projects except for these ones to make life easier. You may want to include the examples or something. Instead of compiling these projects into 5 separate libraries I copied the source files from these projects into the plplot project to complile into one library. I didn&amp;#039;t copy the plplotwxwidgets files accross because I don&amp;#039;t intend to use these classes, but I presume you should be able to do so if you wish.&lt;br /&gt;
&lt;br /&gt;
I had to make some changes to the code to make the library build.&lt;br /&gt;
I had to add&lt;br /&gt;
   #ifdef __cplusplus&lt;br /&gt;
   extern &amp;quot;C&amp;quot; {&lt;br /&gt;
   #endif&lt;br /&gt;
to the beginning and&lt;br /&gt;
   #ifdef __cplusplus&lt;br /&gt;
   }&lt;br /&gt;
   #endif&lt;br /&gt;
to the end of csa.h and qsatime.h. You might also need to go through csa.c and add explicit typecasts to all calls to malloc.&lt;br /&gt;
&lt;br /&gt;
Now you need to go through the project properties to ensure everything is as you want it, eg you are linking against the correct runtime library, the resulting libs are called the correct names and in a folder where you want them, etc.&lt;br /&gt;
&lt;br /&gt;
I then went through a whole world of pain because whenever I tried to link one of my wxWidget projects to my new plplot library the code hung during wxWidgets initialisation. I&amp;#039;ve now traced this to a bug in the wxwidgets.h file. Open this file and search for a the lines&lt;br /&gt;
&lt;br /&gt;
   wxAppInitializer                                                 \&lt;br /&gt;
   wxAppInitializer( (wxAppInitializerFunction) wxPLCreateApp );    \&lt;br /&gt;
&lt;br /&gt;
and replace them with&lt;br /&gt;
&lt;br /&gt;
   wxAppInitializer                                                 \&lt;br /&gt;
   wxAppInitializer( (wxAppInitializerFunction) (wxApp::GetInitializerFunction()==NULL ? wxPLCreateApp : wxApp::GetInitializerFunction()) );    \&lt;br /&gt;
&lt;br /&gt;
You may want to create dlls as well as static libs. If so create a new folder called plplot-5.9.9_sharedlibs and start the process again from scratch using this folder. If you try to create a shared library solution in the same directory as the static library then your config files will be overwritten and your static build will stop working.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Using the latest development version&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
This morning (28th june 2012) I tried for the first time to build the latest development version (Trunk). This went rather smoother than when I tried version 5.9.9. Kudos to the developers for improving things and here are the instructions for using it. If you are using wxWidgets I would recommend using Trunk as there have been some bug fixes since 5.9.9.&lt;br /&gt;
&lt;br /&gt;
If you wish to use wxWidgets then install it as described above.&lt;br /&gt;
&lt;br /&gt;
If you wish to use AGG and/or FreeType then download and build those libraries.&lt;br /&gt;
&lt;br /&gt;
Install Tortoise SVN and use this to get the PLplot source from the repository. Details are at [[subversion access]]. If you have a preffered method for accessing repositories then you can obviously use this instead.&lt;br /&gt;
&lt;br /&gt;
Install CMake.&lt;br /&gt;
&lt;br /&gt;
As described above, create a working directory for the library, start a cmd prompt and cd to the new directory.&lt;br /&gt;
&lt;br /&gt;
Run the vsvars32.bat file as described above.&lt;br /&gt;
&lt;br /&gt;
Run CMake as described above with suitable options for static linkage and use of wxWidgets/AGG/FreeType.&lt;br /&gt;
&lt;br /&gt;
copy the needed AGG header files into a folder agg2 in your working directory as described above.&lt;br /&gt;
&lt;br /&gt;
Open the .sln file with Visual Studio&lt;br /&gt;
&lt;br /&gt;
In Visual Studio you will see a number of projects. the ones that actually create libraries are&lt;br /&gt;
csirocsa&lt;br /&gt;
plplotcxx&lt;br /&gt;
plplot&lt;br /&gt;
plplotwxwidgets&lt;br /&gt;
qsatime&lt;br /&gt;
You may wish to change settings in these projects. For example you may wish to change the filenames or locations of the generated libraries or the linkages or if you add the four other libraries as Additional Dependancies to plplot then they should be bundled together allowing you to include PLplot as a single library.&lt;br /&gt;
&lt;br /&gt;
Right click the ALL_BUILD and select build. This project will cause the necessary libraries to be built. If any of the 5 projects above fail then build again - it might be that if you&amp;#039;ve added dependancies the build order means the needed libraries don&amp;#039;t exist yet when a project that needs them is being built.&lt;br /&gt;
&lt;br /&gt;
I have just submitted the above fix for wxwindows.h as a patch so this should be available in development version soon.&lt;/div&gt;</summary>
		<author><name>Philrosenberg</name></author>	</entry>

	<entry>
		<id>http://www.miscdebris.net/plplot_wiki/index.php?title=Configure_PLplot_for_the_Visual_Studio_IDE&amp;diff=2989</id>
		<title>Configure PLplot for the Visual Studio IDE</title>
		<link rel="alternate" type="text/html" href="http://www.miscdebris.net/plplot_wiki/index.php?title=Configure_PLplot_for_the_Visual_Studio_IDE&amp;diff=2989"/>
				<updated>2012-06-29T10:32:43Z</updated>
		
		<summary type="html">&lt;p&gt;Philrosenberg: changed fix for hanging problem when using your own wxwidgets app and provided options to specify unicode&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;CMake allows you to generate Visual Studio solution and project files. &lt;br /&gt;
&lt;br /&gt;
As of version 2.8.2 of CMake, here are a few caveats:&lt;br /&gt;
&lt;br /&gt;
* If you use Intel Fortran, the solution/project files may cause errors when building. These affect only the Fortran libraries and examples. It is due to a small bug in CMake that should be fixed with the next release.&lt;br /&gt;
* For some reason you can not run the examples directly. We have not found out yet what is the matter, but there is a workaround - see below.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Workaround for examples built with Visual Studio&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
* Build the PLplot libraries and examples via the ALL_BUILD project&lt;br /&gt;
* Open a DOS box in the Debug directory for any one of these examples&lt;br /&gt;
* Set the following environment variables:&lt;br /&gt;
&lt;br /&gt;
   set path=&amp;lt;build&amp;gt;\dll\Debug;%PATH% &lt;br /&gt;
   set PLPLOT_DRV_DIR=&amp;lt;build&amp;gt;\drivers    &lt;br /&gt;
   set PLPLOT_LIB=&amp;lt;source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   where: &amp;lt;build&amp;gt; is the directory where PLplot was built&lt;br /&gt;
   and the directory &amp;quot;&amp;lt;source&amp;gt;\data&amp;quot; holds the .pal and .fnt files&lt;br /&gt;
* In this environment you can run the sample program&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Walkthrough building PLPLot with Visual Studio&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Having just been throught this process I thought I&amp;#039;d make sure it was available online for others. I&amp;#039;ve just compiled PLPLot 5.9.9 with wxWidgets 2.8 using Microsoft Visual Studio 2008 Express on a Windows 7 machine. It is a bit of an arduous process but it should work. My reason for wanting to do this is that I have wxWidgets compiled using Visual Studio in various differet configurations (with/without unicode, static/dynamic) and needed PLPlot with matching configurations and similar ease of changing proerties/recompiling. Here are the instructions. If you are not using wxWidgets then you can ignore the wxWidget specific instructions.&lt;br /&gt;
&lt;br /&gt;
If you want to write GUI applications using wxWidgets then you probably already have a working sln file for compiling wxWidgets. If not then download one from wxPack - I found this the most reliable way to get a wxWidgets working on Windows. If you have just installed wxPack then navigate to the install folder and open the sln file. Now Go to Build-&amp;gt;Batch Build, select all and build. I think some projects in the solution depend on others so it might take three or four attempts to get everything to compile. I never got the Universal configurations to compile, but don&amp;#039;t use them so am not worried.&lt;br /&gt;
&lt;br /&gt;
Now, to get antialiased graphics to work with wxWidgets you can use wxWidgets Built in antialiasing using the graphics context or you can use the AGG library. I seem to remember AGG was quite easy to build, so I&amp;#039;ll leave that for you to work out. For Fonts again you have the option of wxWidgets internal or the FreeType library. Again you need to build FreeType if you want it.&lt;br /&gt;
&lt;br /&gt;
If you want to use wxWidgets antialiasing you must recompile wxWidgets. In your wxWidgets directory find all instances of setup.h or setup0.h and set&lt;br /&gt;
   #define wxUSE_GRAPHICS_CONTEXT 1&lt;br /&gt;
while I was at it I also set&lt;br /&gt;
   #define wxUSE_POSTSCRIPT 1&lt;br /&gt;
This isn&amp;#039;t needed for plplot but I thought as I was recompiling anyway I&amp;#039;d add it in. &lt;br /&gt;
&lt;br /&gt;
Now right click the project core, and select properties.&lt;br /&gt;
Under librarian-&amp;gt;General-&amp;gt;Additional dependancies or Linker-&amp;gt;Input additional Dependancies add gdiplus.lib&lt;br /&gt;
&lt;br /&gt;
Now go to Build-&amp;gt;Batch Build and Build all. If you get errors about a manifest then go to Build-&amp;gt; Batch Build and ReBuild all. You may need to do repeated builds to get everything built as above. If you got the manifest error and rebuilt then do additional builds, not rebuilds until everything is built.&lt;br /&gt;
&lt;br /&gt;
Download the PlPlot Source and unzip it. In this example I&amp;#039;ve chosen to unzip to D:\plplot-5.9.9. Make a new directory alongside this, I&amp;#039;ve chosen to call it D:\plplot-5.9.9_staticbuild.&lt;br /&gt;
&lt;br /&gt;
Install Cmake if you don&amp;#039;t already have it.&lt;br /&gt;
&lt;br /&gt;
open a command prompt and enter&lt;br /&gt;
   c:\program files\microsoft visual studio 9.0\common7\tools\vsvars32.bat&lt;br /&gt;
This may be different if you installed visual studio elsewhere, have a different version of visual studio or I guess the 32 may be a 64 on 64 bit machines.&lt;br /&gt;
&lt;br /&gt;
Then &lt;br /&gt;
   d:\&lt;br /&gt;
   cd d:\plplot-5.9.9_staticbuild&lt;br /&gt;
Obviously modify this if you want to build somewhere else&lt;br /&gt;
Now you can use Cmake to generate your visual studio solution/project files. The default command is&lt;br /&gt;
   cmake d:/plplot-5.9.9 -G &amp;quot;Visual Studio 9 2008&amp;quot; -DPL_DOUBLE=ON -DBUILD_SHARED_LIBS=OFF&lt;br /&gt;
This will make your project files with plplot using double precision (in theory) to generate static libraries. There are some other options you might want to add, such as&lt;br /&gt;
   -DENABLE_wxwidgets=ON&lt;br /&gt;
   -DHAVE_AGG=ON&lt;br /&gt;
   -DHAVE_FREETYPE=ON&lt;br /&gt;
   -DLIB_TAG=&amp;quot;s&amp;quot;&lt;br /&gt;
   -DCMAKE_CXX_FLAGS=&amp;quot;/D_UNICODE /DUNICODE&amp;quot;&lt;br /&gt;
These are pretty self explanitory. The DLIB_TAG option adds s to the end of the project files. I use this to indicate static. The unicode flags cause the library to be built using the unicode character set. Other wise the library is built with multibyte character set. Note that this option must be matched with any projects you create in the future that link against plplot.&lt;br /&gt;
&lt;br /&gt;
You can see [[CMake options for PLplot]] for more PLplot specific options. You can also set SHARED_LIBS to OFF to generate dynamic libraries but I haven&amp;#039;t tried this yet.&lt;br /&gt;
&lt;br /&gt;
After calling Cmake you should have a sln file in your directory and a config.h file with sensible settings. It might be worth checking your config.h file and your plconfig.h file. I had to uncomment the line&lt;br /&gt;
   #define PL_DOUBLE&lt;br /&gt;
despite using the DPL_DOUBLE option&lt;br /&gt;
&lt;br /&gt;
I had to do a bit of shuffling of code to get AGG and freetype to work. I had to copy the contents of my AGG include directory and the agg_font_freetype.h file from my agg folders to d:\plplot5.9.9_staticbuild\agg2&lt;br /&gt;
&lt;br /&gt;
Now open the sln file if you haven&amp;#039;t done so already. The projects you can see in the solution do all sorts of things it seems including copying libraries, reporting errors online and building the demos. The projects needed for building the libraries are &lt;br /&gt;
* plplot for the main C interface&lt;br /&gt;
* plplotcxx for the c++ interface&lt;br /&gt;
* plplotwxWidgets for the wxplplotstream and wxplplotwindow objects for use in wxWidget applications&lt;br /&gt;
* qsatime - don&amp;#039;t know what this does&lt;br /&gt;
* csirocsa - don&amp;#039;t know what this does either&lt;br /&gt;
I deleted all projects except for these ones to make life easier. You may want to include the examples or something. Instead of compiling these projects into 5 separate libraries I copied the source files from these projects into the plplot project to complile into one library. I didn&amp;#039;t copy the plplotwxwidgets files accross because I don&amp;#039;t intend to use these classes, but I presume you should be able to do so if you wish.&lt;br /&gt;
&lt;br /&gt;
I had to make some changes to the code to make the library build.&lt;br /&gt;
I had to add&lt;br /&gt;
   #ifdef __cplusplus&lt;br /&gt;
   extern &amp;quot;C&amp;quot; {&lt;br /&gt;
   #endif&lt;br /&gt;
to the beginning and&lt;br /&gt;
   #ifdef __cplusplus&lt;br /&gt;
   }&lt;br /&gt;
   #endif&lt;br /&gt;
to the end of csa.h and qsatime.h. You might also need to go through csa.c and add explicit typecasts to all calls to malloc.&lt;br /&gt;
&lt;br /&gt;
Now you need to go through the project properties to ensure everything is as you want it, eg you are linking against the correct runtime library, the resulting libs are called the correct names and in a folder where you want them, etc.&lt;br /&gt;
&lt;br /&gt;
I then went through a whole world of pain because whenever I tried to link one of my wxWidget projects to my new plplot library the code hung during wxWidgets initialisation. I&amp;#039;ve now traced this to a bug in the wxwidgets.h file. Open this file and search for a the lines&lt;br /&gt;
&lt;br /&gt;
   wxAppInitializer                                                 \&lt;br /&gt;
   wxAppInitializer( (wxAppInitializerFunction) wxPLCreateApp );    \&lt;br /&gt;
&lt;br /&gt;
and replace them with&lt;br /&gt;
&lt;br /&gt;
   wxAppInitializer                                                 \&lt;br /&gt;
   wxAppInitializer( (wxAppInitializerFunction) (wxApp::GetInitializerFunction()==NULL ? wxPLCreateApp : wxApp::GetInitializerFunction()) );    \&lt;br /&gt;
&lt;br /&gt;
You may want to create dlls as well as static libs. If so create a new folder called plplot-5.9.9_sharedlibs and start the process again from scratch using this folder. If you try to create a shared library solution in the same directory as the static library then your config files will be overwritten and your static build will stop working.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Using the latest development version&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
This morning (28th june 2012) I tried for the first time to build the latest development version (Trunk). This went rather smoother than when I tried version 5.9.9. Kudos to the developers for improving things and here are the instructions for using it. If you are using wxWidgets I would recommend using Trunk as there have been some bug fixes since 5.9.9.&lt;br /&gt;
&lt;br /&gt;
If you wish to use wxWidgets then install it as described above.&lt;br /&gt;
&lt;br /&gt;
If you wish to use AGG and/or FreeType then download and build those libraries.&lt;br /&gt;
&lt;br /&gt;
Install Tortoise SVN and use this to get the PLplot source from the repository. Details are at [[subversion access]]. If you have a preffered method for accessing repositories then you can obviously use this instead.&lt;br /&gt;
&lt;br /&gt;
Install CMake.&lt;br /&gt;
&lt;br /&gt;
As described above, create a working directory for the library, start a cmd prompt and cd to the new directory.&lt;br /&gt;
&lt;br /&gt;
Run the vsvars32.bat file as described above.&lt;br /&gt;
&lt;br /&gt;
Run CMake as described above with suitable options for static linkage and use of wxWidgets/AGG/FreeType.&lt;br /&gt;
&lt;br /&gt;
copy the needed AGG header files into a folder agg2 in your working directory as described above.&lt;br /&gt;
&lt;br /&gt;
Open the .sln file with Visual Studio&lt;br /&gt;
&lt;br /&gt;
In Visual Studio you will see a number of projects. the ones that actually create libraries are&lt;br /&gt;
csirocsa&lt;br /&gt;
plplotcxx&lt;br /&gt;
plplot&lt;br /&gt;
plplotwxwidgets&lt;br /&gt;
qsatime&lt;br /&gt;
You may wish to change settings in these projects. For example you may wish to change the filenames or locations of the generated libraries or the linkages or if you add the four other libraries as Additional Dependancies to plplot then they should be bundled together allowing you to include PLplot as a single library.&lt;br /&gt;
&lt;br /&gt;
Go to Build and Build Solution. You will find that 3 projects fail. These are create_staging, create_staging_announcement and validate_announcement. I&amp;#039;m not exactly sure what they do (something to do with generating a document of changes maybe?) but they are not required to build your libraries so don&amp;#039;t worry about them. If more projects than this fail then build again - it might be that if you&amp;#039;ve added dependancies the build order means the needed libraries don&amp;#039;t exist yet when a project that needs them is being built.&lt;br /&gt;
&lt;br /&gt;
I have just submitted the above fix for wxwindows.h as a patch so this should be available in development version soon.&lt;/div&gt;</summary>
		<author><name>Philrosenberg</name></author>	</entry>

	<entry>
		<id>http://www.miscdebris.net/plplot_wiki/index.php?title=Configure_PLplot_for_the_Visual_Studio_IDE&amp;diff=2988</id>
		<title>Configure PLplot for the Visual Studio IDE</title>
		<link rel="alternate" type="text/html" href="http://www.miscdebris.net/plplot_wiki/index.php?title=Configure_PLplot_for_the_Visual_Studio_IDE&amp;diff=2988"/>
				<updated>2012-06-28T09:50:06Z</updated>
		
		<summary type="html">&lt;p&gt;Philrosenberg: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;CMake allows you to generate Visual Studio solution and project files. &lt;br /&gt;
&lt;br /&gt;
As of version 2.8.2 of CMake, here are a few caveats:&lt;br /&gt;
&lt;br /&gt;
* If you use Intel Fortran, the solution/project files may cause errors when building. These affect only the Fortran libraries and examples. It is due to a small bug in CMake that should be fixed with the next release.&lt;br /&gt;
* For some reason you can not run the examples directly. We have not found out yet what is the matter, but there is a workaround - see below.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Workaround for examples built with Visual Studio&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
* Build the PLplot libraries and examples via the ALL_BUILD project&lt;br /&gt;
* Open a DOS box in the Debug directory for any one of these examples&lt;br /&gt;
* Set the following environment variables:&lt;br /&gt;
&lt;br /&gt;
   set path=&amp;lt;build&amp;gt;\dll\Debug;%PATH% &lt;br /&gt;
   set PLPLOT_DRV_DIR=&amp;lt;build&amp;gt;\drivers    &lt;br /&gt;
   set PLPLOT_LIB=&amp;lt;source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   where: &amp;lt;build&amp;gt; is the directory where PLplot was built&lt;br /&gt;
   and the directory &amp;quot;&amp;lt;source&amp;gt;\data&amp;quot; holds the .pal and .fnt files&lt;br /&gt;
* In this environment you can run the sample program&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Walkthrough building PLPLot with Visual Studio&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Having just been throught this process I thought I&amp;#039;d make sure it was available online for others. I&amp;#039;ve just compiled PLPLot 5.9.9 with wxWidgets 2.8 using Microsoft Visual Studio 2008 Express on a Windows 7 machine. It is a bit of an arduous process but it should work. My reason for wanting to do this is that I have wxWidgets compiled using Visual Studio in various differet configurations (with/without unicode, static/dynamic) and needed PLPlot with matching configurations and similar ease of changing proerties/recompiling. Here are the instructions. If you are not using wxWidgets then you can ignore the wxWidget specific instructions.&lt;br /&gt;
&lt;br /&gt;
If you want to write GUI applications using wxWidgets then you probably already have a working sln file for compiling wxWidgets. If not then download one from wxPack - I found this the most reliable way to get a wxWidgets working on Windows. If you have just installed wxPack then navigate to the install folder and open the sln file. Now Go to Build-&amp;gt;Batch Build, select all and build. I think some projects in the solution depend on others so it might take three or four attempts to get everything to compile. I never got the Universal configurations to compile, but don&amp;#039;t use them so am not worried.&lt;br /&gt;
&lt;br /&gt;
Now, to get antialiased graphics to work with wxWidgets you can use wxWidgets Built in antialiasing using the graphics context or you can use the AGG library. I seem to remember AGG was quite easy to build, so I&amp;#039;ll leave that for you to work out. For Fonts again you have the option of wxWidgets internal or the FreeType library. Again you need to build FreeType if you want it.&lt;br /&gt;
&lt;br /&gt;
If you want to use wxWidgets antialiasing you must recompile wxWidgets. In your wxWidgets directory find all instances of setup.h or setup0.h and set&lt;br /&gt;
   #define wxUSE_GRAPHICS_CONTEXT 1&lt;br /&gt;
while I was at it I also set&lt;br /&gt;
   #define wxUSE_POSTSCRIPT 1&lt;br /&gt;
This isn&amp;#039;t needed for plplot but I thought as I was recompiling anyway I&amp;#039;d add it in. &lt;br /&gt;
&lt;br /&gt;
Now right click the project core, and select properties.&lt;br /&gt;
Under librarian-&amp;gt;General-&amp;gt;Additional dependancies or Linker-&amp;gt;Input additional Dependancies add gdiplus.lib&lt;br /&gt;
&lt;br /&gt;
Now go to Build-&amp;gt;Batch Build and Build all. If you get errors about a manifest then go to Build-&amp;gt; Batch Build and ReBuild all. You may need to do repeated builds to get everything built as above. If you got the manifest error and rebuilt then do additional builds, not rebuilds until everything is built.&lt;br /&gt;
&lt;br /&gt;
Download the PlPlot Source and unzip it. In this example I&amp;#039;ve chosen to unzip to D:\plplot-5.9.9. Make a new directory alongside this, I&amp;#039;ve chosen to call it D:\plplot-5.9.9_staticbuild.&lt;br /&gt;
&lt;br /&gt;
Install Cmake if you don&amp;#039;t already have it.&lt;br /&gt;
&lt;br /&gt;
open a command prompt and enter&lt;br /&gt;
   c:\program files\microsoft visual studio 9.0\common7\tools\vsvars32.bat&lt;br /&gt;
This may be different if you installed visual studio elsewhere, have a different version of visual studio or I guess the 32 may be a 64 on 64 bit machines.&lt;br /&gt;
&lt;br /&gt;
Then &lt;br /&gt;
   d:\&lt;br /&gt;
   cd d:\plplot-5.9.9_staticbuild&lt;br /&gt;
Obviously modify this if you want to build somewhere else&lt;br /&gt;
Now you can use Cmake to generate your visual studio solution/project files. The default command is&lt;br /&gt;
   cmake d:/plplot-5.9.9 -G &amp;quot;Visual Studio 9 2008&amp;quot; -DPL_DOUBLE=ON -DBUILD_SHARED_LIBS=OFF&lt;br /&gt;
This will make your project files with plplot using double precision (in theory) to generate static libraries. There are some other options you might want to add, such as&lt;br /&gt;
   -DENABLE_wxwidgets=ON&lt;br /&gt;
   -DHAVE_AGG=ON&lt;br /&gt;
   -DHAVE_FREETYPE=ON&lt;br /&gt;
   -DLIB_TAG=&amp;quot;s&amp;quot;&lt;br /&gt;
These are pretty self explanitory. The DLIB_TAG option adds s to the end of the project files. I use this to indicate static.&lt;br /&gt;
You can also set SHARED_LIBS to OFF to generate dynamic libraries but I haven&amp;#039;t tried this yet.&lt;br /&gt;
&lt;br /&gt;
After calling Cmake you should have a sln file in your directory and a config.h file with sensible settings. It might be worth checking your config.h file and your plconfig.h file. I had to uncomment the line&lt;br /&gt;
   #define PL_DOUBLE&lt;br /&gt;
despite using the DPL_DOUBLE option&lt;br /&gt;
&lt;br /&gt;
I had to do a bit of shuffling of code to get AGG and freetype to work. I had to copy the contents of my AGG include directory and the agg_font_freetype.h file from my agg folders to d:\plplot5.9.9_staticbuild\agg2&lt;br /&gt;
&lt;br /&gt;
Now open the sln file if you haven&amp;#039;t done so already. The projects you can see in the solution do all sorts of things it seems including copying libraries, reporting errors online and building the demos. The projects needed for building the libraries are &lt;br /&gt;
* plplot for the main C interface&lt;br /&gt;
* plplotcxx for the c++ interface&lt;br /&gt;
* plplotwxWidgets for the wxplplotstream and wxplplotwindow objects for use in wxWidget applications&lt;br /&gt;
* qsatime - don&amp;#039;t know what this does&lt;br /&gt;
* csirocsa - don&amp;#039;t know what this does either&lt;br /&gt;
I deleted all projects except for these ones to make life easier. You may want to include the examples or something. Instead of compiling these projects into 5 separate libraries I copied the source files from these projects into the plplot project to complile into one library. I didn&amp;#039;t copy the plplotwxwidgets files accross because I don&amp;#039;t intend to use these classes, but I presume you should be able to do so if you wish.&lt;br /&gt;
&lt;br /&gt;
I had to make some changes to the code to make the library build.&lt;br /&gt;
I had to add&lt;br /&gt;
   #ifdef __cplusplus&lt;br /&gt;
   extern &amp;quot;C&amp;quot; {&lt;br /&gt;
   #endif&lt;br /&gt;
to the beginning and&lt;br /&gt;
   #ifdef __cplusplus&lt;br /&gt;
   }&lt;br /&gt;
   #endif&lt;br /&gt;
to the end of csa.h and qsatime.h. You might also need to go through csa.c and add explicit typecasts to all calls to malloc.&lt;br /&gt;
&lt;br /&gt;
Now you need to go through the project properties to ensure everything is as you want it, eg you are linking against the correct runtime library, the resulting libs are called the correct names and in a folder where you want them, etc.&lt;br /&gt;
&lt;br /&gt;
I then went through a whole world of pain because whenever I tried to link one of my wxWidget projects to my new plplot library the code hung during wxWidgets initialisation. I don&amp;#039;t know the exact cause but the problem is related to the wxwidgets_app.cpp file. I beleive this code allows console apps to generate gui style plots using wxwidgets. I don&amp;#039;t need this functionality so the following terrible hack fixed the issue for me.&lt;br /&gt;
* Remove wxwidgets_app.cpp from the project.&lt;br /&gt;
* This will cause link errors due to missing definitions of wxPLplotFrame and wxPLGetApp().&lt;br /&gt;
* Go through wxwidgets.cpp and comment out all lines containing the above class/function. In some cases you may have to remove a whole try/catch block to do so.&lt;br /&gt;
* Build the library again.&lt;br /&gt;
I am now able to use plplot in my wxwidgets apps. I may have introduced a terrible bug, but providing the sections of code I hacked never get called I hope all should be fine.&lt;br /&gt;
&lt;br /&gt;
You may want to create dlls as well as static libs. If so create a new folder called plplot-5.9.9_sharedlibs and start the process again from scratch using this folder. If you try to create a shared library solution in the same directory as the static library then your config files will be overwritten and your static build will stop working.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Using the latest development version&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
This morning (28th june 2012) I tried for the first time to build the latest development version (Trunk). This went rather smoother than when I tried version 5.9.9. Kudos to the developers for improving things and here are the instructions for using it.&lt;br /&gt;
&lt;br /&gt;
If you wish to use wxWidgets then install it as described above.&lt;br /&gt;
&lt;br /&gt;
If you wish to use AGG and/or FreeType then download and build those libraries.&lt;br /&gt;
&lt;br /&gt;
Install Tortoise SVN and use this to get the PLplot source from the repository. Details are at [[subversion access]]. If you have a preffered method for accessing repositories then you can obviously use this instead.&lt;br /&gt;
&lt;br /&gt;
Install CMake.&lt;br /&gt;
&lt;br /&gt;
As described above, create a working directory for the library, start a cmd prompt and cd to the new directory.&lt;br /&gt;
&lt;br /&gt;
Run the vsvars32.bat file as described above.&lt;br /&gt;
&lt;br /&gt;
Run CMake as described above with suitable options for static linkage and use of wxWidgets/AGG/FreeType.&lt;br /&gt;
&lt;br /&gt;
copy the needed AGG header files into a folder agg2 in your working directory as described above.&lt;br /&gt;
&lt;br /&gt;
Open the .sln file with Visual Studio&lt;br /&gt;
&lt;br /&gt;
In Visual Studio you will see a number of projects. the ones that actually create libraries are&lt;br /&gt;
csirocsa&lt;br /&gt;
plplotcxx&lt;br /&gt;
plplot&lt;br /&gt;
plplotwxwidgets&lt;br /&gt;
qsatime&lt;br /&gt;
You may wish to change settings in these projects. For example you may wish to change the filenames or locations of the generated libraries or if you add the four other libraries as Additional Dependancies to plplot then they should be bundled together allowing you to include PLplot as a single library.&lt;br /&gt;
&lt;br /&gt;
Go to Build and Build Solution. You will find that 3 projects fail. These are create_staging, create_staging_announcement and validate_announcement. I&amp;#039;m not exactly sure what they do (something to do with generating a document of changes maybe?) but they are not required to build your libraries so don&amp;#039;t worry about them. If more projects than this fail then build again - it might be that if you&amp;#039;ve added dependancies the build order means the needed libraries don&amp;#039;t exist yet when a project that needs them is being built.&lt;br /&gt;
&lt;br /&gt;
I haven&amp;#039;t had chance to check if the wxWidgets hanging bug still exists in the trunk build, but I will test that asap and update this file with the results.&lt;/div&gt;</summary>
		<author><name>Philrosenberg</name></author>	</entry>

	<entry>
		<id>http://www.miscdebris.net/plplot_wiki/index.php?title=Configure_PLplot_for_the_Visual_Studio_IDE&amp;diff=2987</id>
		<title>Configure PLplot for the Visual Studio IDE</title>
		<link rel="alternate" type="text/html" href="http://www.miscdebris.net/plplot_wiki/index.php?title=Configure_PLplot_for_the_Visual_Studio_IDE&amp;diff=2987"/>
				<updated>2012-06-28T09:08:02Z</updated>
		
		<summary type="html">&lt;p&gt;Philrosenberg: changed incorrect batch file vsvars.bat&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;CMake allows you to generate Visual Studio solution and project files. &lt;br /&gt;
&lt;br /&gt;
As of version 2.8.2 of CMake, here are a few caveats:&lt;br /&gt;
&lt;br /&gt;
* If you use Intel Fortran, the solution/project files may cause errors when building. These affect only the Fortran libraries and examples. It is due to a small bug in CMake that should be fixed with the next release.&lt;br /&gt;
* For some reason you can not run the examples directly. We have not found out yet what is the matter, but there is a workaround - see below.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Workaround for examples built with Visual Studio&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
* Build the PLplot libraries and examples via the ALL_BUILD project&lt;br /&gt;
* Open a DOS box in the Debug directory for any one of these examples&lt;br /&gt;
* Set the following environment variables:&lt;br /&gt;
&lt;br /&gt;
   set path=&amp;lt;build&amp;gt;\dll\Debug;%PATH% &lt;br /&gt;
   set PLPLOT_DRV_DIR=&amp;lt;build&amp;gt;\drivers    &lt;br /&gt;
   set PLPLOT_LIB=&amp;lt;source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   where: &amp;lt;build&amp;gt; is the directory where PLplot was built&lt;br /&gt;
   and the directory &amp;quot;&amp;lt;source&amp;gt;\data&amp;quot; holds the .pal and .fnt files&lt;br /&gt;
* In this environment you can run the sample program&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Walkthrough building PLPLot with Visual Studio&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Having just been throught this process I thought I&amp;#039;d make sure it was available online for others. I&amp;#039;ve just compiled PLPLot 5.9.9 with wxWidgets 2.8 using Microsoft Visual Studio 2008 Express on a Windows 7 machine. It is a bit of an arduous process but it should work. My reason for wanting to do this is that I have wxWidgets compiled using Visual Studio in various differet configurations (with/without unicode, static/dynamic) and needed PLPlot with matching configurations and similar ease of changing proerties/recompiling. Here are the instructions. If you are not using wxWidgets then you can ignore the wxWidget specific instructions.&lt;br /&gt;
&lt;br /&gt;
If you want to write GUI applications using wxWidgets then you probably already have a working sln file for compiling wxWidgets. If not then download one from wxPack - I found this the most reliable way to get a wxWidgets working on Windows. If you have just installed wxPack then navigate to the install folder and open the sln file. Now Go to Build-&amp;gt;Batch Build, select all and build. I think some projects in the solution depend on others so it might take three or four attempts to get everything to compile. I never got the Universal configurations to compile, but don&amp;#039;t use them so am not worried.&lt;br /&gt;
&lt;br /&gt;
Now, to get antialiased graphics to work with wxWidgets you can use wxWidgets Built in antialiasing using the graphics context or you can use the AGG library. I seem to remember AGG was quite easy to build, so I&amp;#039;ll leave that for you to work out. For Fonts again you have the option of wxWidgets internal or the FreeType library. Again you need to build FreeType if you want it.&lt;br /&gt;
&lt;br /&gt;
If you want to use wxWidgets antialiasing you must recompile wxWidgets. In your wxWidgets directory find all instances of setup.h or setup0.h and set&lt;br /&gt;
   #define wxUSE_GRAPHICS_CONTEXT 1&lt;br /&gt;
while I was at it I also set&lt;br /&gt;
   #define wxUSE_POSTSCRIPT 1&lt;br /&gt;
This isn&amp;#039;t needed for plplot but I thought as I was recompiling anyway I&amp;#039;d add it in. &lt;br /&gt;
&lt;br /&gt;
Now right click the project core, and select properties.&lt;br /&gt;
Under librarian-&amp;gt;General-&amp;gt;Additional dependancies or Linker-&amp;gt;Input additional Dependancies add gdiplus.lib&lt;br /&gt;
&lt;br /&gt;
Now go to Build-&amp;gt;Batch Build and Build all. If you get errors about a manifest then go to Build-&amp;gt; Batch Build and ReBuild all. You may need to do repeated builds to get everything built as above. If you got the manifest error and rebuilt then do additional builds, not rebuilds until everything is built.&lt;br /&gt;
&lt;br /&gt;
Download the PlPlot Source and unzip it. In this example I&amp;#039;ve chosen to unzip to D:\plplot-5.9.9. Make a new directory alongside this, I&amp;#039;ve chosen to call it D:\plplot-5.9.9_staticbuild.&lt;br /&gt;
&lt;br /&gt;
Install Cmake if you don&amp;#039;t already have it.&lt;br /&gt;
&lt;br /&gt;
open a command prompt and enter&lt;br /&gt;
   c:\program files\microsoft visual studio 9.0\common7\tools\vsvars32.bat&lt;br /&gt;
This may be different if you installed visual studio elsewhere, have a different version of visual studio or I guess the 32 may be a 64 on 64 bit machines.&lt;br /&gt;
&lt;br /&gt;
Then &lt;br /&gt;
   d:\&lt;br /&gt;
   cd d:\plplot-5.9.9_staticbuild&lt;br /&gt;
Obviously modify this if you want to build somewhere else&lt;br /&gt;
Now you can use Cmake to generate your visual studio solution/project files. The default command is&lt;br /&gt;
   cmake d:/plplot-5.9.9 -G &amp;quot;Visual Studio 9 2008&amp;quot; -DPL_DOUBLE=ON -DBUILD_SHARED_LIBS=OFF&lt;br /&gt;
This will make your project files with plplot using double precision (in theory) to generate static libraries. There are some other options you might want to add, such as&lt;br /&gt;
   -DENABLE_wxwidgets=ON&lt;br /&gt;
   -DHAVE_AGG=ON&lt;br /&gt;
   -DHAVE_FREETYPE=ON&lt;br /&gt;
   -DLIB_TAG=&amp;quot;s&amp;quot;&lt;br /&gt;
These are pretty self explanitory. The DLIB_TAG option adds s to the end of the project files. I use this to indicate static.&lt;br /&gt;
You can also set SHARED_LIBS to OFF to generate dynamic libraries but I haven&amp;#039;t tried this yet.&lt;br /&gt;
&lt;br /&gt;
After calling Cmake you should have a sln file in your directory and a config.h file with sensible settings. It might be worth checking your config.h file and your plconfig.h file. I had to uncomment the line&lt;br /&gt;
   #define PL_DOUBLE&lt;br /&gt;
despite using the DPL_DOUBLE option&lt;br /&gt;
&lt;br /&gt;
I had to do a bit of shuffling of code to get AGG and freetype to work. I had to copy the contents of my AGG include directory and the agg_font_freetype.h file from my agg folders to d:\plplot5.9.9_staticbuild\agg2&lt;br /&gt;
&lt;br /&gt;
Now open the sln file if you haven&amp;#039;t done so already. The projects you can see in the solution do all sorts of things it seems including copying libraries, reporting errors online and building the demos. The projects needed for building the libraries are &lt;br /&gt;
* plplot for the main C interface&lt;br /&gt;
* plplotcxx for the c++ interface&lt;br /&gt;
* plplotwxWidgets for the wxplplotstream and wxplplotwindow objects for use in wxWidget applications&lt;br /&gt;
* qsatime - don&amp;#039;t know what this does&lt;br /&gt;
* csirocsa - don&amp;#039;t know what this does either&lt;br /&gt;
I deleted all projects except for these ones to make life easier. You may want to include the examples or something. Instead of compiling these projects into 5 separate libraries I copied the source files from these projects into the plplot project to complile into one library. I didn&amp;#039;t copy the plplotwxwidgets files accross because I don&amp;#039;t intend to use these classes, but I presume you should be able to do so if you wish.&lt;br /&gt;
&lt;br /&gt;
I had to make some changes to the code to make the library build.&lt;br /&gt;
I had to add&lt;br /&gt;
   #ifdef __cplusplus&lt;br /&gt;
   extern &amp;quot;C&amp;quot; {&lt;br /&gt;
   #endif&lt;br /&gt;
to the beginning and&lt;br /&gt;
   #ifdef __cplusplus&lt;br /&gt;
   }&lt;br /&gt;
   #endif&lt;br /&gt;
to the end of csa.h and qsatime.h. You might also need to go through csa.c and add explicit typecasts to all calls to malloc.&lt;br /&gt;
&lt;br /&gt;
Now you need to go through the project properties to ensure everything is as you want it, eg you are linking against the correct runtime library, the resulting libs are called the correct names and in a folder where you want them, etc.&lt;br /&gt;
&lt;br /&gt;
I then went through a whole world of pain because whenever I tried to link one of my wxWidget projects to my new plplot library the code hung during wxWidgets initialisation. I don&amp;#039;t know the exact cause but the problem is related to the wxwidgets_app.cpp file. I beleive this code allows console apps to generate gui style plots using wxwidgets. I don&amp;#039;t need this functionality so the following terrible hack fixed the issue for me.&lt;br /&gt;
* Remove wxwidgets_app.cpp from the project.&lt;br /&gt;
* This will cause link errors due to missing definitions of wxPLplotFrame and wxPLGetApp().&lt;br /&gt;
* Go through wxwidgets.cpp and comment out all lines containing the above class/function. In some cases you may have to remove a whole try/catch block to do so.&lt;br /&gt;
* Build the library again.&lt;br /&gt;
I am now able to use plplot in my wxwidgets apps. I may have introduced a terrible bug, but providing the sections of code I hacked never get called I hope all should be fine.&lt;br /&gt;
&lt;br /&gt;
You may want to create dlls as well as static libs. If so create a new folder called plplot-5.9.9_sharedlibs and start the process again from scratch using this folder. If you try to create a shared library solution in the same directory as the static library then your config files will be overwritten and your static build will stop working.&lt;/div&gt;</summary>
		<author><name>Philrosenberg</name></author>	</entry>

	<entry>
		<id>http://www.miscdebris.net/plplot_wiki/index.php?title=Configure_PLplot_for_the_Visual_Studio_IDE&amp;diff=2986</id>
		<title>Configure PLplot for the Visual Studio IDE</title>
		<link rel="alternate" type="text/html" href="http://www.miscdebris.net/plplot_wiki/index.php?title=Configure_PLplot_for_the_Visual_Studio_IDE&amp;diff=2986"/>
				<updated>2012-01-04T12:11:24Z</updated>
		
		<summary type="html">&lt;p&gt;Philrosenberg: Full walkthrough example of compiling plplot 5.9.9 with microsoft visual studio&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;CMake allows you to generate Visual Studio solution and project files. &lt;br /&gt;
&lt;br /&gt;
As of version 2.8.2 of CMake, here are a few caveats:&lt;br /&gt;
&lt;br /&gt;
* If you use Intel Fortran, the solution/project files may cause errors when building. These affect only the Fortran libraries and examples. It is due to a small bug in CMake that should be fixed with the next release.&lt;br /&gt;
* For some reason you can not run the examples directly. We have not found out yet what is the matter, but there is a workaround - see below.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Workaround for examples built with Visual Studio&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
* Build the PLplot libraries and examples via the ALL_BUILD project&lt;br /&gt;
* Open a DOS box in the Debug directory for any one of these examples&lt;br /&gt;
* Set the following environment variables:&lt;br /&gt;
&lt;br /&gt;
   set path=&amp;lt;build&amp;gt;\dll\Debug;%PATH% &lt;br /&gt;
   set PLPLOT_DRV_DIR=&amp;lt;build&amp;gt;\drivers    &lt;br /&gt;
   set PLPLOT_LIB=&amp;lt;source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   where: &amp;lt;build&amp;gt; is the directory where PLplot was built&lt;br /&gt;
   and the directory &amp;quot;&amp;lt;source&amp;gt;\data&amp;quot; holds the .pal and .fnt files&lt;br /&gt;
* In this environment you can run the sample program&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Walkthrough building PLPLot with Visual Studio&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Having just been throught this process I thought I&amp;#039;d make sure it was available online for others. I&amp;#039;ve just compiled PLPLot 5.9.9 with wxWidgets 2.8 using Microsoft Visual Studio 2008 Express on a Windows 7 machine. It is a bit of an arduous process but it should work. My reason for wanting to do this is that I have wxWidgets compiled using Visual Studio in various differet configurations (with/without unicode, static/dynamic) and needed PLPlot with matching configurations and similar ease of changing proerties/recompiling. Here are the instructions. If you are not using wxWidgets then you can ignore the wxWidget specific instructions.&lt;br /&gt;
&lt;br /&gt;
If you want to write GUI applications using wxWidgets then you probably already have a working sln file for compiling wxWidgets. If not then download one from wxPack - I found this the most reliable way to get a wxWidgets working on Windows. If you have just installed wxPack then navigate to the install folder and open the sln file. Now Go to Build-&amp;gt;Batch Build, select all and build. I think some projects in the solution depend on others so it might take three or four attempts to get everything to compile. I never got the Universal configurations to compile, but don&amp;#039;t use them so am not worried.&lt;br /&gt;
&lt;br /&gt;
Now, to get antialiased graphics to work with wxWidgets you can use wxWidgets Built in antialiasing using the graphics context or you can use the AGG library. I seem to remember AGG was quite easy to build, so I&amp;#039;ll leave that for you to work out. For Fonts again you have the option of wxWidgets internal or the FreeType library. Again you need to build FreeType if you want it.&lt;br /&gt;
&lt;br /&gt;
If you want to use wxWidgets antialiasing you must recompile wxWidgets. In your wxWidgets directory find all instances of setup.h or setup0.h and set&lt;br /&gt;
   #define wxUSE_GRAPHICS_CONTEXT 1&lt;br /&gt;
while I was at it I also set&lt;br /&gt;
   #define wxUSE_POSTSCRIPT 1&lt;br /&gt;
This isn&amp;#039;t needed for plplot but I thought as I was recompiling anyway I&amp;#039;d add it in. &lt;br /&gt;
&lt;br /&gt;
Now right click the project core, and select properties.&lt;br /&gt;
Under librarian-&amp;gt;General-&amp;gt;Additional dependancies or Linker-&amp;gt;Input additional Dependancies add gdiplus.lib&lt;br /&gt;
&lt;br /&gt;
Now go to Build-&amp;gt;Batch Build and Build all. If you get errors about a manifest then go to Build-&amp;gt; Batch Build and ReBuild all. You may need to do repeated builds to get everything built as above. If you got the manifest error and rebuilt then do additional builds, not rebuilds until everything is built.&lt;br /&gt;
&lt;br /&gt;
Download the PlPlot Source and unzip it. In this example I&amp;#039;ve chosen to unzip to D:\plplot-5.9.9. Make a new directory alongside this, I&amp;#039;ve chosen to call it D:\plplot-5.9.9_staticbuild.&lt;br /&gt;
&lt;br /&gt;
Install Cmake if you don&amp;#039;t already have it.&lt;br /&gt;
&lt;br /&gt;
open a command prompt and enter&lt;br /&gt;
   c:\program files\microsoft visual studio 9.0\common7\tools\vcvars32.bat&lt;br /&gt;
This may be different if you installed visual studio elsewhere, have a different version of visual studio or I guess the 32 may be a 64 on 64 bit machines.&lt;br /&gt;
&lt;br /&gt;
Then &lt;br /&gt;
   d:\&lt;br /&gt;
   cd d:\plplot-5.9.9_staticbuild&lt;br /&gt;
Obviously modify this if you want to build somewhere else&lt;br /&gt;
Now you can use Cmake to generate your visual studio solution/project files. The default command is&lt;br /&gt;
   cmake d:/plplot-5.9.9 -G &amp;quot;Visual Studio 9 2008&amp;quot; -DPL_DOUBLE=ON -DBUILD_SHARED_LIBS=OFF&lt;br /&gt;
This will make your project files with plplot using double precision (in theory) to generate static libraries. There are some other options you might want to add, such as&lt;br /&gt;
   -DENABLE_wxwidgets=ON&lt;br /&gt;
   -DHAVE_AGG=ON&lt;br /&gt;
   -DHAVE_FREETYPE=ON&lt;br /&gt;
   -DLIB_TAG=&amp;quot;s&amp;quot;&lt;br /&gt;
These are pretty self explanitory. The DLIB_TAG option adds s to the end of the project files. I use this to indicate static.&lt;br /&gt;
You can also set SHARED_LIBS to OFF to generate dynamic libraries but I haven&amp;#039;t tried this yet.&lt;br /&gt;
&lt;br /&gt;
After calling Cmake you should have a sln file in your directory and a config.h file with sensible settings. It might be worth checking your config.h file and your plconfig.h file. I had to uncomment the line&lt;br /&gt;
   #define PL_DOUBLE&lt;br /&gt;
despite using the DPL_DOUBLE option&lt;br /&gt;
&lt;br /&gt;
I had to do a bit of shuffling of code to get AGG and freetype to work. I had to copy the contents of my AGG include directory and the agg_font_freetype.h file from my agg folders to d:\plplot5.9.9_staticbuild\agg2&lt;br /&gt;
&lt;br /&gt;
Now open the sln file if you haven&amp;#039;t done so already. The projects you can see in the solution do all sorts of things it seems including copying libraries, reporting errors online and building the demos. The projects needed for building the libraries are &lt;br /&gt;
* plplot for the main C interface&lt;br /&gt;
* plplotcxx for the c++ interface&lt;br /&gt;
* plplotwxWidgets for the wxplplotstream and wxplplotwindow objects for use in wxWidget applications&lt;br /&gt;
* qsatime - don&amp;#039;t know what this does&lt;br /&gt;
* csirocsa - don&amp;#039;t know what this does either&lt;br /&gt;
I deleted all projects except for these ones to make life easier. You may want to include the examples or something. Instead of compiling these projects into 5 separate libraries I copied the source files from these projects into the plplot project to complile into one library. I didn&amp;#039;t copy the plplotwxwidgets files accross because I don&amp;#039;t intend to use these classes, but I presume you should be able to do so if you wish.&lt;br /&gt;
&lt;br /&gt;
I had to make some changes to the code to make the library build.&lt;br /&gt;
I had to add&lt;br /&gt;
   #ifdef __cplusplus&lt;br /&gt;
   extern &amp;quot;C&amp;quot; {&lt;br /&gt;
   #endif&lt;br /&gt;
to the beginning and&lt;br /&gt;
   #ifdef __cplusplus&lt;br /&gt;
   }&lt;br /&gt;
   #endif&lt;br /&gt;
to the end of csa.h and qsatime.h. You might also need to go through csa.c and add explicit typecasts to all calls to malloc.&lt;br /&gt;
&lt;br /&gt;
Now you need to go through the project properties to ensure everything is as you want it, eg you are linking against the correct runtime library, the resulting libs are called the correct names and in a folder where you want them, etc.&lt;br /&gt;
&lt;br /&gt;
I then went through a whole world of pain because whenever I tried to link one of my wxWidget projects to my new plplot library the code hung during wxWidgets initialisation. I don&amp;#039;t know the exact cause but the problem is related to the wxwidgets_app.cpp file. I beleive this code allows console apps to generate gui style plots using wxwidgets. I don&amp;#039;t need this functionality so the following terrible hack fixed the issue for me.&lt;br /&gt;
* Remove wxwidgets_app.cpp from the project.&lt;br /&gt;
* This will cause link errors due to missing definitions of wxPLplotFrame and wxPLGetApp().&lt;br /&gt;
* Go through wxwidgets.cpp and comment out all lines containing the above class/function. In some cases you may have to remove a whole try/catch block to do so.&lt;br /&gt;
* Build the library again.&lt;br /&gt;
I am now able to use plplot in my wxwidgets apps. I may have introduced a terrible bug, but providing the sections of code I hacked never get called I hope all should be fine.&lt;br /&gt;
&lt;br /&gt;
You may want to create dlls as well as static libs. If so create a new folder called plplot-5.9.9_sharedlibs and start the process again from scratch using this folder. If you try to create a shared library solution in the same directory as the static library then your config files will be overwritten and your static build will stop working.&lt;/div&gt;</summary>
		<author><name>Philrosenberg</name></author>	</entry>

	<entry>
		<id>http://www.miscdebris.net/plplot_wiki/index.php?title=Configure_PLplot_for_Visual_CXX_CLI&amp;diff=2261</id>
		<title>Configure PLplot for Visual CXX CLI</title>
		<link rel="alternate" type="text/html" href="http://www.miscdebris.net/plplot_wiki/index.php?title=Configure_PLplot_for_Visual_CXX_CLI&amp;diff=2261"/>
				<updated>2010-05-15T18:14:21Z</updated>
		
		<summary type="html">&lt;p&gt;Philrosenberg: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;You need a working Visual C++ and CMake installation. You should also ensure the following directories are included in your Path variable:&lt;br /&gt;
 &amp;lt;CMake install directory&amp;gt;\bin&lt;br /&gt;
 &amp;lt;MSVC++ install directory&amp;gt;\VC&lt;br /&gt;
 &amp;lt;MSVC++ install directory&amp;gt;\VC\bin&lt;br /&gt;
&lt;br /&gt;
Copy the following commands into a text editor, add the correct directory on the first line and save as a batch file. Start the command line interface and execute the batch file. Of course, if you need, you can issue the commands directly from the command line.&lt;br /&gt;
&lt;br /&gt;
The following commands will work if you are not using wxWidgets. A wxWidgets specific list af commands is below.&lt;br /&gt;
&lt;br /&gt;
 set PLWIN=&amp;lt;directory you extracted the source code to&amp;gt;&lt;br /&gt;
 cd %PLWIN%&lt;br /&gt;
 call vcvarsall&lt;br /&gt;
 mkdir buildnmake&lt;br /&gt;
 cd buildnmake&lt;br /&gt;
 set PATH=PLWIN\buildnmake\dll;%PATH%&lt;br /&gt;
 cmake -G &amp;quot;NMake Makefiles&amp;quot; -DCMAKE_INSTALL_PREFIX=install .. -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON&lt;br /&gt;
 nmake&lt;br /&gt;
 nmake install&lt;br /&gt;
 rename install\bin\plplotcxxd.dll plplotcxx.dll&lt;br /&gt;
 rename install\bin\plplotd.dll plplot.dll&lt;br /&gt;
 rename install\lib\plplotcxxd.lib plplotcxx.lib&lt;br /&gt;
 rename install\lib\plplotd.lib plplot.lib&lt;br /&gt;
 cmake -G &amp;quot;NMake Makefiles&amp;quot; -DCMAKE_INSTALL_PREFIX=install .. -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF&lt;br /&gt;
 nmake&lt;br /&gt;
 nmake install&lt;br /&gt;
 rename install\lib\plplotcxxd.lib plplotcxxs.lib&lt;br /&gt;
 rename install\lib\plplotd.lib plplots.lib&lt;br /&gt;
 cmake -G &amp;quot;NMake Makefiles&amp;quot; -DCMAKE_INSTALL_PREFIX=install .. -DCMAKE_BUILD_TYPE=Debug -DBUILD_SHARED_LIBS=OFF&lt;br /&gt;
 nmake&lt;br /&gt;
 nmake install&lt;br /&gt;
 rename install\lib\plplotcxxd.lib plplotcxxsd.lib&lt;br /&gt;
 rename install\lib\plplotd.lib plplotsd.lib&lt;br /&gt;
 cmake -G &amp;quot;NMake Makefiles&amp;quot; -DCMAKE_INSTALL_PREFIX=install .. -DCMAKE_BUILD_TYPE=Debug -DBUILD_SHARED_LIBS=ON&lt;br /&gt;
 nmake&lt;br /&gt;
 nmake install&lt;br /&gt;
&lt;br /&gt;
If you are using wxWidgets then the following commands provide the basics of what is needed. However, depending upon how you built wxWidgets you may need to specify additional parameters to the cmake call. Check [[Configuration of wxWidgets driver]] for more details. For some unknown reason I could not get the shared release version of PLplot to built before the shared debug version. Unfortunately building them the other way round causes the debug version to be overwritten. The easiest solution is to run your batch file twice. The second run allows all libraries to be built.&lt;br /&gt;
&lt;br /&gt;
 set PLWIN=&amp;lt;directory you extracted the source code to&amp;gt;&lt;br /&gt;
 set WXWINDLL=%WXWIN%\lib\vc_lib&lt;br /&gt;
 cd %PLWIN%&lt;br /&gt;
 call vcvarsall&lt;br /&gt;
 mkdir buildnmake&lt;br /&gt;
 cd buildnmake&lt;br /&gt;
 set PATH=PLWIN\buildnmake\dll;%PATH%&lt;br /&gt;
 cmake -G &amp;quot;NMake Makefiles&amp;quot; -DCMAKE_INSTALL_PREFIX=install .. -DwxWidgets_LIB_DIR=%WXWINDLL% -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON&lt;br /&gt;
 nmake&lt;br /&gt;
 nmake install&lt;br /&gt;
 rename install\bin\plplotcxxd.dll plplotcxx.dll&lt;br /&gt;
 rename install\bin\plplotd.dll plplot.dll&lt;br /&gt;
 rename install\bin\plplotwxwidgetsd.dll plplotwxwidgets.dll&lt;br /&gt;
 rename install\lib\plplotcxxd.lib plplotcxx.lib&lt;br /&gt;
 rename install\lib\plplotd.lib plplot.lib&lt;br /&gt;
 rename install\lib\plplotwxwidgetsd.lib plplotwxwidgets.lib&lt;br /&gt;
 cmake -G &amp;quot;NMake Makefiles&amp;quot; -DCMAKE_INSTALL_PREFIX=install .. -DwxWidgets_LIB_DIR=%WXWINDLL% -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF&lt;br /&gt;
 nmake&lt;br /&gt;
 nmake install&lt;br /&gt;
 rename install\lib\plplotcxxd.lib plplotcxxs.lib&lt;br /&gt;
 rename install\lib\plplotd.lib plplots.lib&lt;br /&gt;
 rename install\lib\plplotwxwidgetsd.lib plplotwxwidgetss.lib&lt;br /&gt;
 cmake -G &amp;quot;NMake Makefiles&amp;quot; -DCMAKE_INSTALL_PREFIX=install .. -DwxWidgets_LIB_DIR=%WXWINDLL% -DCMAKE_BUILD_TYPE=Debug -DBUILD_SHARED_LIBS=OFF&lt;br /&gt;
 nmake&lt;br /&gt;
 nmake install&lt;br /&gt;
 rename install\lib\plplotcxxd.lib plplotcxxsd.lib&lt;br /&gt;
 rename install\lib\plplotd.lib plplotsd.lib&lt;br /&gt;
 rename install\lib\plplotwxwidgetsd.lib plplotwxwidgetssd.lib&lt;br /&gt;
 cmake -G &amp;quot;NMake Makefiles&amp;quot; -DCMAKE_INSTALL_PREFIX=install .. -DwxWidgets_LIB_DIR=%WXWINDLL% -DCMAKE_BUILD_TYPE=Debug -DBUILD_SHARED_LIBS=ON&lt;br /&gt;
 nmake&lt;br /&gt;
 nmake install&lt;br /&gt;
&lt;br /&gt;
The commands above will build shared and static debug and release versions of the plplot library and install all files into the directory &amp;lt;tt&amp;gt;plplot\buildnmake\install&amp;lt;/tt&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
For those who are not familiar with NMake and CMake here is an explanation of what we have just done. Nmake is a command line compiler included with Microsoft VC++ which can be used to build from source. Instead of project files it uses make files. To avoid creating make files for multiple compilers plplot includes CMake files. These are interpreted by CMake, along with the variables specified on the command line, to generate make files for many different compilers. So, in order, we performed the following actions:&lt;br /&gt;
&lt;br /&gt;
 Set up needed paths including MSVC++ paths using vcvarsall&lt;br /&gt;
 Called CMake to generate make files for static/share and release/debug builds&lt;br /&gt;
 Called Nmake to build PlPlot&lt;br /&gt;
 Called Nmake install to move the libraries and header files to the install folder&lt;br /&gt;
 Renamed the libraries with sensible postfixes to indicate static and debug versions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note&amp;#039;&amp;#039;&amp;#039;: during the build the various DLLs are put in the subdirectory &amp;quot;dll&amp;quot; under the build directory. It is important that this directory is contained in the path during the build if you use the dynamic drivers facility as otherwise calls to get-drv-info will fail and the drivers won&amp;#039;t be installed successfully. In addition, if you use wxWidgets driver you also must ensure that the wxWidgets DLL itself is in the path as well.&lt;br /&gt;
 &lt;br /&gt;
Alternatively you can use the GUI version of CMake, an easy-to-use user-interface that presents the available build options&lt;br /&gt;
and lets you set them. It is mostly a matter of taste, but:&lt;br /&gt;
* The GUI version provides an overview of the build opions that are available&lt;br /&gt;
* The command-line version is particularly useful if you are experimenting with these options, as it can be run from a batchfile&lt;br /&gt;
&lt;br /&gt;
Some of the options that are available for cmake:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;-DCMAKE_VERBOSE_MAKEFILE=ON&amp;lt;/tt&amp;gt;: makefiles provide verbose informations&lt;br /&gt;
* &amp;lt;tt&amp;gt;-DBUILD_TEST=ON&amp;lt;/tt&amp;gt;: all examples will be built also (for test purposes)&lt;br /&gt;
* [[Configuration of wxWidgets driver]]&lt;br /&gt;
&lt;br /&gt;
If you used the &amp;lt;tt&amp;gt;-DBUILD_TEST=ON&amp;lt;/tt&amp;gt; option, you need to copy some files in order to run the examples:&lt;br /&gt;
&lt;br /&gt;
 cd examples\c&lt;br /&gt;
 copy ..\..\..\data\*.fnt .&lt;br /&gt;
&lt;br /&gt;
and additionally some dlls for a shared plplot built:&lt;br /&gt;
&lt;br /&gt;
 copy ..\..\dll\plplotd.dll .&lt;br /&gt;
 copy ..\..\dll\plplotcxxd.dll . (for c++ examples)&lt;br /&gt;
 copy ..\..\dll\csirocsa.dll . (if library was built)&lt;br /&gt;
&lt;br /&gt;
and for the wxWidgets driver (if wxWidgets library is shared):&lt;br /&gt;
&lt;br /&gt;
 copy %WXWIN%\lib\gcc_dll\wxmsw26d_vc_custom.dll .&lt;br /&gt;
&lt;br /&gt;
if this dll is not in the path.&lt;/div&gt;</summary>
		<author><name>Philrosenberg</name></author>	</entry>

	<entry>
		<id>http://www.miscdebris.net/plplot_wiki/index.php?title=Configure_PLplot_for_Visual_CXX_CLI&amp;diff=2260</id>
		<title>Configure PLplot for Visual CXX CLI</title>
		<link rel="alternate" type="text/html" href="http://www.miscdebris.net/plplot_wiki/index.php?title=Configure_PLplot_for_Visual_CXX_CLI&amp;diff=2260"/>
				<updated>2010-05-15T18:10:35Z</updated>
		
		<summary type="html">&lt;p&gt;Philrosenberg: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;You need a working Visual C++ and CMake installation. You should also ensure the following directories are included in your Path variable:&lt;br /&gt;
 &amp;lt;CMake install directory&amp;gt;\bin&lt;br /&gt;
 &amp;lt;MSVC++ install directory&amp;gt;\VC&lt;br /&gt;
 &amp;lt;MSVC++ install directory&amp;gt;\VC\bin&lt;br /&gt;
&lt;br /&gt;
Copy the following commands into a text editor, add the correct directory on the first line and save as a batch file. Start the command line interface and execute the batch file. Of course, if you need, you can issue the commands directly from the command line.&lt;br /&gt;
&lt;br /&gt;
The following commands will work if you are not using wxWidgets. A wxWidgets specific list af commands is below.&lt;br /&gt;
&lt;br /&gt;
 set PLWIN=&amp;lt;directory you extracted the source code to&amp;gt;&lt;br /&gt;
 cd %PLWIN%&lt;br /&gt;
 call vcvarsall&lt;br /&gt;
 mkdir buildnmake&lt;br /&gt;
 cd buildnmake&lt;br /&gt;
 set PATH=PLWIN\buildnmake\dll;%PATH%&lt;br /&gt;
 cmake -G &amp;quot;NMake Makefiles&amp;quot; -DCMAKE_INSTALL_PREFIX=install .. -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON&lt;br /&gt;
 nmake&lt;br /&gt;
 nmake install&lt;br /&gt;
 rename install\bin\plplotcxxd.dll plplotcxx.dll&lt;br /&gt;
 rename install\bin\plplotd.dll plplot.dll&lt;br /&gt;
 rename install\lib\plplotcxxd.lib plplotcxx.lib&lt;br /&gt;
 rename install\lib\plplotd.lib plplot.lib&lt;br /&gt;
 cmake -G &amp;quot;NMake Makefiles&amp;quot; -DCMAKE_INSTALL_PREFIX=install .. -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF&lt;br /&gt;
 nmake&lt;br /&gt;
 nmake install&lt;br /&gt;
 rename install\lib\plplotcxxd.lib plplotcxxs.lib&lt;br /&gt;
 rename install\lib\plplotd.lib plplots.lib&lt;br /&gt;
 cmake -G &amp;quot;NMake Makefiles&amp;quot; -DCMAKE_INSTALL_PREFIX=install .. -DCMAKE_BUILD_TYPE=Debug -DBUILD_SHARED_LIBS=OFF&lt;br /&gt;
 nmake&lt;br /&gt;
 nmake install&lt;br /&gt;
 rename install\lib\plplotcxxd.lib plplotcxxsd.lib&lt;br /&gt;
 rename install\lib\plplotd.lib plplotsd.lib&lt;br /&gt;
 cmake -G &amp;quot;NMake Makefiles&amp;quot; -DCMAKE_INSTALL_PREFIX=install .. -DCMAKE_BUILD_TYPE=Debug -DBUILD_SHARED_LIBS=ON&lt;br /&gt;
 nmake&lt;br /&gt;
 nmake install&lt;br /&gt;
&lt;br /&gt;
If you are using wxWidgets then the following commands provide the basics of what is needed. However, depending upon how you built wxWidgets you may need to specify additional parameters to the cmake call. Check [[Configuration of wxWidgets driver]] for more details. For some unknown reason I could not get the shared release version of PLplot to built before the shared debug version. Unfortunately building them the other way round causes the debug version to be overwritten. The aesiest solution is to run your batch file twice. The second run allows all libraries to be built.&lt;br /&gt;
&lt;br /&gt;
 set PLWIN=&amp;lt;directory you extracted the source code to&amp;gt;&lt;br /&gt;
 set WXWINDLL=%WXWIN%\lib\vc_lib&lt;br /&gt;
 cd %PLWIN%&lt;br /&gt;
 call vcvarsall&lt;br /&gt;
 mkdir buildnmake&lt;br /&gt;
 cd buildnmake&lt;br /&gt;
 set PATH=PLWIN\buildnmake\dll;%PATH%&lt;br /&gt;
 cmake -G &amp;quot;NMake Makefiles&amp;quot; -DCMAKE_INSTALL_PREFIX=install .. -DwxWidgets_LIB_DIR=%WXWINDLL% -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON&lt;br /&gt;
 nmake&lt;br /&gt;
 nmake install&lt;br /&gt;
 rename install\bin\plplotcxxd.dll plplotcxx.dll&lt;br /&gt;
 rename install\bin\plplotd.dll plplot.dll&lt;br /&gt;
 rename install\bin\plplotwxwidgetsd.dll plplotwxwidgets.dll&lt;br /&gt;
 rename install\lib\plplotcxxd.lib plplotcxx.lib&lt;br /&gt;
 rename install\lib\plplotd.lib plplot.lib&lt;br /&gt;
 rename install\lib\plplotwxwidgetsd.lib plplotwxwidgets.lib&lt;br /&gt;
 cmake -G &amp;quot;NMake Makefiles&amp;quot; -DCMAKE_INSTALL_PREFIX=install .. -DwxWidgets_LIB_DIR=%WXWINDLL% -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF&lt;br /&gt;
 nmake&lt;br /&gt;
 nmake install&lt;br /&gt;
 rename install\lib\plplotcxxd.lib plplotcxxs.lib&lt;br /&gt;
 rename install\lib\plplotd.lib plplots.lib&lt;br /&gt;
 rename install\lib\plplotwxwidgetsd.lib plplotwxwidgetss.lib&lt;br /&gt;
 cmake -G &amp;quot;NMake Makefiles&amp;quot; -DCMAKE_INSTALL_PREFIX=install .. -DwxWidgets_LIB_DIR=%WXWINDLL% -DCMAKE_BUILD_TYPE=Debug -DBUILD_SHARED_LIBS=OFF&lt;br /&gt;
 nmake&lt;br /&gt;
 nmake install&lt;br /&gt;
 rename install\lib\plplotcxxd.lib plplotcxxsd.lib&lt;br /&gt;
 rename install\lib\plplotd.lib plplotsd.lib&lt;br /&gt;
 rename install\lib\plplotwxwidgetsd.lib plplotwxwidgetssd.lib&lt;br /&gt;
 cmake -G &amp;quot;NMake Makefiles&amp;quot; -DCMAKE_INSTALL_PREFIX=install .. -DwxWidgets_LIB_DIR=%WXWINDLL% -DCMAKE_BUILD_TYPE=Debug -DBUILD_SHARED_LIBS=ON&lt;br /&gt;
 nmake&lt;br /&gt;
 nmake install&lt;br /&gt;
&lt;br /&gt;
The commands above will build shared and static debug and release versions of the plplot library and install all files into the directory &amp;lt;tt&amp;gt;plplot\buildnmake\install&amp;lt;/tt&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
For those who are not familiar with NMake and CMake here is an explanation of what we have just done. Nmake is a command line compiler included with Microsoft VC++ which can be used to build from source. Instead of project files it uses make files. To avoid creating make files for multiple compilers plplot includes CMake files. These are interpreted by CMake, along with the variables specified on the command line, to generate make files for many different compilers. So, in order, we performed the following actions:&lt;br /&gt;
&lt;br /&gt;
 Set up needed paths including MSVC++ paths using vcvarsall&lt;br /&gt;
 Called CMake to generate make files for static/share and release/debug builds&lt;br /&gt;
 Called Nmake to build PlPlot&lt;br /&gt;
 Called Nmake install to move the libraries and header files to the install folder&lt;br /&gt;
 Renamed the libraries with sensible postfixes to indicate static and debug versions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note&amp;#039;&amp;#039;&amp;#039;: during the build the various DLLs are put in the subdirectory &amp;quot;dll&amp;quot; under the build directory. It is important that this directory is contained in the path during the build if you use the dynamic drivers facility as otherwise calls to get-drv-info will fail and the drivers won&amp;#039;t be installed successfully. In addition, if you use wxWidgets driver you also must ensure that the wxWidgets DLL itself is in the path as well.&lt;br /&gt;
 &lt;br /&gt;
Alternatively you can use the GUI version of CMake, an easy-to-use user-interface that presents the available build options&lt;br /&gt;
and lets you set them. It is mostly a matter of taste, but:&lt;br /&gt;
* The GUI version provides an overview of the build opions that are available&lt;br /&gt;
* The command-line version is particularly useful if you are experimenting with these options, as it can be run from a batchfile&lt;br /&gt;
&lt;br /&gt;
Some of the options that are available for cmake:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;-DCMAKE_VERBOSE_MAKEFILE=ON&amp;lt;/tt&amp;gt;: makefiles provide verbose informations&lt;br /&gt;
* &amp;lt;tt&amp;gt;-DBUILD_TEST=ON&amp;lt;/tt&amp;gt;: all examples will be built also (for test purposes)&lt;br /&gt;
* [[Configuration of wxWidgets driver]]&lt;br /&gt;
&lt;br /&gt;
If you used the &amp;lt;tt&amp;gt;-DBUILD_TEST=ON&amp;lt;/tt&amp;gt; option, you need to copy some files in order to run the examples:&lt;br /&gt;
&lt;br /&gt;
 cd examples\c&lt;br /&gt;
 copy ..\..\..\data\*.fnt .&lt;br /&gt;
&lt;br /&gt;
and additionally some dlls for a shared plplot built:&lt;br /&gt;
&lt;br /&gt;
 copy ..\..\dll\plplotd.dll .&lt;br /&gt;
 copy ..\..\dll\plplotcxxd.dll . (for c++ examples)&lt;br /&gt;
 copy ..\..\dll\csirocsa.dll . (if library was built)&lt;br /&gt;
&lt;br /&gt;
and for the wxWidgets driver (if wxWidgets library is shared):&lt;br /&gt;
&lt;br /&gt;
 copy %WXWIN%\lib\gcc_dll\wxmsw26d_vc_custom.dll .&lt;br /&gt;
&lt;br /&gt;
if this dll is not in the path.&lt;/div&gt;</summary>
		<author><name>Philrosenberg</name></author>	</entry>

	<entry>
		<id>http://www.miscdebris.net/plplot_wiki/index.php?title=Configure_PLplot_for_Visual_CXX_CLI&amp;diff=2259</id>
		<title>Configure PLplot for Visual CXX CLI</title>
		<link rel="alternate" type="text/html" href="http://www.miscdebris.net/plplot_wiki/index.php?title=Configure_PLplot_for_Visual_CXX_CLI&amp;diff=2259"/>
				<updated>2010-05-15T17:59:28Z</updated>
		
		<summary type="html">&lt;p&gt;Philrosenberg: added details for building with wxwidgets&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;You need a working Visual C++ and CMake installation. You should also ensure the following directories are included in your Path variable:&lt;br /&gt;
 &amp;lt;CMake install directory&amp;gt;\bin&lt;br /&gt;
 &amp;lt;MSVC++ install directory&amp;gt;\VC&lt;br /&gt;
 &amp;lt;MSVC++ install directory&amp;gt;\VC\bin&lt;br /&gt;
&lt;br /&gt;
Copy the following commands into a text editor, add the correct directory on the first line and save as a batch file. Start the command line interface and execute the batch file. Of course, if you need, you can issue the commands directly from the command line.&lt;br /&gt;
&lt;br /&gt;
The following commands will work if you are not using wxWidgets. A wxWidgets specific list af commands is below.&lt;br /&gt;
&lt;br /&gt;
 set PLWIN=&amp;lt;directory you extracted the source code to&amp;gt;&lt;br /&gt;
 cd %PLWIN%&lt;br /&gt;
 call vcvarsall&lt;br /&gt;
 mkdir buildnmake&lt;br /&gt;
 cd buildnmake&lt;br /&gt;
 set PATH=PLWIN\buildnmake\dll;%PATH%&lt;br /&gt;
 cmake -G &amp;quot;NMake Makefiles&amp;quot; -DCMAKE_INSTALL_PREFIX=install .. -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON&lt;br /&gt;
 nmake&lt;br /&gt;
 nmake install&lt;br /&gt;
 rename install\bin\plplotcxxd.dll plplotcxx.dll&lt;br /&gt;
 rename install\bin\plplotd.dll plplot.dll&lt;br /&gt;
 rename install\lib\plplotcxxd.lib plplotcxx.lib&lt;br /&gt;
 rename install\lib\plplotd.lib plplot.lib&lt;br /&gt;
 cmake -G &amp;quot;NMake Makefiles&amp;quot; -DCMAKE_INSTALL_PREFIX=install .. -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF&lt;br /&gt;
 nmake&lt;br /&gt;
 nmake install&lt;br /&gt;
 rename install\lib\plplotcxxd.lib plplotcxxs.lib&lt;br /&gt;
 rename install\lib\plplotd.lib plplots.lib&lt;br /&gt;
 cmake -G &amp;quot;NMake Makefiles&amp;quot; -DCMAKE_INSTALL_PREFIX=install .. -DCMAKE_BUILD_TYPE=Debug -DBUILD_SHARED_LIBS=OFF&lt;br /&gt;
 nmake&lt;br /&gt;
 nmake install&lt;br /&gt;
 rename install\lib\plplotcxxd.lib plplotcxxsd.lib&lt;br /&gt;
 rename install\lib\plplotd.lib plplotsd.lib&lt;br /&gt;
 cmake -G &amp;quot;NMake Makefiles&amp;quot; -DCMAKE_INSTALL_PREFIX=install .. -DCMAKE_BUILD_TYPE=Debug -DBUILD_SHARED_LIBS=ON&lt;br /&gt;
 nmake&lt;br /&gt;
 nmake install&lt;br /&gt;
&lt;br /&gt;
If you are using wxWidgets then the following commands provide the basics of what is needed. However, depending upon how you built wxWidgets you may need to specify additional parameters to the cmake call. Check [[Configuration of wxWidgets driver]] for more details.&lt;br /&gt;
&lt;br /&gt;
 set PLWIN=&amp;lt;directory you extracted the source code to&amp;gt;&lt;br /&gt;
 set WXWINDLL=%WXWIN%\lib\vc_lib&lt;br /&gt;
 cd %PLWIN%&lt;br /&gt;
 call vcvarsall&lt;br /&gt;
 mkdir buildnmake&lt;br /&gt;
 cd buildnmake&lt;br /&gt;
 set PATH=PLWIN\buildnmake\dll;%PATH%&lt;br /&gt;
 cmake -G &amp;quot;NMake Makefiles&amp;quot; -DCMAKE_INSTALL_PREFIX=install .. -DwxWidgets_LIB_DIR=%WXWINDLL% -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON&lt;br /&gt;
 nmake&lt;br /&gt;
 namake install&lt;br /&gt;
 rename install\bin\plplotcxxd.dll plplotcxx.dll&lt;br /&gt;
 rename install\bin\plplotd.dll plplot.dll&lt;br /&gt;
 rename install\bin\plplotwxwidgetsd.dll plplotwxwidgets.dll&lt;br /&gt;
 rename install\lib\plplotcxxd.lib plplotcxx.lib&lt;br /&gt;
 rename install\lib\plplotd.lib plplot.lib&lt;br /&gt;
 rename install\lib\plplotwxwidgetsd.lib plplotwxwidgets.lib&lt;br /&gt;
 cmake -G &amp;quot;NMake Makefiles&amp;quot; -DCMAKE_INSTALL_PREFIX=install .. -DwxWidgets_LIB_DIR=%WXWINDLL% -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF&lt;br /&gt;
 nmake&lt;br /&gt;
 nmake install&lt;br /&gt;
 rename install\lib\plplotcxxd.lib plplotcxxs.lib&lt;br /&gt;
 rename install\lib\plplotd.lib plplots.lib&lt;br /&gt;
 rename install\lib\plplotwxwidgetsd.lib plplotwxwidgetss.lib&lt;br /&gt;
 cmake -G &amp;quot;NMake Makefiles&amp;quot; -DCMAKE_INSTALL_PREFIX=install .. -DwxWidgets_LIB_DIR=%WXWINDLL% -DCMAKE_BUILD_TYPE=Debug -DBUILD_SHARED_LIBS=OFF&lt;br /&gt;
 nmake&lt;br /&gt;
 nmake install&lt;br /&gt;
 rename install\lib\plplotcxxd.lib plplotcxxsd.lib&lt;br /&gt;
 rename install\lib\plplotd.lib plplotsd.lib&lt;br /&gt;
 rename install\lib\plplotwxwidgetsd.lib plplotwxwidgetssd.lib&lt;br /&gt;
 cmake -G &amp;quot;NMake Makefiles&amp;quot; -DCMAKE_INSTALL_PREFIX=install .. -DwxWidgets_LIB_DIR=%WXWINDLL% -DCMAKE_BUILD_TYPE=Debug -DBUILD_SHARED_LIBS=ON&lt;br /&gt;
 nmake&lt;br /&gt;
 nmake install&lt;br /&gt;
&lt;br /&gt;
The commands above will build shared and static debug and release versions of the plplot library and install all files into the directory &amp;lt;tt&amp;gt;plplot\buildnmake\install&amp;lt;/tt&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
For those who are not familiar with NMake and CMake here is an explanation of what we have just done. Nmake is a command line compiler included with Microsoft VC++ which can be used to build from source. Instead of project files it uses make files. To avoid creating make files for multiple compilers plplot includes CMake files. These are interpreted by CMake, along with the variables specified on the command line, to generate make files for many different compilers. So, in order, we performed the following actions:&lt;br /&gt;
&lt;br /&gt;
 Set up needed paths including MSVC++ paths using vcvarsall&lt;br /&gt;
 Called CMake to generate make files for static/share and release/debug builds&lt;br /&gt;
 Called Nmake to build PlPlot&lt;br /&gt;
 Called Nmake install to move the libraries and header files to the install folder&lt;br /&gt;
 Renamed the libraries with sensible postfixes to indicate static and debug versions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note&amp;#039;&amp;#039;&amp;#039;: during the build the various DLLs are put in the subdirectory &amp;quot;dll&amp;quot; under the build directory. It is important that this directory is contained in the path during the build if you use the dynamic drivers facility as otherwise calls to get-drv-info will fail and the drivers won&amp;#039;t be installed successfully. In addition, if you use wxWidgets driver you also must ensure that the wxWidgets DLL itself is in the path as well.&lt;br /&gt;
 &lt;br /&gt;
Alternatively you can use the GUI version of CMake, an easy-to-use user-interface that presents the available build options&lt;br /&gt;
and lets you set them. It is mostly a matter of taste, but:&lt;br /&gt;
* The GUI version provides an overview of the build opions that are available&lt;br /&gt;
* The command-line version is particularly useful if you are experimenting with these options, as it can be run from a batchfile&lt;br /&gt;
&lt;br /&gt;
Some of the options that are available for cmake:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;-DCMAKE_VERBOSE_MAKEFILE=ON&amp;lt;/tt&amp;gt;: makefiles provide verbose informations&lt;br /&gt;
* &amp;lt;tt&amp;gt;-DBUILD_TEST=ON&amp;lt;/tt&amp;gt;: all examples will be built also (for test purposes)&lt;br /&gt;
* [[Configuration of wxWidgets driver]]&lt;br /&gt;
&lt;br /&gt;
If you used the &amp;lt;tt&amp;gt;-DBUILD_TEST=ON&amp;lt;/tt&amp;gt; option, you need to copy some files in order to run the examples:&lt;br /&gt;
&lt;br /&gt;
 cd examples\c&lt;br /&gt;
 copy ..\..\..\data\*.fnt .&lt;br /&gt;
&lt;br /&gt;
and additionally some dlls for a shared plplot built:&lt;br /&gt;
&lt;br /&gt;
 copy ..\..\dll\plplotd.dll .&lt;br /&gt;
 copy ..\..\dll\plplotcxxd.dll . (for c++ examples)&lt;br /&gt;
 copy ..\..\dll\csirocsa.dll . (if library was built)&lt;br /&gt;
&lt;br /&gt;
and for the wxWidgets driver (if wxWidgets library is shared):&lt;br /&gt;
&lt;br /&gt;
 copy %WXWIN%\lib\gcc_dll\wxmsw26d_vc_custom.dll .&lt;br /&gt;
&lt;br /&gt;
if this dll is not in the path.&lt;/div&gt;</summary>
		<author><name>Philrosenberg</name></author>	</entry>

	<entry>
		<id>http://www.miscdebris.net/plplot_wiki/index.php?title=Configure_PLplot_for_Visual_CXX_CLI&amp;diff=2258</id>
		<title>Configure PLplot for Visual CXX CLI</title>
		<link rel="alternate" type="text/html" href="http://www.miscdebris.net/plplot_wiki/index.php?title=Configure_PLplot_for_Visual_CXX_CLI&amp;diff=2258"/>
				<updated>2010-05-15T17:48:52Z</updated>
		
		<summary type="html">&lt;p&gt;Philrosenberg: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;You need a working Visual C++ and CMake installation. You should also ensure the following directories are included in your Path variable:&lt;br /&gt;
 &amp;lt;CMake install directory&amp;gt;\bin&lt;br /&gt;
 &amp;lt;MSVC++ install directory&amp;gt;\VC&lt;br /&gt;
 &amp;lt;MSVC++ install directory&amp;gt;\VC\bin&lt;br /&gt;
&lt;br /&gt;
The following commands will work if you are not using wxWidgets. If you are using wxWidgets then check [[Configuration of wxWidgets driver]].&lt;br /&gt;
&lt;br /&gt;
Copy the following commands into a text editor, add the correct directory on the first line and save as a batch file. Start the command line interface and execute the batch file. Of course, if you need, you can issue the commands directly from the command line.&lt;br /&gt;
&lt;br /&gt;
 set PLWIN=&amp;lt;directory you extracted the source code to&amp;gt;&lt;br /&gt;
 cd %PLWIN%&lt;br /&gt;
 call vcvarsall&lt;br /&gt;
 mkdir buildnmake&lt;br /&gt;
 cd buildnmake&lt;br /&gt;
 set PATH=PLWIN\buildnmake\dll;%PATH%&lt;br /&gt;
 cmake -G &amp;quot;NMake Makefiles&amp;quot; -DCMAKE_INSTALL_PREFIX=install .. -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON&lt;br /&gt;
 nmake&lt;br /&gt;
 nmake install&lt;br /&gt;
 rename install\bin\plplotcxxd.dll plplotcxx.dll&lt;br /&gt;
 rename install\bin\plplotd.dll plplot.dll&lt;br /&gt;
 rename install\lib\plplotcxxd.lib plplotcxx.lib&lt;br /&gt;
 rename install\lib\plplotd.lib plplot.lib&lt;br /&gt;
 cmake -G &amp;quot;NMake Makefiles&amp;quot; -DCMAKE_INSTALL_PREFIX=install .. -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF&lt;br /&gt;
 nmake&lt;br /&gt;
 nmake install&lt;br /&gt;
 rename install\lib\plplotcxxd.lib plplotcxxs.lib&lt;br /&gt;
 rename install\lib\plplotd.lib plplots.lib&lt;br /&gt;
 cmake -G &amp;quot;NMake Makefiles&amp;quot; -DCMAKE_INSTALL_PREFIX=install .. -DCMAKE_BUILD_TYPE=Debug -DBUILD_SHARED_LIBS=OFF&lt;br /&gt;
 nmake&lt;br /&gt;
 nmake install&lt;br /&gt;
 rename install\lib\plplotcxxd.lib plplotcxxsd.lib&lt;br /&gt;
 rename install\lib\plplotd.lib plplotsd.lib&lt;br /&gt;
 cmake -G &amp;quot;NMake Makefiles&amp;quot; -DCMAKE_INSTALL_PREFIX=install .. -DCMAKE_BUILD_TYPE=Debug -DBUILD_SHARED_LIBS=ON&lt;br /&gt;
 nmake&lt;br /&gt;
 nmake install&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This will build shared and static debug and release versions of the plplot library and install all files into the directory &amp;lt;tt&amp;gt;plplot\buildnmake\install&amp;lt;/tt&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
For those who are not familiar with NMake and CMake here is an explanation of what we have just done. Nmake is a command line compiler included with Microsoft VC++ which can be used to build from source. Instead of project files it uses make files. To avoid creating make files for multiple compilers plplot includes CMake files. These are interpreted by CMake, along with the variables specified on the command line, to generate make files for many different compilers. So, in order, we performed the following actions:&lt;br /&gt;
&lt;br /&gt;
 Set up needed paths including MSVC++ paths using vcvarsall&lt;br /&gt;
 Called CMake to generate make files for static/share and release/debug builds&lt;br /&gt;
 Called Nmake to build PlPlot&lt;br /&gt;
 Called Nmake install to move the libraries and header files to the install folder&lt;br /&gt;
 Renamed the libraries with sensible postfixes to indicate static and debug versions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note&amp;#039;&amp;#039;&amp;#039;: during the build the various DLLs are put in the subdirectory &amp;quot;dll&amp;quot; under the build directory. It is important that this directory is contained in the path during the build if you use the dynamic drivers facility as otherwise calls to get-drv-info will fail and the drivers won&amp;#039;t be installed successfully. In addition, if you use wxWidgets driver you also must ensure that the wxWidgets DLL itself is in the path as well.&lt;br /&gt;
 &lt;br /&gt;
Alternatively you can use the GUI version of CMake, an easy-to-use user-interface that presents the available build options&lt;br /&gt;
and lets you set them. It is mostly a matter of taste, but:&lt;br /&gt;
* The GUI version provides an overview of the build opions that are available&lt;br /&gt;
* The command-line version is particularly useful if you are experimenting with these options, as it can be run from a batchfile&lt;br /&gt;
&lt;br /&gt;
Some of the options that are available for cmake:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;-DCMAKE_VERBOSE_MAKEFILE=ON&amp;lt;/tt&amp;gt;: makefiles provide verbose informations&lt;br /&gt;
* &amp;lt;tt&amp;gt;-DBUILD_TEST=ON&amp;lt;/tt&amp;gt;: all examples will be built also (for test purposes)&lt;br /&gt;
* [[Configuration of wxWidgets driver]]&lt;br /&gt;
&lt;br /&gt;
If you used the &amp;lt;tt&amp;gt;-DBUILD_TEST=ON&amp;lt;/tt&amp;gt; option, you need to copy some files in order to run the examples:&lt;br /&gt;
&lt;br /&gt;
 cd examples\c&lt;br /&gt;
 copy ..\..\..\data\*.fnt .&lt;br /&gt;
&lt;br /&gt;
and additionally some dlls for a shared plplot built:&lt;br /&gt;
&lt;br /&gt;
 copy ..\..\dll\plplotd.dll .&lt;br /&gt;
 copy ..\..\dll\plplotcxxd.dll . (for c++ examples)&lt;br /&gt;
 copy ..\..\dll\csirocsa.dll . (if library was built)&lt;br /&gt;
&lt;br /&gt;
and for the wxWidgets driver (if wxWidgets library is shared):&lt;br /&gt;
&lt;br /&gt;
 copy %WXWIN%\lib\gcc_dll\wxmsw26d_vc_custom.dll .&lt;br /&gt;
&lt;br /&gt;
if this dll is not in the path.&lt;/div&gt;</summary>
		<author><name>Philrosenberg</name></author>	</entry>

	<entry>
		<id>http://www.miscdebris.net/plplot_wiki/index.php?title=Talk:Configure_PLplot_for_Visual_CXX_CLI&amp;diff=2257</id>
		<title>Talk:Configure PLplot for Visual CXX CLI</title>
		<link rel="alternate" type="text/html" href="http://www.miscdebris.net/plplot_wiki/index.php?title=Talk:Configure_PLplot_for_Visual_CXX_CLI&amp;diff=2257"/>
				<updated>2010-05-15T17:45:57Z</updated>
		
		<summary type="html">&lt;p&gt;Philrosenberg: Created page with &amp;#039;I have spent litterally dats trying to build PLplot and unfortunately I didn&amp;#039;t find the wiki very useful. I fully understand that the people working on the PLplot project are bus…&amp;#039;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I have spent litterally dats trying to build PLplot and unfortunately I didn&amp;#039;t find the wiki very useful. I fully understand that the people working on the PLplot project are busy coding rather than documenting so that&amp;#039;s just the way open source is. Anyway, my big problem was that I&amp;#039;d never used CMake or nmake before so I struggled to get started. I&amp;#039;m also trying to build wxplplot so that added extra complications. Now that I&amp;#039;ve got it built I thought it would help others if I put a step by step on how I did it with a little background info for others who haven&amp;#039;t used CMake before. I hope this is okay and that it is useful to others.&lt;br /&gt;
&lt;br /&gt;
As an extra note, I had to rename the libraries after each build to avoid the libraries getting overwritten. I saw that each file was appended by the letter d (for debug?) and it seemed that this was set using the LIB_TAG variable, but adding -DLIB_TAG=&amp;#039;s&amp;#039; (for static for example) to the cmake call made no difference. Any ideas? If so please feel free to make the command a bit more elegant.&lt;br /&gt;
&lt;br /&gt;
Phil&lt;/div&gt;</summary>
		<author><name>Philrosenberg</name></author>	</entry>

	<entry>
		<id>http://www.miscdebris.net/plplot_wiki/index.php?title=Configure_PLplot_for_Visual_CXX_CLI&amp;diff=2256</id>
		<title>Configure PLplot for Visual CXX CLI</title>
		<link rel="alternate" type="text/html" href="http://www.miscdebris.net/plplot_wiki/index.php?title=Configure_PLplot_for_Visual_CXX_CLI&amp;diff=2256"/>
				<updated>2010-05-15T17:33:51Z</updated>
		
		<summary type="html">&lt;p&gt;Philrosenberg: fixed typos&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;You need a working Visual C++ and CMake installation. You should also ensure the following directories are included in your Path variable:&lt;br /&gt;
 &amp;lt;CMake install directory&amp;gt;\bin&lt;br /&gt;
 &amp;lt;MSVC++ install directory&amp;gt;\VC&lt;br /&gt;
 &amp;lt;MSVC++ install directory&amp;gt;\VC\bin&lt;br /&gt;
&lt;br /&gt;
The following commands will work if you are not using wxWidgets. If you are using wxWidgets then check [[Configuration of wxWidgets driver]].&lt;br /&gt;
&lt;br /&gt;
Copy the following commands into a text editor, add the correct directory on the first line and save as a batch file. Start the command line interface and execute the batch file. Of course, if you need, you can issue the commands directly from the command line.&lt;br /&gt;
&lt;br /&gt;
 set PLWIN=&amp;lt;directory you extracted the source code to&amp;gt;&lt;br /&gt;
 cd %PLWIN%&lt;br /&gt;
 call vcvarsall&lt;br /&gt;
 mkdir buildnmake&lt;br /&gt;
 cd buildnmake&lt;br /&gt;
 set PATH=PLWIN\buildnmake\dll;%PATH%&lt;br /&gt;
 cmake -G &amp;quot;NMake Makefiles&amp;quot; -DCMAKE_INSTALL_PREFIX=install .. -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON&lt;br /&gt;
 nmake&lt;br /&gt;
 nmake install&lt;br /&gt;
 rename install\bin\plplotcxxd.dll plplotcxx.dll&lt;br /&gt;
 rename install\bin\plplotd.dll plplot.dll&lt;br /&gt;
 rename install\bin\plplotwxwidgetsd.dll plplotwxwidgets.dll&lt;br /&gt;
 rename install\lib\plplotcxxd.lib plplotcxx.lib&lt;br /&gt;
 rename install\lib\plplotd.lib plplot.lib&lt;br /&gt;
 rename install\lib\plplotwxwidgetsd.lib plplotwxwidgets.lib&lt;br /&gt;
 cmake -G &amp;quot;NMake Makefiles&amp;quot; -DCMAKE_INSTALL_PREFIX=install .. -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF&lt;br /&gt;
 nmake&lt;br /&gt;
 nmake install&lt;br /&gt;
 rename install\lib\plplotcxxd.lib plplotcxxs.lib&lt;br /&gt;
 rename install\lib\plplotd.lib plplots.lib&lt;br /&gt;
 rename install\lib\plplotwxwidgetsd.lib plplotwxwidgetss.lib&lt;br /&gt;
 cmake -G &amp;quot;NMake Makefiles&amp;quot; -DCMAKE_INSTALL_PREFIX=install .. -DCMAKE_BUILD_TYPE=Debug -DBUILD_SHARED_LIBS=OFF&lt;br /&gt;
 nmake&lt;br /&gt;
 nmake install&lt;br /&gt;
 rename install\lib\plplotcxxd.lib plplotcxxsd.lib&lt;br /&gt;
 rename install\lib\plplotd.lib plplotsd.lib&lt;br /&gt;
 rename install\lib\plplotwxwidgetsd.lib plplotwxwidgetssd.lib&lt;br /&gt;
 cmake -G &amp;quot;NMake Makefiles&amp;quot; -DCMAKE_INSTALL_PREFIX=install .. -DCMAKE_BUILD_TYPE=Debug -DBUILD_SHARED_LIBS=ON&lt;br /&gt;
 nmake&lt;br /&gt;
 nmake install&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This will build shared and static debug and release versions of the plplot library and install all files into the directory &amp;lt;tt&amp;gt;plplot\buildnmake\install&amp;lt;/tt&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
For those who are not familiar with NMake and CMake here is an explanation of what we have just done. Nmake is a command line compiler included with Microsoft VC++ which can be used to build from source. Instead of project files it uses make files. To avoid creating make files for multiple compilers plplot includes CMake files. These are interpreted by CMake, along with the variables specified on the command line, to generate make files for many different compilers. So, in order, we performed the following actions:&lt;br /&gt;
&lt;br /&gt;
 Set up needed paths including MSVC++ paths using vcvarsall&lt;br /&gt;
 Called CMake to generate make files for static/share and release/debug builds&lt;br /&gt;
 Called Nmake to build PlPlot&lt;br /&gt;
 Called Nmake install to move the libraries and header files to the install folder&lt;br /&gt;
 Renamed the libraries with sensible postfixes to indicate static and debug versions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note&amp;#039;&amp;#039;&amp;#039;: during the build the various DLLs are put in the subdirectory &amp;quot;dll&amp;quot; under the build directory. It is important that this directory is contained in the path during the build if you use the dynamic drivers facility as otherwise calls to get-drv-info will fail and the drivers won&amp;#039;t be installed successfully. In addition, if you use wxWidgets driver you also must ensure that the wxWidgets DLL itself is in the path as well.&lt;br /&gt;
 &lt;br /&gt;
Alternatively you can use the GUI version of CMake, an easy-to-use user-interface that presents the available build options&lt;br /&gt;
and lets you set them. It is mostly a matter of taste, but:&lt;br /&gt;
* The GUI version provides an overview of the build opions that are available&lt;br /&gt;
* The command-line version is particularly useful if you are experimenting with these options, as it can be run from a batchfile&lt;br /&gt;
&lt;br /&gt;
Some of the options that are available for cmake:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;-DCMAKE_VERBOSE_MAKEFILE=ON&amp;lt;/tt&amp;gt;: makefiles provide verbose informations&lt;br /&gt;
* &amp;lt;tt&amp;gt;-DBUILD_TEST=ON&amp;lt;/tt&amp;gt;: all examples will be built also (for test purposes)&lt;br /&gt;
* [[Configuration of wxWidgets driver]]&lt;br /&gt;
&lt;br /&gt;
If you used the &amp;lt;tt&amp;gt;-DBUILD_TEST=ON&amp;lt;/tt&amp;gt; option, you need to copy some files in order to run the examples:&lt;br /&gt;
&lt;br /&gt;
 cd examples\c&lt;br /&gt;
 copy ..\..\..\data\*.fnt .&lt;br /&gt;
&lt;br /&gt;
and additionally some dlls for a shared plplot built:&lt;br /&gt;
&lt;br /&gt;
 copy ..\..\dll\plplotd.dll .&lt;br /&gt;
 copy ..\..\dll\plplotcxxd.dll . (for c++ examples)&lt;br /&gt;
 copy ..\..\dll\csirocsa.dll . (if library was built)&lt;br /&gt;
&lt;br /&gt;
and for the wxWidgets driver (if wxWidgets library is shared):&lt;br /&gt;
&lt;br /&gt;
 copy %WXWIN%\lib\gcc_dll\wxmsw26d_vc_custom.dll .&lt;br /&gt;
&lt;br /&gt;
if this dll is not in the path.&lt;/div&gt;</summary>
		<author><name>Philrosenberg</name></author>	</entry>

	<entry>
		<id>http://www.miscdebris.net/plplot_wiki/index.php?title=Configure_PLplot_for_Visual_CXX_CLI&amp;diff=2255</id>
		<title>Configure PLplot for Visual CXX CLI</title>
		<link rel="alternate" type="text/html" href="http://www.miscdebris.net/plplot_wiki/index.php?title=Configure_PLplot_for_Visual_CXX_CLI&amp;diff=2255"/>
				<updated>2010-05-15T17:31:39Z</updated>
		
		<summary type="html">&lt;p&gt;Philrosenberg: Added more detailed instructions for building the libraries under windows. See my comment under discussion for more details&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;You need a working Visual C++ and CMake installation. You should also ensure the following directories are included in your Path variable:&lt;br /&gt;
 &amp;lt;CMake install directory&amp;gt;\bin&lt;br /&gt;
 &amp;lt;MSVC++ install directory&amp;gt;\VC&lt;br /&gt;
 &amp;lt;MSVC++ install directory&amp;gt;\VC\bin&lt;br /&gt;
&lt;br /&gt;
The following commands will work if you are not using wxWidgets. If you are using wxwidgets then check [[Configuration of wxWidgets driver]].&lt;br /&gt;
&lt;br /&gt;
Copy the following commands into a text editor, add the correct directory on the first line and save as a batch file. Start the command line interface and execute the batch file. Of course, if you need, you can issue the commands directly from the command line.&lt;br /&gt;
&lt;br /&gt;
 set PLWIN=&amp;lt;directory you extracted the source code to&amp;gt;&lt;br /&gt;
 cd %PLWIN%&lt;br /&gt;
 call vcvarsall&lt;br /&gt;
 mkdir buildnmake&lt;br /&gt;
 cd buildnmake&lt;br /&gt;
 set PATH=PLWIN\buildnmake\dll;%PATH%&lt;br /&gt;
 cmake -G &amp;quot;NMake Makefiles&amp;quot; -DCMAKE_INSTALL_PREFIX=install .. -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON&lt;br /&gt;
 nmake&lt;br /&gt;
 namake install&lt;br /&gt;
 rename install\bin\plplotcxxd.dll plplotcxx.dll&lt;br /&gt;
 rename install\bin\plplotd.dll plplot.dll&lt;br /&gt;
 rename install\bin\plplotwxwidgetsd.dll plplotwxwidgets.dll&lt;br /&gt;
 rename install\lib\plplotcxxd.lib plplotcxx.lib&lt;br /&gt;
 rename install\lib\plplotd.lib plplot.lib&lt;br /&gt;
 rename install\lib\plplotwxwidgetsd.lib plplotwxwidgets.lib&lt;br /&gt;
 cmake -G &amp;quot;NMake Makefiles&amp;quot; -DCMAKE_INSTALL_PREFIX=install .. -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF&lt;br /&gt;
 nmake&lt;br /&gt;
 nmake install&lt;br /&gt;
 rename install\lib\plplotcxxd.lib plplotcxxs.lib&lt;br /&gt;
 rename install\lib\plplotd.lib plplots.lib&lt;br /&gt;
 rename install\lib\plplotwxwidgetsd.lib plplotwxwidgetss.lib&lt;br /&gt;
 cmake -G &amp;quot;NMake Makefiles&amp;quot; -DCMAKE_INSTALL_PREFIX=install .. -DCMAKE_BUILD_TYPE=Debug -DBUILD_SHARED_LIBS=OFF&lt;br /&gt;
 nmake&lt;br /&gt;
 nmake install&lt;br /&gt;
 rename install\lib\plplotcxxd.lib plplotcxxsd.lib&lt;br /&gt;
 rename install\lib\plplotd.lib plplotsd.lib&lt;br /&gt;
 rename install\lib\plplotwxwidgetsd.lib plplotwxwidgetssd.lib&lt;br /&gt;
 cmake -G &amp;quot;NMake Makefiles&amp;quot; -DCMAKE_INSTALL_PREFIX=install .. -DCMAKE_BUILD_TYPE=Debug -DBUILD_SHARED_LIBS=ON&lt;br /&gt;
 nmake&lt;br /&gt;
 nmake install&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This will build shared and static debug and release versions of the plplot library and install all files into the directory &amp;lt;tt&amp;gt;plplot\buildnmake\install&amp;lt;/tt&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
For those who are not familiar with NMake and CMake here is an explanation of what we have just done. Nmake is a command line compiler included with Microsoft VC++ which can be used to build from source. Instead of project files it uses make files. To avoid creating make files for multiple compilers plplot includes CMake files. These are interpreted by CMake, along with the variables specified on the command line, to generate make files for many different compilers. So, in order, we performed the following actions:&lt;br /&gt;
&lt;br /&gt;
 Set up needed paths including MSVC++ paths using vcvarsall&lt;br /&gt;
 Called CMake to generate make files for static/share and release/debug builds&lt;br /&gt;
 Called Nmake to build PlPlot&lt;br /&gt;
 Called Nmake install to move the libraries and header files to the install folder&lt;br /&gt;
 Renamed the libraries with sensible postfixes to indicate static and debug versions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note&amp;#039;&amp;#039;&amp;#039;: during the build the various DLLs are put in the subdirectory &amp;quot;dll&amp;quot; under the build directory. It is important that this directory is contained in the path during the build if you use the dynamic drivers facility as otherwise calls to get-drv-info will fail and the drivers won&amp;#039;t be installed successfully. In addition, if you use wxWidgets driver you also must ensure that the wxWidgets DLL itself is in the path as well.&lt;br /&gt;
 &lt;br /&gt;
Alternatively you can use the GUI version of CMake, an easy-to-use user-interface that presents the available build options&lt;br /&gt;
and lets you set them. It is mostly a matter of taste, but:&lt;br /&gt;
* The GUI version provides an overview of the build opions that are available&lt;br /&gt;
* The command-line version is particularly useful if you are experimenting with these options, as it can be run from a batchfile&lt;br /&gt;
&lt;br /&gt;
Some of the options that are available for cmake:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;-DCMAKE_VERBOSE_MAKEFILE=ON&amp;lt;/tt&amp;gt;: makefiles provide verbose informations&lt;br /&gt;
* &amp;lt;tt&amp;gt;-DBUILD_TEST=ON&amp;lt;/tt&amp;gt;: all examples will be built also (for test purposes)&lt;br /&gt;
* [[Configuration of wxWidgets driver]]&lt;br /&gt;
&lt;br /&gt;
If you used the &amp;lt;tt&amp;gt;-DBUILD_TEST=ON&amp;lt;/tt&amp;gt; option, you need to copy some files in order to run the examples:&lt;br /&gt;
&lt;br /&gt;
 cd examples\c&lt;br /&gt;
 copy ..\..\..\data\*.fnt .&lt;br /&gt;
&lt;br /&gt;
and additionally some dlls for a shared plplot built:&lt;br /&gt;
&lt;br /&gt;
 copy ..\..\dll\plplotd.dll .&lt;br /&gt;
 copy ..\..\dll\plplotcxxd.dll . (for c++ examples)&lt;br /&gt;
 copy ..\..\dll\csirocsa.dll . (if library was built)&lt;br /&gt;
&lt;br /&gt;
and for the wxWidgets driver (if wxWidgets library is shared):&lt;br /&gt;
&lt;br /&gt;
 copy %WXWIN%\lib\gcc_dll\wxmsw26d_vc_custom.dll .&lt;br /&gt;
&lt;br /&gt;
if this dll is not in the path.&lt;/div&gt;</summary>
		<author><name>Philrosenberg</name></author>	</entry>

	</feed>