Re: [Plplot-devel] Cannot compile plplot using VS 2017
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 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 before we pull in . The file will in turn pull in 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 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 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
Re: [Plplot-devel] Cannot compile plplot using VS 2017
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] Cannot compile plplot using VS 2017
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. Errors list compiling wxwidgets_dev.cpp: 1>wxwidgets_dev.cpp 1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\shared\ws2def.h(103): warning C4005: 'AF_IPX': macro redefinition 1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\um\winsock.h(457): note: see previous definition of 'AF_IPX' 1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\shared\ws2def.h(147): warning C4005: 'AF_MAX': macro redefinition 1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\um\winsock.h(476): note: see previous definition of 'AF_MAX' 1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\shared\ws2def.h(185): warning C4005: 'SO_DONTLINGER': macro redefinition 1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\um\winsock.h(399): note: see previous definition of 'SO_DONTLINGER' 1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\shared\ws2def.h(235): error C2011: 'sockaddr': 'struct' type redefinition 1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\um\winsock.h(1007): note: see declaration of 'sockaddr' 1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\shared\ws2def.h(437): error C2059: syntax error: 'constant' 1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\shared\ws2def.h(437): error C3805: 'constant': unexpected token, expected either '}' or a ',' 1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\shared\ws2def.h(572): warning C4005: 'IN_CLASSA': macro redefinition 1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\um\winsock.h(284): note: see previous definition of 'IN_CLASSA' 1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\shared\ws2def.h(578): warning C4005: 'IN_CLASSB': macro redefinition 1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\um\winsock.h(290): note: see previous definition of 'IN_CLASSB' 1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\shared\ws2def.h(584): warning C4005: 'IN_CLASSC': macro redefinition 1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\um\winsock.h(296): note: see previous definition of 'IN_CLASSC' 1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\shared\ws2def.h(595): warning C4005: 'INADDR_ANY': macro redefinition 1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\um\winsock.h(301): note: see previous definition of 'INADDR_ANY' 1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\shared\ws2def.h(597): warning C4005: 'INADDR_BROADCAST': macro redefinition 1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\um\winsock.h(303): note: see previous definition of 'INADDR_BROADCAST' 1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\shared\ws2def.h(633): error C2011: 'sockaddr_in': 'struct' type redefinition 1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\um\winsock.h(1011): note: see declaration of 'sockaddr_in' 1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\um\winsock2.h(136): error C2011: 'fd_set': 'struct' type redefinition 1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\um\winsock.h(1019): note: see declaration of 'fd_set' 1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\um\winsock2.h(156): warning C4005: 'FD_CLR': macro redefinition 1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\um\winsock.h(94): note: see previous definition of 'FD_CLR' 1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\um\winsock2.h(171): warning C4005: 'FD_SET': macro redefinition 1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\um\winsock.h(99): note: see previous definition of 'FD_SET' 1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\um\winsock2.h(180): error C2011: 'timeval': 'struct' type redefinition 1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\um\winsock.h(1035): note: see declaration of 'timeval' 1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\um\winsock2.h(236): error C2011: 'hostent': 'struct' type redefinition 1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\um\winsock.h(1023): note: see declaration of 'hostent' 1>c:\program files (x86)\windows kits\10\include\10.0.16299