Can not control compiling with or without enabeling themes. lazarus / 34-Windows ---------------------------------------------------------------------- han · 2024-05-19 10:21 My application is normally compiled in a version with enabled themes and without enabled themes. Currently I have no control over this behavior. Sometimes it compiles with themes enabled sometimes without.  The setting in the project options is ignored. This happens using Lazarus 3.2 and 2.24. Is seems related to my application. Testing an example program does not show this problem. Anybody an idea what could cause this? Where to look? ---------------------------------------------------------------------- dsiders · 2024-05-19 19:43 Quote from: han on May 19, 2024, 12:21:16 pmMy application is normally compiled in a version with enabled themes and without enabled themes. Currently I have no control over this behavior. Sometimes it compiles with themes enabled sometimes without.  The setting in the project options is ignored. This happens using Lazarus 3.2 and 2.24. Is seems related to my application. Testing an example program does not show this problem. Anybody an idea what could cause this? Where to look? Look at the Project Options > Use manifest resource (and enable themes) check box. Checked for theme. Unchecked for no theme. ---------------------------------------------------------------------- han · 2024-05-26 10:52 Quote  Look at the Project Options > Use manifest resource (and enable themes) check box. Checked for theme. Unchecked for no theme. Yes I have used that for years but the compiler doesn't follow this check-mark anymore. I'm flabbergasted. I use two *.lpi Lazarus files for two versions of my program. Sometimes I get two programs with themes enabled. Sometimes two programs with themes disabled. I tried to delete *.ppu, *.ppl. *.o and the executable between compiling the second version but it doesn't help. If I check or uncheck themes in the IDE, project options it doesn't work always. It looks random to me. ---------------------------------------------------------------------- KodeZwerg · 2024-05-26 11:27 I am unsure if it helps and if I understood, so here is what I do: - open project - change option(s), including your problematic one - save project - build project [SHIFT-F9] (not compile) - test project (run) I assume you do just run/F9/compile to test, that way the resources are not recompiled all-the-time correct so it uses an old one where the changes arent updated yet. ---------------------------------------------------------------------- han · 2024-05-26 15:21 In tried almost everything including clean up and build. Still it stubborn sometimes enable themes always sometimes not. For example i have prepared two application.lpi files. So application.lpi and application_themes.lpi If I compile them as d:\lazarus\lazbuild -B application.lpi d:\lazarus\lazbuild -B application_themes.lpi Sometimes both commands produce an application with themes enabled sometimes not. Deleting the executable between the compiling test doesn't help. The application with themes enabled is about 2 kbyte larger.  But I'm not ware if there is any log lines showing the enabling themes is successful/done. Above problem is repeatable in the IDE. But toggeling the option seems to help. If themes is disabled this is missing in the *.lpi: Since toggling helps, I have the impression that the themes enabling is stored at an other location then the *.lpi or *.lpr file. Deleting the application.res doesn't help. ---------------------------------------------------------------------- han · 2024-05-26 15:54 The problem becomes clearer.  Using the same source I have two configuration sets: application.lpi application.lpr application_themes.lpi application_themes.lpr They differ in the *.lpi file only by However that doesn't seems to control the compiling with or without themes. It is somewhere else stored.  So if the themes is disabled and I open application_themes.lpi then themes look enabled but it doesn't work. Only if I do the following toggeling it works: Disable themes Build Enable themes Build, run ---------------------------------------------------------------------- han · 2024-05-26 17:32 I have found the solution. In the .lpi file there is a link to the .lpr file. If I modify in application_themes.lpi the link as follows: - + Then the problem is gone. The option themes=enabled add to the .lpr file the following line: {$R *.res}  This seems to enable themes. If check-mark themes is disabled this {$R *.res}  is removed again. So just ensure in the .lpi the correct .lpr is specified. That's all.