Recent

Author Topic: GR32 installation  (Read 959 times)

staratel20

  • Full Member
  • ***
  • Posts: 213
GR32 installation
« on: November 06, 2024, 04:23:56 pm »
Hi everybody

I have installed the last version of Gr32 from Git (graphics32-master) and then put an Image32 on empty form, trying to compile it gives me newbie error like

unit1.pas(8,58) Error: Can't find unit GR32_Image used by Unit1

Where do I need to specify the path to gr32\Sources so that I don't have to set it for every new project using gr32?
Windows 7 SP1 x64, FPC 3.0.0, Lazarus from trunk: http://svn.freepascal.org/svn/lazarus/trunk

CountIdentity, ModeClassName - good property naming
IdentityCount,  ClassNameMode  - bad property naming

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11930
  • FPC developer.
Re: GR32 installation
« Reply #1 on: November 06, 2024, 04:28:42 pm »
If GR32 has an installed package, add a dependency on it in the project manager. (right click on requirements  then add).

These kind of dependencies keep working, even if on an other system gr32 is installed elsewhere. (there are no hardcoded (and platform specific) paths in your projects .lpi, just the dependency, which is nice if your project is in a VCS and used on multiple machines).

If it doesn't have a package, it is easiest to create a package, and add all your private paths to it.   

Sometimes however Lazarus doesn't seem to find that package after updating lazarus, and it doesn't auto build it. Opening the package and manually compiling solves that.

staratel20

  • Full Member
  • ***
  • Posts: 213
Re: GR32 installation
« Reply #2 on: November 06, 2024, 05:08:02 pm »
>> (right click on requirements  then add).

I guess one more newbie question... Where can I find requirements to right click on them..)) ?

Windows 7 SP1 x64, FPC 3.0.0, Lazarus from trunk: http://svn.freepascal.org/svn/lazarus/trunk

CountIdentity, ModeClassName - good property naming
IdentityCount,  ClassNameMode  - bad property naming

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11930
  • FPC developer.
Re: GR32 installation
« Reply #3 on: November 06, 2024, 06:35:44 pm »
First go to your Project:  Project->Project Inspector

Then a window will popup with a tree view with the units in the project.

In that treeview, scroll down, and you will see "Required Packages". Right click on it and select add

staratel20

  • Full Member
  • ***
  • Posts: 213
Re: GR32 installation
« Reply #4 on: November 06, 2024, 07:10:15 pm »
I did it, but I can't see Add submenu (screen is attached)
« Last Edit: November 06, 2024, 07:24:25 pm by staratel20 »
Windows 7 SP1 x64, FPC 3.0.0, Lazarus from trunk: http://svn.freepascal.org/svn/lazarus/trunk

CountIdentity, ModeClassName - good property naming
IdentityCount,  ClassNameMode  - bad property naming

dseligo

  • Hero Member
  • *****
  • Posts: 1406
Re: GR32 installation
« Reply #5 on: November 06, 2024, 08:30:05 pm »
I did it, but I can't see Add submenu (screen is attached)

Right click on 'Required Packages', not below it.

You can also use add button on the top.

staratel20

  • Full Member
  • ***
  • Posts: 213
Re: GR32 installation
« Reply #6 on: November 06, 2024, 09:07:24 pm »
Thanks for the clarifications to all of you.

I did it, but got the next message (in attachment)
Windows 7 SP1 x64, FPC 3.0.0, Lazarus from trunk: http://svn.freepascal.org/svn/lazarus/trunk

CountIdentity, ModeClassName - good property naming
IdentityCount,  ClassNameMode  - bad property naming

wp

  • Hero Member
  • *****
  • Posts: 12457
Re: GR32 installation
« Reply #7 on: November 06, 2024, 11:35:05 pm »
GR32_DSGN_Lazarus is the designtime-time package which registers components, usually adds the palette icons or provides dedicated component and property editors - all this goes into the IDE, and you don't need that in your project.

So, simply select only the runtime package, GR32_Lazarus, in the New Requirement editor. Since you already have the designtime package in your project, right-click on GR32_DSGN_Lazarus in the project inspector tree and select "Remove".

How to detect whether a package is for designtime only? In the New Requirement list, you only have the name: there is usually a "DSGN", "Design", "D", or "DCL" (coming from Delphi) in the package name.

staratel20

  • Full Member
  • ***
  • Posts: 213
Re: GR32 installation
« Reply #8 on: November 07, 2024, 11:17:26 am »
I removed the DSGN package from the dependencies, but this (unsurprisingly) didn’t solve the issue of the IDE not finding GR32_Image. Finally, I started going through the examples and found that each example has an explicit path set to the GR32 Sources directory (Project - Project Options - Compiler Options - Paths - Other unit files). It seems this is the only way to make it work.



>>If it doesn't have a package, it is easiest to create a package, and add all your private paths to it.   

- if I understand correctly, I can do it myself, but the GR32 team didn’t do it because they can’t know where my GR32 installation directory will be
« Last Edit: November 07, 2024, 11:22:23 am by staratel20 »
Windows 7 SP1 x64, FPC 3.0.0, Lazarus from trunk: http://svn.freepascal.org/svn/lazarus/trunk

CountIdentity, ModeClassName - good property naming
IdentityCount,  ClassNameMode  - bad property naming

wp

  • Hero Member
  • *****
  • Posts: 12457
Re: GR32 installation
« Reply #9 on: November 07, 2024, 03:29:24 pm »
In Lazarus you normally should not add paths to external packages to the search path as you do in Delphi. Whenever a package is available add the package to the requirements of your project, as already mentioned by marcov. Since the package contains the path to its units, the IDE then will know it, too. If you don't do this you easily can end up in a situation in which your project does not compile.

I have installed the last version of Gr32 from Git (graphics32-master) ...
You mean the version from https://github.com/graphics32/graphics32? I cloned it, and found that it is not properly set up. In the designtime package it sets the path to the source units of the runtime package which results in the "duplicate compiled unit found", and when I fix this it still does not compile due to the error "Unable to find file "GR32_Blend.pass". I have been searching for more than an hour now and cannot find what they did wrong... I am giving up...

If you want a working version of Graphics32, open the Online Package manager from the "Package" menu, check the "pl_graphics32" entry and click "Install". Allow the IDE to rebuild itself. The process is finished when the IDE restarts. This package is maintained by the CodeTyphon project (which I normally do not use because they do not return their changes back to the main project - but anyway...). It is a bit older than the original github version.

 

TinyPortal © 2005-2018