I tried  2 solutions :

FIRST solution

don't change wxwidgets_dev.cpp

and change include order in wxwidgets.h #include <wx/wx.h> after <memory> and before  // plplot headers

then  $ git diff is
diff --git a/drivers/wxwidgets.h b/drivers/wxwidgets.h
index 884292d07..0818f357c 100644
--- a/drivers/wxwidgets.h
+++ b/drivers/wxwidgets.h
@@ -22,13 +22,14 @@

 #include <vector>
 #include <memory>
+#include <wx/wx.h>

 // plplot headers
 #include "plplotP.h"
 #include "wxwidgets_comms.h"

 // some special wxWidgets headers
-#include <wx/wx.h>
+//#include <wx/wx.h>
 #include <wx/spinctrl.h>
 #include <wx/dcgraph.h>

SECOND solution

add #include <wx/wx.h> in wxwidgets_dev.cpp at line 41

then $git diff is
diff --git a/drivers/wxwidgets_dev.cpp b/drivers/wxwidgets_dev.cpp
index 6351c6893..07089d83a 100644
--- a/drivers/wxwidgets_dev.cpp
+++ b/drivers/wxwidgets_dev.cpp
@@ -38,7 +38,7 @@
 #else
 #include <fstream>
 #endif
-
+#include <wx/wx.h>
 // PLplot headers
 #include "plDevs.h"
 #include "wxwidgets.h" // includes wx/wx.h



Le 22/09/2018 à 12:26, Phil Rosenberg a écrit :
Hi Laurent

Okay, well if your solution works, the I think we should add it in.

Could I please ask for you to check what the minimum list of headers
to be included needs to be? Would just adding wx/wx.h be sufficient or
do all those headers need to be added?

Phil

Phil
On Sat, 22 Sep 2018 at 10:24, Laurent Berger
<laurent.ber...@univ-lemans.fr> wrote:
Hi Phil, Alan,

I check everything this morning (local time) and I have got same errors.

I attached my cmakecache for plplot and cmakecache for wxwidgets

git diff

Laurent@PC-Laurent-Vision MINGW64 /g/lib/plplot (master)
$ git diff
diff --git a/drivers/wxwidgets_dev.cpp b/drivers/wxwidgets_dev.cpp
index 6351c6893..27b20750e 100644
--- a/drivers/wxwidgets_dev.cpp
+++ b/drivers/wxwidgets_dev.cpp
@@ -38,7 +38,15 @@
   #else
   #include <fstream>
   #endif
+#include <wx/wx.h>
+#include <wx/wfstream.h>
+#include <wx/except.h>

+#include "plDevs.h"
+
+// plplot headers
+#include "plplotP.h"
+#include "drivers.h"
   // PLplot headers
   #include "plDevs.h"
   #include "wxwidgets.h" // includes wx/wx.h




Le 22/09/2018 à 01:37, Phil Rosenberg a écrit :
Hi Laurent
What a strange set of compilation errors. They are all from windows
sockets headers, rather than from wxWidgets.

Here is my guess at what is happening - but I have not been able to
reproduce the error (I am using VS 2015 still).

In the code before your edits following the #includes through, it
turns out we include <windows.h> into wxwidgets_dev.cpp before any
wxWidgets headers. This is done via "wxwidgets.h", then
"wxwidgets_comms.h". The winsock related functions probably get pulled
in via windows.h. I have a feeling that one of the wx headers is then
pulling in alternate definitions of those winsock functions, but I'm
not sure from where.

By shuffling the headers round as you have, you include <wx/wx.h>
before we pull in <windows.h>. The <wx/wx.h> file will in turn pull in
<windows.h> itself. then our include windows.h should get ignored.

I can't think how exectly it might work, but I bet there is some weird
inconsistency between how <windows.h> is pulled in by us, vs how it is
pulled in by wxWidgets - maybe related to some #defines like DLLEXPORT
or extern "C".

Anyway I might guess that moving the headers around is simply masking
some other problem. Can I check that you have built wxWidgets with the
same virsion of visual studio? And that it is also built as a static
lib? Just a hunch but maybe something to do with the wxwidgets library
configuration is causing the issue.

Phil
On Fri, 21 Sep 2018 at 23:08, Alan W. Irwin <alan.w.irwin1...@gmail.com> wrote:
On 2018-09-21 18:38+0200 Laurent Berger wrote:

Hi,

I have just done a git clone : (Date:   Thu Sep 20 22:36:48 2018 -0700
) commit caf4801dfef32207b74f5374eff52bf2a4c24e3d

and delete cmakecache.txt and I I'm trying to build plplot in static

BUILD_SHARED_LIBS:BOOL=OFF

and ENABLE_DYNDRIVERS:BOOL=OFF

and I have got 59 errors compiling wxwidgets_dev.cpp.

In git repo I can find this file
https://github.com/PLplot/PLplot/blob/14ecc4bd943caa40a830e0da066ff7a220b9d5e8/drivers/wxwidgets.cpp

I copy
https://github.com/PLplot/PLplot/blob/14ecc4bd943caa40a830e0da066ff7a220b9d5e8/drivers/wxwidgets.cpp#L28-L36
and insert those lines here
https://github.com/PLplot/PLplot/blob/master/drivers/wxwidgets_dev.cpp#L41

I can compile and link plplot.
Hi Laurent:

Thanks for your test of my recent PLplot development activity.

I have looked at commits 14ecc4bd94 (= plplot-5.13.0-59-g14ecc4bd9)
and caf4801dfe (current master tip), and your description of the
required change appears to correspond to copying some wxwidgets includes from
one part of the old commit (or alternatively the latest commit since
those lines haven't changed) to just after

#include "wxwidgets.h"

As far as I can tell such a copy of includes should have zero effect
so it appears either I misunderstood the change you described above or
else the github repo for PLplot is not properly up to date with the
definitive SourceForge repo.  So to remove this uncertainty please
give us the results of

git diff

to describe the definitive version of the change to the master tip of
PLplot that works for you (i.e., allows a static build of PLplot to
compile and link for your VS2017 platform).

By the way, a comprehensive test of PLplot has recently (one commit
behind master tip) worked perfectly here on Linux (Debian Buster).
Such comprehensive tests include not only building a static wxwidgets
device but run-time testing it as well.  Also that last commit on the
master branch is a minor one involving how to control the Lua version
that is searched for and is therefore extremely unlikely to introduce
wxwidgets issues.  Therefore, I cannot replicate your issue on Linux
so someone with access to recent Windows platforms will have to
attempt that instead.

Alan
__________________________
Alan W. Irwin

Programming affiliations with the FreeEOS equation-of-state
implementation for stellar interiors (freeeos.sf.net); the Time
Ephemerides project (timeephem.sf.net); PLplot scientific plotting
software package (plplot.sf.net); the libLASi project
(unifont.org/lasi); the Loads of Linux Links project (loll.sf.net);
and the Linux Brochure Project (lbproject.sf.net).
__________________________

Linux-powered Science
__________________________


_______________________________________________
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel



_______________________________________________
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel

Reply via email to