On 2016-10-09 00:49-0400 Pedro Vicente wrote:

> Hi Alan, Phil
>
>> and the old (-DOLD_WXWIDGETS=ON) -dev wxwidgets, and in each case the
>> requested blue background was rendered correctly.
>
>
> I tried to reproduce this (-DOLD_WXWIDGETS=ON) in Windows , Visual Studio 
> 2015,
> and I do get the blue backround
>
> but in the process of doing this I found another bug
>
> When you try to do the build with -DOLD_WXWIDGETS=ON (and only with this 
> option, in Windows)
>
> I get a linking error
>
>
> plplot.lib(deprecated_wxwidgets_app.obj) : error LNK2019: unresolved external 
> symbol "int __cdecl plsnprintf(char *,int,char const *,...)" referenced in 
> function "public: bool __thiscall wxPLplotFrame::SavePlot(char const *,char 
> const *,int,int)"
>
>
> wxPLplotFrame::SavePlot does include this call
>
>
> snprintf( buf, 512, "File %s couldn't be saved", filename );
>
> and snprintf is defined as
>
>
> #else // !PL_HAVE_SNPRINTF
> // declare dummy functions which just call the unsafe
> // functions ignoring the size of the string
> int plsnprintf( char *buffer, int n, const char *format, ... );
> int plsnscanf( const char *buffer, int n, const char *format, ... );
> #define snprintf    plsnprintf
>
> but this makes no sense to me because plsnprintf is defined in plctrl.c that 
> is part of the library
>
> int
> plsnprintf( char *buffer, int n, const char *format, ... )
> {
>
>
> either way, this should not fall in the case of
> !PL_HAVE_SNPRINTF
>
>
> because Visual Studio does defines _snprintf
>
> so the fix is to manually define
>
> #ifndef PL_HAVE_SNPRINTF
> #define PL_HAVE_SNPRINTF
> #endif
>
>
> so, the bug is that cmake does not detect _snprintf correctly, maybe in this 
> code
>
> check_function_exists(snprintf PL_HAVE_SNPRINTF)
> if(NOT PL_HAVE_SNPRINTF)
> check_function_exists(_snprintf _PL_HAVE_SNPRINTF)
> set(PL_HAVE_SNPRINTF ${_PL_HAVE_SNPRINTF} CACHE INTERNAL "Have function 
> _sprintf")
> endif(NOT PL_HAVE_SNPRINTF)

@Phil:

Will you take a look at the above linking issue with -G "Visual Studio 14" (or
whatever visual studio version you have access to) and
-DOLD_WXWIDGETS=ON and fix it?

@Pedro:

You report a completely unrelated issue below which I will attempt to
answer below.

> I used in cmake
>
>
> cmake ".." -G "Visual Studio 14" -DPL_DOUBLE:BOOL=ON -DBUILD_TEST:BOOL=ON 
> -DCMAKE_CONFIGURATION_TYPES:STRING="Debug" -DCMA
> KE_BUILD_TYPE:STRING="Debug" -DBUILD_SHARED_LIBS:BOOL=OFF 
> -DSTATIC_RUNTIME:BOOL=ON -DPLD_wxwidgets:BOOL=ON 
> -DwxWidgets_ROOT_DIR:PATH=%WXWIN% -DwxWidgets_LIB_
> DIR:PATH=%WXWIN%\lib\vc_lib -DwxWidgets_CONFIGURATION=mswud 
> -DENABLE_MIX_CXX=ON -DwxWidgets_EXCLUDE_COMMON_LIBRARIES:BOOL=OFF 
> -DOLD_WXWIDGETS=ON
>
>
>
> I also  do get some unrelated errors , but that's a separate bug
>
> the thing is that cmake has somewhere hardcoded Unix commands like
>
>
> Generating announce-plplot-5.3.0.html
> 'xmlto' is not recognized as an internal or external command,
>
> Generating staging/htdocs/announce/ChangeLog-5.2.1-5.3.0
> 'cp' is not recognized as an internal or external command,
>
> 'grep' is not recognized as an internal or external command,
>
> 'env' is not recognized as an internal or external command,
>
> and this causes some projects to not build
>
> by the way this is not related to the -DOLD_WXWIDGETS=ON it also happens in 
> another builds

@Pedro:

I did some further investigation and "Generating
announce-plplot-5.3.0.html" is the result of building the
generate_announcements target.  But that is a completely independent
target which no other target (such as all) depends on so it is not
built on Linux unless you specify the generate_announcements target
directly, e.g.,

make generate_announcements

So I don't understand why you end up building that independent target
using visual studio.  Is there some capability for that IDE where you
can build every target whether they are independent of other targets
or not?  If so, you should not do that since many of the independent
targets such as generate_announcements are Unix only.  Instead, you
should stick to more general targets (e.g., "all" or "install") which
depend only on targets that can be built on each of our supported
platforms.

Alan
__________________________
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

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
__________________________

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel

Reply via email to