Menu

#23 lazbarcode

closed-fixed
nobody
None
5
2011-11-12
2011-11-11
Petrus
No

Hi,

I downloaded the LAZBARCODE tarball but didn't install the package into Lazarus.
Instead I want to only use the code at runtime.

The compiler gives me back four errors in zint.pas:

..\lazbarcodes\src\zint.pp(47,33) Error: Type "zint_render_line" is not completely defined
..\lazbarcodes\src\zint.pp(61,35) Error: Type "zint_render_string" is not completely defined
..\lazbarcodes\src\zint.pp(72,33) Error: Type "zint_render_ring" is not completely defined
..\lazbarcodes\src\zint.pp(81,36) Error: Type "zint_render_hexagon" is not completely defined
..\lazbarcodes\src\zint.pp(242,1) Fatal: There were 4 errors compiling module, stopping

Which settings in the compiler are required to make it compile ?

Thanks,
Peter

Discussion

  • José Mejuto

    José Mejuto - 2011-11-11

    The component was designed working with fpc 2.5.1 version, prior ones have a problem when define a record which have a pointer definition to itself as a field. The solution is quite easy, just simple reorder some definitions, instead:

    type
    zint_render_line = record
    x : single;
    y : single;
    length : single;
    width : single;
    next : ^zint_render_line;
    end;
    PointerTo_zint_render_line=^zint_render_line;
    PointerTo_PointerTo_zint_render_line=^PointerTo_zint_render_line;

    It should be defined as:

    ---------------------------------
    type
    PointerTo_zint_render_line=^zint_render_line;
    PointerTo_PointerTo_zint_render_line=^PointerTo_zint_render_line;
    zint_render_line = record
    x : single;
    y : single;
    length : single;
    width : single;
    next : PointerTo_zint_render_line; // ^zint_render_line;
    end;
    ----------------------------

    So pointers are defined first and then the record.

    I'll attach by now a modified zint.pp (thanks to Igor Z for fixing the problem).

     
  • José Mejuto

    José Mejuto - 2011-11-11

    Changes commited in SVN Rev 2125

     
  • Petrus

    Petrus - 2011-11-12

    Thanks for very fast replay.

    It compiles now, as You described - thanks !!

     
  • Petrus

    Petrus - 2011-11-12
    • status: open --> closed-fixed
     

Log in to post a comment.