Forum > Windows (32/64)

lazutf8.pas debuging errors



I was very exiting when I find PascalSCADA . And even more, when I find Lazarus.
The reason is that in late 80's and early 90's I typed "few" lines in Pascal, but later Delphi and C++ replaced it and my needs were changed before I learn them.
Now, when I'm looking for available SCADA SW, the Pascal SCADA seems to me perfect choice. Well done!!
Somewhere in PascalSCADA is mentioned that this is not "Out of the Box" product, and I need also LAZARUS SW. which is OK.
I downloaded lazarus-2.0.10-fpc-3.2.0-win64.exe and installed it.
During installation I had some issues regarding the path of FPC sources, but I maneged to point to right one ( path $(LazarusDir)fpc\$(FPCVer)\source was not recognized ).
Later I managed to open and run Lazarus as New Program, and I managed to compile and build few programs ( SchoolFreeware ).
The problems starts when I open new project as Applications.
Even if I open empty application and try to Run it I'm gating errors. Compiling errors goes on lazutf8.pas function UTF8LengthFast.
errors are fallowing:
lazutf8.pas(514,8) Error: Identifier not found "Pint8"
lazutf8.pas(514,14) Error: Error in type definition
lazutf8.pas(528,21) Error: Illegal qualifier
lazutf8.pas(528,42) Error: Illegal qualifier
lazutf8.pas(529,5) Error: Operator is not overloaded: inc "<erroneous type>"
lazutf8.pas(545,21) Error: Illegal qualifier
lazutf8.pas(545,42) Error: Illegal qualifier
lazutf8.pas(546,5) Error: Operator is not overloaded: inc "<erroneous type>"

And code is:
function UTF8LengthFast(p: PChar; ByteCount: PtrInt): PtrInt;
{$ifdef CPU32}
  ONEMASK   =$01010101;
{$ifdef CPU64}
  ONEMASK   =$0101010101010101;
  pnx: PPtrInt absolute p; // To get contents of text in PtrInt blocks. x refers to 32 or 64 bits
  pn8: pint8 absolute pnx; // To read text as Int8 in the initial and final loops
  ix: PtrInt absolute pnx; // To read text as PtrInt in the block loop
  nx: PtrInt;              // values processed in block loop
  i,cnt,e: PtrInt;
  Result := 0;
  e := ix+ByteCount; // End marker
  // Handle any initial misaligned bytes.
  cnt := (not (ix-1)) and (sizeof(PtrInt)-1);
  if cnt>ByteCount then
    cnt := ByteCount;
  for i := 1 to cnt do
    // Is this byte NOT the first byte of a character?
    Result += (pn8^ shr 7) and ((not pn8^) shr 6);
  // Handle complete blocks
  for i := 1 to (ByteCount-cnt) div sizeof(PtrInt) do
    // Count bytes which are NOT the first byte of a character.
    nx := ((pnx^ and EIGHTYMASK) shr 7) and ((not pnx^) shr 6);
    {$push}{$overflowchecks off} // "nx * ONEMASK" causes an arithmetic overflow.
    Result += (nx * ONEMASK) >> ((sizeof(PtrInt) - 1) * 8);
  // Take care of any left-over bytes.
  while ix<e do
    // Is this byte NOT the first byte of a character?
    Result += (pn8^ shr 7) and ((not pn8^) shr 6);
  Result := ByteCount - Result;

Before I sadly Uninstall everything. I'm interestrd if anyone have an Idea how to fix this errors and why they appear.
Not to forget, I'm running Lazarus on Win 7 Pro SP1, 64bit; i7.

Best regards,



I think these errors result in the strange way you build your house.

Starting with the balkony.
Then the walls.
And finally the basement.

I would first install the basement: fpc
Then the walls: Lazarus
And finallly PascalSCADA - if you like.

This error is definitly a result of your strange order of installing:

--- Code: Text  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---lazutf8.pas(514,8) Error: Identifier not found "Pint8"
Pint8 is part of of the basic unit system which is installed with fpc.

But as you installed Lazarus before fpc there are some lost connections.

Do it the other way round.


Thank You Winni for Your advice.
I've done Your way the first time.
I'm going to try again.

Best regards,



[0] Message Index

Go to full version