yes, that question may sound stupid, but I bet it cannot be answered by a quick RTFM since I did that before... The problem is simple: gnuplot does not seem to be compilable under native MS Windows using the documented methods.
What I did is the following:
1.) I downloaded the current CVS tree using the CVSROOT given in
2.) I opened a VC++ command line (here VC2003 since VC2005 does not compile the code at all due to errors in the command line parameters -- but VC2003 seem to work)
3.) I copied the Makefile.nt from ./config to ./src, CD'ed into ./src and entered the build command,
nmake -f makefile.nt
Anything forgotten? I hope not -- if that's the case, please stop me here. Otherwise, go on reading ;-)
The result of the whole procedure: The VC-compiler compiled a dozen of files -- not more! After creating the file "linkopt1.msw" it tries to link, but the linker breaks down. Reason: "alloc.obj" not found!
A quick look to the makefile reveals that the "WINOBJS" makefile variable does not contain any of the source files that can be found in the ./src directory. Ok, I found the files in the gnuplot.opt file, took the lost from there and appended them to "WINOBJS".
Starting nmake again, the compiler breaks down now. "gd.h" not found!?! There is nowhere documented, that a GD library must be installed in windows to get it compiled, is it?!? *snief*
Ok, I found the corresponding switches in the makefile.nt and commented them, along with the other libraries I don'nt have:
#OPTIONS = $(OPTIONS) /DHAVE_LIBGD ...
#OPTIONS = $(OPTIONS) /DHAVE_LIBPDF
Starting nmake, the compiling goes on, but the linker still breaks down. "readline.obj" not found -- and all the .obj files that are appended to the "linkopt1.msw" file. Ok again, I can append them manually to the "WINOBJS" variable.... Furthermore, I commented out the two libraries
# echo pdflib.lib >> linkopt1.msw
# echo bgd.lib >> linkopt1.msw
from being added to the linkopt.msw, since I don't have them. And the compiling goes on...
But again: Linker breaks down. "_vsnprintf" referenced in "winmain.obj" and "util.obj" not found. Opening these files reveals code sequences like this:
count = _vscprintf(fmt, args) + 1;
count = vsnprintf(NULL,0,fmt,args) + 1;
count = vsnprintf(buf, count, fmt, args);
Why the heck is vsnprintf once replaced by _vscprintf but not the other time?!? Hmpf. Ok, I had to change the code such that everywhere in the winmain.c and util.c, the vsnprintf is replaced by _vscprintf.
Compiling goes on.... and, well, I got an executable. Finally :)
I copied the file wgnuplot.exe (with a slightly modified name) to my previous wgnuplot-binaries directory, starting it and... yes, ok, I can see a gnuplot window. But it's unusable. I can enter commands, but they all give an error message containing only the very first character of the actual message. Hmpf.
Ok, that was enough for me. Can you give me a hint what I did wrong? And: Can you pleazzzze fix the stuff with the vsnprintf, the files in the makefile and the libraries (the latter one either by writing that these libraries must be made available in Windows -- how?!? -- or by using a proper setting switching the libraries off by default?... as long as these are bugs, but I cannot imagine what I did wrong...
BTW, there are still more problems when trying to compile gnuplot in VC2005. Example:
"win\winmain.c(388) : error C2065: 'GCL_HICON': undeclared identifier"
Perhaps you can take a look...
Log in to post a comment.