|
From: Andrew B. <an...@br...> - 2006-07-16 11:09:28
|
Ok, maybe the description of my problem wasn't clear enough. I didn't download libpng, but whenever I try plotting a PNG it crashes. So, I'm starting again explaining each step I took. I firstly checked out the CVS tree using TortiseCVS, using the options I found for CVS listed here: http://www.gnuplot.info/development/index.html Then reading the INSTALL file it tells me to run "nmake -f ..\config\makefile.nt", however at that point I haven't downloaded the gdlib/pdflib libraries. So reading the instructions in the makefile.nt it says to download them both and place them in ..\src\gdwin32 and ..\src\pdflib which I do. BTW I download http://www.boutell.com/gd/http/gdwin32.zip and http://www.pdflib.com/products/pdflib/download/603/PDFlib-6.0.3p1-Windows.zip Now I run nmake -f ..\config\makefile.nt from the source directory. I'm using the Visual Studio 2003 Compiler. That compiles but fails at the linking, because \src\gdwin32 doesn't contain a bgd.lib file. After a quick google I realise I need to run \src\gdwin32\makevcimport.bat. I do that and try nmake again, and it finishes linking. I now copy the pgnuplot.exe wgnuplot.hlp and wgnuplot.exe in to their own directory. As well as copying the pdflib.dll and bgb.dll. Now when I run wgnuplot, the normal gnuplot window appears. I type the following lines plot(sin(x)) A nice sine wave window appears. Then I try set terminal pdf set output "test.pdf" plot(sin(x)) A PDF file appears with the correct graph in it. Then I try pngs: set terminal png set output "test.png" plot(sin(x)) (and as soon as I hit enter on that last line, GNUPlot crashs, leaving me with a zero byte test.png file) I then tried to plot with a different terminal type, so I type set terminal to obtain a list, and voila gnuplot crashes again once we get to the end of the list! But I see gif was a supported type, so I type the following: set terminal gif set output "test.gif" plot(sin(x)) and again a crash!. So maybe my former statement about it being libpng was wrong, its more generally libgd. Now the only difference I seem to be doing to Bastian, is that I'm using Visual Studio 2003, instead of Visual C++ 6. Also in response to Peter Mikulik's question about typing "set out; set term pop" afterwards? Well as soon as I type plot it crashes, so I'm unable to type it afterwards. I'm happy to send my binary files for anyone to debug, or I could recompile with debugging enabled if that helps. Until then I will be using gnuplot on a linux machine, but it would be a great help for me if Bastian would send me his compiled executable in the mean time. Thanks a lot Andrew P.S This post seems to outline what steps need to be done to compile the code, which is slightly more complex than listed in INSTALL, maybe some of these steps need to be added to INSTALL. thanks. ----- Original Message ----- From: "Bastian Maerkisch" <bma...@we...> To: "Andrew Brampton" <an...@br...> Sent: Saturday, July 15, 2006 6:24 AM Subject: Re: Windows gnuplot 4.1 libpng problems Andrew Brampton wrote: > Hi, > I recently started to use gnuplot 4.0, but found I needed some features in > 4.1. > > When I try the provided binaries the program crashes, when I try and use > this simple script: > reset > set terminal png > set output 'temp.png' > > plot(sin(x)) > > So I figured it was a bug so I tried compiling from the latest CVS source. > After many hours of compiling/recompiling, etc, I still have the same > crash. However if I use a different terminal (other than png) the image is > plotted fine. So I assume this is a problem with libpng? > > I found this old posting > http://sourceforge.net/mailarchive/forum.php?thread_id=9178285&forum_id=6027 > stating the same problem, but looking the CVS is compiling with /MT. Are you sure you are using a current CVS version? Support for binary version of libgd was added in last december. config.nt in CVS uses the /MD switch. No need to get libpng any more. > Can anyone recommend how to compile the code? Or just give me a binary > that works with PNGs... thanks > > BTW I'm using Visual Studio .Net 2003, on Windows XP, with the gnuplot > code from CVS about 30minutes ago (as well as snapshots from April). Well, I am using MSVC++ 6.0 on XP. And here's what I do: - download gdlib to gnuplot\src\gdwin32 (binary version!) - download pdflib to gnuplot\src\pdflib and compile it if you choose the source, (you can also remove all references to pdf in makefile.nt) - copy bgd.dll and pdflib.dllto a place in your path - change to gnuploit\src - run nmake -f ..\config\makefile.nt Works out of the box for me. (last tested 14 days ago) Hope that helps, Bastian > > Thanks for any help > Andrew -- Bastian Märkisch Physikalisches Institut, Universität Heidelberg |