Recent

Author Topic: BGRABitmapPack not working after installing BGRAControls  (Read 7511 times)

abtaylr

  • Full Member
  • ***
  • Posts: 107
BGRABitmapPack not working after installing BGRAControls
« on: July 15, 2016, 10:21:02 pm »
I have been using BGRABitmapPack 9.0.0. When BGRAControls came out a few days ago, I installed that pack into Lazarus 1.6.1 (Fixes).  Initially, BGRAControls seemed to be working correctly. Today, back working on my project which uses BGRABitmapPack 9.0.0 it wouldn't compile coming up with an error:

      bgracustombitmap.inc(1671,71) Fatal: Syntax error, "BEGIN" expected but "ordinal const" found

This refers to the following code from bgracustombitmap.inc:

Code: Pascal  [Select][+][-]
  1. procedure TBGRACustomBitmap.Fill(c: TColor);
  2. begin
  3.   Fill(ColorToBGRA(c));
  4. end;  <--------------------------------
  5.  
   

The compilation aborts where the arrow is showing.

I am running Kubuntu 16.04 LTS 64bit with FPC 3.0.1 (fixes) Build : 34088, and Lazarus 1.6.1 (fixes) Build: 52651

circular

  • Hero Member
  • *****
  • Posts: 4195
    • Personal webpage
Re: BGRABitmapPack not working after installing BGRAControls
« Reply #1 on: July 15, 2016, 10:37:54 pm »
What if you do a clean build of BGRABitmap package?
Conscience is the debugger of the mind

abtaylr

  • Full Member
  • ***
  • Posts: 107
Re: BGRABitmapPack not working after installing BGRAControls
« Reply #2 on: July 16, 2016, 03:42:03 am »
I did a fresh download of FPC/Lazarus from fixes branches and compiled and tested. I then did a fresh download of version 9.0.0 of BGRABitmap, then I installed BGRAControls. After fixing the problems with geometrytypes.inc, BGRABitmap compiled, so I opened my project did an F9 Run.  It crashed with the following errors:

Panic: internal error: Access violation
Panic: internal error:   $0000000000438599
Panic: internal error:   $0000000000A154FB

My project is showing GBRABitmapPack as a required package. Packages-->Install/Uninstall Packages shows:  BGRAControls 3.8.

I suppose I could try to uninstall BGRAControls to see what happens then . . .

abtaylr

  • Full Member
  • ***
  • Posts: 107
Re: BGRABitmapPack not working after installing BGRAControls
« Reply #3 on: July 16, 2016, 10:12:02 am »
After removing BGRAControls, everything is back working for BGRABitmapPack.

circular

  • Hero Member
  • *****
  • Posts: 4195
    • Personal webpage
Re: BGRABitmapPack not working after installing BGRAControls
« Reply #4 on: July 16, 2016, 10:55:46 am »
That's strange. What if you disable compiler optimizations in your project, BGRAControls and BGRABitmapPack?
Conscience is the debugger of the mind

abtaylr

  • Full Member
  • ***
  • Posts: 107
Re: BGRABitmapPack not working after installing BGRAControls
« Reply #5 on: July 16, 2016, 10:58:42 pm »
Optimizations currently are off -- O disabled.

circular

  • Hero Member
  • *****
  • Posts: 4195
    • Personal webpage
Re: BGRABitmapPack not working after installing BGRAControls
« Reply #6 on: July 17, 2016, 11:03:24 am »
Hmm... I am trying to help so I am a bit frustrated. That's not an obvious thing there.  :(

Here are some other thoughts:
  • Does it work with 32-bit version of Lazarus?
  • Does the error happen on a projet that does not use BGRAControls?
  • Maybe BGRAControls use another version of BGRABitmap. At some point for example there was an OpenGL version and a non OpenGL version and references could contradict each other.
  • You could try to remove the file in BGRAControls that you don't need, keep only what is necessary.

By the way, what are the problems with geometrytypes.inc? Are they still in version 9.0 or 9.1?
Conscience is the debugger of the mind

lainz

  • Hero Member
  • *****
  • Posts: 4460
    • https://lainz.github.io/
Re: BGRABitmapPack not working after installing BGRAControls
« Reply #7 on: July 17, 2016, 02:37:39 pm »
Its strange the only dependency is bgrabitmappack .
I must try on 64 bit. Also i tested only on lazarus 1.6 and fpc 3.0. And only under windows.

abtaylr

  • Full Member
  • ***
  • Posts: 107
Re: BGRABitmapPack not working after installing BGRAControls
« Reply #8 on: July 17, 2016, 11:35:06 pm »
I tried to get lazarus-ide 32bit for Kubuntu, but it choked. My system wouldn't allow me to load i386 libraries for GTK2 that it needed.  I could probably load a 32 version of Kubuntu on a VM then load 32 bit FPC/Lazarus if you want. 

circular

  • Hero Member
  • *****
  • Posts: 4195
    • Personal webpage
Re: BGRABitmapPack not working after installing BGRAControls
« Reply #9 on: July 18, 2016, 12:18:51 am »
Ah yes Linux does not run 32-bit code on 64-bit. That may work with a VM indeed.

@lainz: I have Windows on 64-bit and it compiles here. If you have Windows 32-bit then it covers Windows.
Conscience is the debugger of the mind

circular

  • Hero Member
  • *****
  • Posts: 4195
    • Personal webpage
Re: BGRABitmapPack not working after installing BGRAControls
« Reply #10 on: July 18, 2016, 12:54:30 am »
@abtaylr: Does it change something if you change the code of the procedure like this:
Code: Pascal  [Select][+][-]
  1. procedure TBGRACustomBitmap.Fill(c: TColor);
  2. var bgraColor: TBGRAPixel;
  3. begin
  4.   bgraColor := ColorToBGRA(c);
  5.   Fill(bgraColor);
  6. end;

Another hypothesis: if your program is including an older version of the include file via the search path of the project. Do you have another bgracustombitmap.inc file containing something else in it?

Another hypothesis: there is a memory corruption that happens within Lazarus and the code sent to the compiler is messed up. Maybe an empty project with just one BGRAControl on a form would compile?
« Last Edit: July 18, 2016, 01:51:55 am by circular »
Conscience is the debugger of the mind

abtaylr

  • Full Member
  • ***
  • Posts: 107
Re: BGRABitmapPack not working after installing BGRAControls
« Reply #11 on: July 18, 2016, 03:06:25 am »
I made the change to bgracustombitmap.inc, then re-installed BGRAControls.  I compiled my project and it went correctly right up to the current problem that I am working on, although it is BGRA related, but nothing to do with the problem we are working on.

I continue on with my project for a while and see if compiler aborts or panic attacks happen again.

abtaylr

  • Full Member
  • ***
  • Posts: 107
Re: BGRABitmapPack not working after installing BGRAControls
« Reply #12 on: July 18, 2016, 03:13:48 am »
As for the problem with geometrytypes.inc, when I downloaded a fresh version of BGRABitmapPack from SourceForge, I think -- or was it GitHub?.  I found that the errors from that file, all 25 of them came up, so I had to go into geometrytypes.inc to change the compiler directives from FPC_3_1_1 over to newer version that runs from being FPC>= 030001.  After that it compiled properly.

circular

  • Hero Member
  • *****
  • Posts: 4195
    • Personal webpage
Re: BGRABitmapPack not working after installing BGRAControls
« Reply #13 on: July 18, 2016, 12:20:15 pm »
Cool I am happy that now it works.  :)  Maybe that was just a whim of the compiler. I have applied the change on Git repository.

Regarding the compilation of geometrytypes.inc with TPointF, you're correct. This has been released in version 9.1 only.

« Last Edit: July 18, 2016, 12:24:57 pm by circular »
Conscience is the debugger of the mind

 

TinyPortal © 2005-2018