Menu

Problems with libplotter from Plotutils 2.4.1

Help
2008-07-16
2012-07-26
  • Tommaso Balercia

    I'm having some strange problems with plotutils. I'm using eclipse 4.0 + mingw c++ 3.4.5 + libplotter from plotutils 2.4.1. Everything compiles and links (statically) ok, but the output of a GIFPlotter is wrong(that's to say the file can't be visualized). I tried to use a PNGPlotter with libpng 1.2.8 + zlib 1.2.3 (also statically linked), but no improvement. The same code works ok under Linux with Plotutils 2.5.x both with a GIFPlotter and a PNGPlotter. SVGPlotter and PSPlotter work ok both under Linux an Windows.

    Apparently the genereated .gif and .png files are slightly shorter than what they are in the linux version, but I didn't do a binary diff yet. I tried to add "plotter.flushpl();" but didn't help.

    This is how the compiler is invoked:

    g++ -IC:\Program Files\GnuWin32\include -O0 -g3 -Wall -c -fmessage-length=0 -osrc\m2m.o ..\src\m2m.cpp

    for the linker:

    g++ -LC:\Program Files\GnuWin32\lib -Xlinker -static -om2m.exe src\m2m.o src\colormap.o -lplotter

    The code I can replicate the problem with is the most basic one can think of and can be found below. I would really appreciate some help on this because I would like to stop using a linux virtual machine on a system that works poorly already(but on which I can't really change much due to company cr...ehm, policies).

    Thanks for your attention,

    kl31n

    //BEGIN CODE---file: m2m.cpp

    define X_DISPLAY_MISSING

    include <plotter.h>

    include <fstream>

    int main() {

    std::ofstream output(&quot;c:\\test.gif&quot;);
    Plotter::parampl(&quot;BITMAPSIZE&quot;, (void*)&quot;1000x1000&quot;);
    GIFPlotter plotter(std::cin, output, std::cerr);
    
    plotter.openpl();
    plotter.fspace (0.0, 0.0, 1000.0, 1000.0);
    plotter.flinewidth (0.25);
    plotter.pencolorname (&quot;red&quot;);
    plotter.erase ();
    plotter.fmove (250.0, 250.0);
    plotter.fcont(750.0,750.0);
    plotter.closepl();
    
        return 0;
    

    }

     
    • Tommaso Balercia

      I completed the binary diff. Substituting every "OD0A" with "0A", so "\r\n" with "\n", the gif file that gets generated works ok. Somebody has an idea on how to fix this in the library?

       
MongoDB Logo MongoDB