Re: [Lazarus] "Execute before" is executed after resource generation?

2024-05-23 Thread Luca Olivetti via lazarus

El 23/5/24 a les 21:46, Luca Olivetti via lazarus ha escrit:

El 23/5/24 a les 20:47, Marc Weustink via lazarus ha escrit:
In this case, don't use the project.res, but use your own. You can 
include multiple resource files. So you can generate it before.


I just followed the instructions here (and have been doing it for many 
years, even if this is the first time I tried to generate the file with 
"Execute before"):


https://wiki.freepascal.org/IDE_Window:_Project_Options#Resources

though it doesn't say exactly when it is regenerated ("depending on the 
actions taken in the IDE") it also says "it is therefore a good idea to 
add the files that are indicated here to the project file as well".


And even if I use a different rc file with {$R myspec.rc}, if the source 
file with the directive doesn't change it won't be automtically 
recompiled so no regeneration of the resource file would take place, 
even if one of the files in myspec.rc has changed, right?


Bye





Marc

On May 23, 2024 1:32:06 PM GMT+02:00, Luca Olivetti via lazarus 
 wrote:

El 23/5/24 a les 12:40, Mattias Gaertner via lazarus ha escrit:



On 5/22/24 15:03, Luca Olivetti via lazarus wrote:

Hello,

I'm trying to use the "Compiler commands" -> "Execute before" to 
generate a file that will be embedded as a resource in the 
executable, but it seems the command is executed after the 
resources are compiled (there's a message complaining that the file 
is not found and in fact when I execute the program the resource is 
not available).

Is there a way around it, other than executing the command manually?


If you mean the project .res file:
That is updated on save, which is independent of compile.


Ouch, so my projects that embed files as resources (and I also added 
those files to the project to be sure they're tracked by lazarus) are 
working by pure luck.
Or not, since a save happens anyway when the file is modified with 
the lazarus editor and I use compile or build, right?
What happens if I edit the file with an external editor, it's not 
currently opened in lazarus (so it won't prompt me to reload it) and 
I press compile/build/run? Will the .res be regenerated or not?
As I said, for the problem at hand I changed the logic, but I'd like 
to be sure that my project work by design and not by chance.


Bye





--
Luca Olivetti
Wetron Automation Technology https://wetron.es/
Tel. +34 93 5883004 (Ext.3010)  Fax +34 93 5883007

--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] "Execute before" is executed after resource generation?

2024-05-23 Thread Luca Olivetti via lazarus

El 23/5/24 a les 20:47, Marc Weustink via lazarus ha escrit:

In this case, don't use the project.res, but use your own. You can include 
multiple resource files. So you can generate it before.


I just followed the instructions here (and have been doing it for many 
years, even if this is the first time I tried to generate the file with 
"Execute before"):


https://wiki.freepascal.org/IDE_Window:_Project_Options#Resources

though it doesn't say exactly when it is regenerated ("depending on the 
actions taken in the IDE") it also says "it is therefore a good idea to 
add the files that are indicated here to the project file as well".


Bye




Marc

On May 23, 2024 1:32:06 PM GMT+02:00, Luca Olivetti via lazarus 
 wrote:

El 23/5/24 a les 12:40, Mattias Gaertner via lazarus ha escrit:



On 5/22/24 15:03, Luca Olivetti via lazarus wrote:

Hello,

I'm trying to use the "Compiler commands" -> "Execute before" to generate a 
file that will be embedded as a resource in the executable, but it seems the command is executed after 
the resources are compiled (there's a message complaining that the file is not found and in fact when 
I execute the program the resource is not available).
Is there a way around it, other than executing the command manually?


If you mean the project .res file:
That is updated on save, which is independent of compile.


Ouch, so my projects that embed files as resources (and I also added those 
files to the project to be sure they're tracked by lazarus) are working by pure 
luck.
Or not, since a save happens anyway when the file is modified with the lazarus 
editor and I use compile or build, right?
What happens if I edit the file with an external editor, it's not currently 
opened in lazarus (so it won't prompt me to reload it) and I press 
compile/build/run? Will the .res be regenerated or not?
As I said, for the problem at hand I changed the logic, but I'd like to be sure 
that my project work by design and not by chance.

Bye



--
Luca Olivetti
Wetron Automation Technology https://wetron.es/
Tel. +34 93 5883004 (Ext.3010)  Fax +34 93 5883007

--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] "Execute before" is executed after resource generation?

2024-05-23 Thread Marc Weustink via lazarus
In this case, don't use the project.res, but use your own. You can include 
multiple resource files. So you can generate it before.

Marc

On May 23, 2024 1:32:06 PM GMT+02:00, Luca Olivetti via lazarus 
 wrote:
>El 23/5/24 a les 12:40, Mattias Gaertner via lazarus ha escrit:
>> 
>> 
>> On 5/22/24 15:03, Luca Olivetti via lazarus wrote:
>>> Hello,
>>> 
>>> I'm trying to use the "Compiler commands" -> "Execute before" to generate a 
>>> file that will be embedded as a resource in the executable, but it seems 
>>> the command is executed after the resources are compiled (there's a message 
>>> complaining that the file is not found and in fact when I execute the 
>>> program the resource is not available).
>>> Is there a way around it, other than executing the command manually?
>> 
>> If you mean the project .res file:
>> That is updated on save, which is independent of compile.
>
>Ouch, so my projects that embed files as resources (and I also added those 
>files to the project to be sure they're tracked by lazarus) are working by 
>pure luck.
>Or not, since a save happens anyway when the file is modified with the lazarus 
>editor and I use compile or build, right?
>What happens if I edit the file with an external editor, it's not currently 
>opened in lazarus (so it won't prompt me to reload it) and I press 
>compile/build/run? Will the .res be regenerated or not?
>As I said, for the problem at hand I changed the logic, but I'd like to be 
>sure that my project work by design and not by chance.
>
>Bye
>
-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] lazarus 3.2 and qt5, cannot open anything

2024-05-23 Thread Luca Olivetti via lazarus

El 23/5/24 a les 16:11, Luca Olivetti via lazarus ha escrit:

El 23/5/24 a les 15:43, zeljko ha escrit:


No such error when using gtk2, but I prefer qt5.


It is KDE problem (probably bug), disable in IDE options -> Windows -> 
"IDE title shows project directory" and it'll work.


Thank you, I'll try that if it happens again.
Strangely enough, it doesn't happen (even with that option active) if I 
rebuild clean the ide for a different widgetset (I tried gtk2 and qt6) 
then rebuild it for qt5.


Spoke to soon: right after sending the email, I tried opening a file and 
the error reappeared.

Disabling the option solved it.

Bye
--
Luca Olivetti
Wetron Automation Technology https://wetron.es/
Tel. +34 93 5883004 (Ext.3010)  Fax +34 93 5883007

--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] lazarus 3.2 and qt5, cannot open anything

2024-05-23 Thread Luca Olivetti via lazarus

El 23/5/24 a les 15:43, zeljko ha escrit:


No such error when using gtk2, but I prefer qt5.


It is KDE problem (probably bug), disable in IDE options -> Windows -> 
"IDE title shows project directory" and it'll work.


Thank you, I'll try that if it happens again.
Strangely enough, it doesn't happen (even with that option active) if I 
rebuild clean the ide for a different widgetset (I tried gtk2 and qt6) 
then rebuild it for qt5.
When it happens if I just rebuild for qt5 (without changing the 
widgetset) it doesn't solve the problem.


Bye
--
Luca Olivetti
Wetron Automation Technology https://wetron.es/
Tel. +34 93 5883004 (Ext.3010)  Fax +34 93 5883007

--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] lazarus 3.2 and qt5, cannot open anything

2024-05-23 Thread zeljko via lazarus




On 23. 05. 2024. 10:37, Luca Olivetti via lazarus wrote:
As per the subject, if I compile the ide with qt5 I cannot open anything 
(projects, units, etc.), since the file open dialog gives an error 
(localizer, approximate translation) "cannot create worker KIO process. 
Couldn't create a socket to launch the KIO process for the 'tags' 
protocol".

No such error when using gtk2, but I prefer qt5.


It is KDE problem (probably bug), disable in IDE options -> Windows -> 
"IDE title shows project directory" and it'll work.


zeljko
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] "Execute before" is executed after resource generation?

2024-05-23 Thread Luca Olivetti via lazarus

El 23/5/24 a les 12:40, Mattias Gaertner via lazarus ha escrit:



On 5/22/24 15:03, Luca Olivetti via lazarus wrote:

Hello,

I'm trying to use the "Compiler commands" -> "Execute before" to 
generate a file that will be embedded as a resource in the executable, 
but it seems the command is executed after the resources are compiled 
(there's a message complaining that the file is not found and in fact 
when I execute the program the resource is not available).

Is there a way around it, other than executing the command manually?


If you mean the project .res file:
That is updated on save, which is independent of compile.


Ouch, so my projects that embed files as resources (and I also added 
those files to the project to be sure they're tracked by lazarus) are 
working by pure luck.
Or not, since a save happens anyway when the file is modified with the 
lazarus editor and I use compile or build, right?
What happens if I edit the file with an external editor, it's not 
currently opened in lazarus (so it won't prompt me to reload it) and I 
press compile/build/run? Will the .res be regenerated or not?
As I said, for the problem at hand I changed the logic, but I'd like to 
be sure that my project work by design and not by chance.


Bye

--
Luca Olivetti
Wetron Automation Technology https://wetron.es/
Tel. +34 93 5883004 (Ext.3010)  Fax +34 93 5883007

--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] lazarus 3.2 and qt5, cannot open anything

2024-05-23 Thread Luca Olivetti via lazarus

El 23/5/24 a les 12:58, Mattias Gaertner via lazarus ha escrit:



On 5/23/24 12:47, Luca Olivetti via lazarus wrote:

[...]

No, it's not supposed to be a GUI program.
I added it now, it compiles, but then I have the problem reported in 
the BGRAbitmap bugtracker (and I wonder why it compiled fine without 
the interfaces unit and the gtk2 widgetset).


I "solved" the "too many libraries" problem using the nogui widgetset.
It's a solution I'm not really comfortable with but it seems to work.
I wonder why, back when when I originally wrote the program with 
lazarus 2.0.12, neither the "interfaces" unit was needed nor the 
project pulled so many libraries.


Depends on what you use from BGRA and what that uses from the LCL.


I just use it to convert an image to jpeg and scale it to a fixed size, 
or to generate a jpeg image with a text in it.
The use case is to manage user's avatars from a web application, if an 
image is provided then it's used as the avatar, otherwise a dummy avatar 
is generated with the user's initials.



Most of the LCL requires the interfaces unit.


I understand that, what I don't understand is why I didn't need it with 
lazarus 2.0.12 (and why the program could be build with gtk2 even 
without the interfaces unit).



Keep in mind that the nogui widgetset is for most part an empty stub.


That's why I'm not really comfortable with it, though it seems to be 
enough for this application.


Bye
--
Luca Olivetti
Wetron Automation Technology https://wetron.es/
Tel. +34 93 5883004 (Ext.3010)  Fax +34 93 5883007

--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] lazarus 3.2 and qt5, cannot open anything

2024-05-23 Thread Mattias Gaertner via lazarus




On 5/23/24 12:47, Luca Olivetti via lazarus wrote:

[...]

No, it's not supposed to be a GUI program.
I added it now, it compiles, but then I have the problem reported in 
the BGRAbitmap bugtracker (and I wonder why it compiled fine without 
the interfaces unit and the gtk2 widgetset).


I "solved" the "too many libraries" problem using the nogui widgetset.
It's a solution I'm not really comfortable with but it seems to work.
I wonder why, back when when I originally wrote the program with lazarus 
2.0.12, neither the "interfaces" unit was needed nor the project pulled 
so many libraries.


Depends on what you use from BGRA and what that uses from the LCL.
Most of the LCL requires the interfaces unit.
Keep in mind that the nogui widgetset is for most part an empty stub.

Mattias

--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] lazarus 3.2 and qt5, cannot open anything

2024-05-23 Thread Luca Olivetti via lazarus

El 23/5/24 a les 12:33, Luca Olivetti via lazarus ha escrit:

El 23/5/24 a les 12:26, Marco van de Voort via lazarus ha escrit:


Op 23-5-2024 om 12:15 schreef Luca Olivetti via lazarus:



Warning: linker: /usr/bin/ld: 
/home/luca/Datos/laz_3_2/lcl/lib/LCLBase/3.2.2/x86_64-linux/Default/wsimglist.o: in function `REGISTERCUSTOMIMAGELISTRESOLUTION':
wsimglist.pp(265,0) Error: linker: undefined reference to 
`WSRegisterCustomImageListResolution'



BTW, this is related to

https://github.com/bgrabitmap/bgrabitmap/issues/253


Do you have the interfaces unit early in your .lpr USES list?



No, it's not supposed to be a GUI program.
I added it now, it compiles, but then I have the problem reported in the 
BGRAbitmap bugtracker (and I wonder why it compiled fine without the 
interfaces unit and the gtk2 widgetset).


I "solved" the "too many libraries" problem using the nogui widgetset.
It's a solution I'm not really comfortable with but it seems to work.
I wonder why, back when when I originally wrote the program with lazarus 
2.0.12, neither the "interfaces" unit was needed nor the project pulled 
so many libraries.


Bye

--
Luca Olivetti
Wetron Automation Technology https://wetron.es/
Tel. +34 93 5883004 (Ext.3010)  Fax +34 93 5883007

--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] "Execute before" is executed after resource generation?

2024-05-23 Thread Mattias Gaertner via lazarus




On 5/22/24 15:03, Luca Olivetti via lazarus wrote:

Hello,

I'm trying to use the "Compiler commands" -> "Execute before" to 
generate a file that will be embedded as a resource in the executable, 
but it seems the command is executed after the resources are compiled 
(there's a message complaining that the file is not found and in fact 
when I execute the program the resource is not available).

Is there a way around it, other than executing the command manually?


If you mean the project .res file:
That is updated on save, which is independent of compile.

Mattias

--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] lazarus 3.2 and qt5, cannot open anything

2024-05-23 Thread Luca Olivetti via lazarus

El 23/5/24 a les 12:26, Marco van de Voort via lazarus ha escrit:


Op 23-5-2024 om 12:15 schreef Luca Olivetti via lazarus:



Warning: linker: /usr/bin/ld: 
/home/luca/Datos/laz_3_2/lcl/lib/LCLBase/3.2.2/x86_64-linux/Default/wsimglist.o: in function `REGISTERCUSTOMIMAGELISTRESOLUTION':
wsimglist.pp(265,0) Error: linker: undefined reference to 
`WSRegisterCustomImageListResolution'



BTW, this is related to

https://github.com/bgrabitmap/bgrabitmap/issues/253


Do you have the interfaces unit early in your .lpr USES list?



No, it's not supposed to be a GUI program.
I added it now, it compiles, but then I have the problem reported in the 
BGRAbitmap bugtracker (and I wonder why it compiled fine without the 
interfaces unit and the gtk2 widgetset).


Bye

--
Luca Olivetti
Wetron Automation Technology https://wetron.es/
Tel. +34 93 5883004 (Ext.3010)  Fax +34 93 5883007

--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] lazarus 3.2 and qt5, cannot open anything

2024-05-23 Thread Marco van de Voort via lazarus



Op 23-5-2024 om 12:15 schreef Luca Olivetti via lazarus:



Warning: linker: /usr/bin/ld: 
/home/luca/Datos/laz_3_2/lcl/lib/LCLBase/3.2.2/x86_64-linux/Default/wsimglist.o: 
in function `REGISTERCUSTOMIMAGELISTRESOLUTION':
wsimglist.pp(265,0) Error: linker: undefined reference to 
`WSRegisterCustomImageListResolution'



BTW, this is related to

https://github.com/bgrabitmap/bgrabitmap/issues/253


Do you have the interfaces unit early in your .lpr USES list?


--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] lazarus 3.2 and qt5, cannot open anything

2024-05-23 Thread Luca Olivetti via lazarus

El 23/5/24 a les 12:01, Luca Olivetti via lazarus ha escrit:

El 23/5/24 a les 10:38, Luca Olivetti via lazarus ha escrit:

I rebuilt the ide again with qt5 and the problem is gone. Weird.


El 23/5/24 a les 10:37, Luca Olivetti via lazarus ha escrit:

Forgot to say, this is under debian 12 x86_64 with plasma desktop.


As per the subject, if I compile the ide with qt5 I cannot open 
anything (projects, units, etc.), since the file open dialog gives an 
error (localizer, approximate translation) "cannot create worker KIO 
process. Couldn't create a socket to launch the KIO process for the 
'tags' protocol".

No such error when using gtk2, but I prefer qt5.


But now I cannot build my (old) project, I get a bunch of linker errors 
from LCLBase regarding missing WSRegister* symbols, like



Warning: linker: /usr/bin/ld: 
/home/luca/Datos/laz_3_2/lcl/lib/LCLBase/3.2.2/x86_64-linux/Default/wsimglist.o: 
in function `REGISTERCUSTOMIMAGELISTRESOLUTION':
wsimglist.pp(265,0) Error: linker: undefined reference to 
`WSRegisterCustomImageListResolution'



BTW, this is related to

https://github.com/bgrabitmap/bgrabitmap/issues/253

Bye

--
Luca Olivetti
Wetron Automation Technology https://wetron.es/
Tel. +34 93 5883004 (Ext.3010)  Fax +34 93 5883007

--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] lazarus 3.2 and qt5, cannot open anything

2024-05-23 Thread Luca Olivetti via lazarus

El 23/5/24 a les 10:38, Luca Olivetti via lazarus ha escrit:

I rebuilt the ide again with qt5 and the problem is gone. Weird.


El 23/5/24 a les 10:37, Luca Olivetti via lazarus ha escrit:

Forgot to say, this is under debian 12 x86_64 with plasma desktop.


As per the subject, if I compile the ide with qt5 I cannot open 
anything (projects, units, etc.), since the file open dialog gives an 
error (localizer, approximate translation) "cannot create worker KIO 
process. Couldn't create a socket to launch the KIO process for the 
'tags' protocol".

No such error when using gtk2, but I prefer qt5.

Bye




--
Luca Olivetti
Wetron Automation Technology https://wetron.es/
Tel. +34 93 5883004 (Ext.3010)  Fax +34 93 5883007

--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] lazarus 3.2 and qt5, cannot open anything

2024-05-23 Thread Luca Olivetti via lazarus

El 23/5/24 a les 10:37, Luca Olivetti via lazarus ha escrit:

Forgot to say, this is under debian 12 x86_64 with plasma desktop.


As per the subject, if I compile the ide with qt5 I cannot open anything 
(projects, units, etc.), since the file open dialog gives an error 
(localizer, approximate translation) "cannot create worker KIO process. 
Couldn't create a socket to launch the KIO process for the 'tags' 
protocol".

No such error when using gtk2, but I prefer qt5.

Bye


--
Luca Olivetti
Wetron Automation Technology https://wetron.es/
Tel. +34 93 5883004 (Ext.3010)  Fax +34 93 5883007

--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


[Lazarus] lazarus 3.2 and qt5, cannot open anything

2024-05-23 Thread Luca Olivetti via lazarus
As per the subject, if I compile the ide with qt5 I cannot open anything 
(projects, units, etc.), since the file open dialog gives an error 
(localizer, approximate translation) "cannot create worker KIO process. 
Couldn't create a socket to launch the KIO process for the 'tags' protocol".

No such error when using gtk2, but I prefer qt5.

Bye
--
Luca Olivetti
Wetron Automation Technology https://wetron.es/
Tel. +34 93 5883004 (Ext.3010)  Fax +34 93 5883007
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] "Execute before" is executed after resource generation?

2024-05-23 Thread Luca Olivetti via lazarus

El 22/5/24 a les 15:03, Luca Olivetti via lazarus ha escrit:

Hello,

I'm trying to use the "Compiler commands" -> "Execute before" to 
generate a file that will be embedded as a resource in the executable, 
but it seems the command is executed after the resources are compiled 
(there's a message complaining that the file is not found and in fact 
when I execute the program the resource is not available).

Is there a way around it, other than executing the command manually?


never mind, now I generate the file inside my program.

Bye
--
Luca Olivetti
Wetron Automation Technology https://wetron.es/
Tel. +34 93 5883004 (Ext.3010)  Fax +34 93 5883007

--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus