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