Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2022-04

Unable to find resource

6 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Marc Weustink

Hi,

On a project I'm working on I needed to refactor some units. After I finished, I got a linking error about a duplicate resource. Maybe accidentally a stale one got linked, so I removed 2 occurrences. And now the compiler complains it cannot find the resource.

The (edited) output:
(9022) Compiling resource C:\Users\marc\x\x_service.rc (9028) Calling resource compiler
"C:\lazarus\fpc\3.2.2\bin\x86_64-win64\windres.exe" with "--preprocessor=C:\lazarus\fpc\3.2.2\bin\x86_64-win64\cpp.exe --include C:\lazarus\fpc\3.2.2\bin\x86_64-win64\ -O res -D FPC -o C:\Users\marc\x\x_service.res C:/Users/marc/x/x_service.rc" as command line ...
Debug: parsing command line parameters
Debug: parsing parameter '-o'
Debug: parsing parameter '-a'
Debug: parsing parameter '-of'
Debug: parsing parameter '-v'
Debug: parsing parameter '@C:\Users\marc\x\x.reslst' Debug: parsing parameter 'C:\lazarus\lcl\units\x86_64-win64\cursors.res' Debug: parsing parameter 'C:\lazarus\lcl\units\x86_64-win64\btn_icons.res' Debug: parsing parameter
'C:\lazarus\lcl\units\x86_64-win64\dialog_icons.res' Debug: parsing parameter '.\lib\x86_64-win64\x_service.res' Debug: parsing parameter 'C:\Users\marc\x\x_service.res' Debug: parsing parameter 'x.res'
Debug: parsing parameter 'x_version.res'
Debug: target set to x86_64 - coff
Debug: finished parsing command line parameters
...
Debug: Trying to open file .\lib\x86_64-win64\x_service.res... Error: Can't open file '.\lib\x86_64-win64\x_service.res' C:\Users\marc\x\x.dpr(45,1) Error: (9029) Error while compiling resources (9015) Linking C:\Users\marc\x\x.exe
C:\Users\marc\x\x.dpr(45,1) Fatal: (10026) There were 1 errors compiling module, stopping
Fatal: (1018) Compilation aborted

As you see, x_service.res is build in C:\Users\marc\x. So my question is where does the line '.\lib\x86_64-win64\x_service.res' come from

(and I wonder how did it compile the past years)

Marc

Reply by email

Marco van de Voort
to Marc Weustink
Marc Weustink wrote 8 lines
On a project I'm working on I needed to refactor some units. After I finished, I got a linking error about a duplicate resource. Maybe accidentally a stale one got linked, so I removed 2 occurrences. And now the compiler complains it cannot find the resource. Debug: parsing parameter '.\lib\x86_64-win64\x_service.res' Debug: parsing parameter 'C:\Users\marc\x\x_service.res'

Well that is duplicate obviously.

Maybe you did some manual cmdline build that left a .res in the working dir , and your project has a stale {$R *.res} in the .dpr ?

Reply by email

Marc Weustink
to Marco van de Voort
Marco van de Voort wrote 12 lines
On 22-4-2022 09:12, Marc Weustink via fpc-devel wrote: > > On a project I'm working on I needed to refactor some units. After I > finished, I got a linking error about a duplicate resource. Maybe > accidentally a stale one got linked, so I removed 2 occurrences. > And now the compiler complains it cannot find the resource. > Debug: parsing parameter '.\lib\x86_64-win64\x_service.res' > Debug: parsing parameter 'C:\Users\marc\x\x_service.res' Well that is duplicate obviously.

That was the original problem, so I removed the versions from both locations. In the output you see that the new version is build as 'C:\Users\marc\x\x_service.res'

the '.\lib\x86_64-win64\x_service.res' is not build, hence my question, why is it tried to link that one ?

Maybe you did some manual cmdline build that left a .res in the working dir , and your project has a stale {$R *.res} in the .dpr ?

I do have a {$R *.res}, iirc this should link x.res (which you can see in the files passed)

Marc

Reply by email

Marc Weustink
to Marc Weustink

OK,
I stashed my changes and compiled the previous version of the software without problems. '.\lib\x86_64-win64\x_service.res' is not linked, so somewhere my changes have triggered it.

To be continued...

Marc

Marc Weustink wrote 34 lines
On 22-4-2022 09:55, Marco van de Voort via fpc-devel wrote: > > On 22-4-2022 09:12, Marc Weustink via fpc-devel wrote: >> >> On a project I'm working on I needed to refactor some units. After I >> finished, I got a linking error about a duplicate resource. Maybe >> accidentally a stale one got linked, so I removed 2 occurrences. >> And now the compiler complains it cannot find the resource. > >> Debug: parsing parameter '.\lib\x86_64-win64\x_service.res' >> Debug: parsing parameter 'C:\Users\marc\x\x_service.res' > > Well that is duplicate obviously. That was the original problem, so I removed the versions from both locations. In the output you see that the new version is build as 'C:\Users\marc\x\x_service.res' the '.\lib\x86_64-win64\x_service.res' is not build, hence my question, why is it tried to link that one ? > Maybe you did some manual cmdline build that left a .res in the > working dir , and your project has a stale {$R *.res} in the .dpr ? I do have a {$R *.res}, iirc this should link x.res (which you can see in the files passed) Marc _______________________________________________ fpc-devel maillist  -  https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply by email

Marc Weustink
to Marc Weustink

OK, stash pop. You would think the problems should be the back... Yes they are, only different:

Debug: parsing parameter 'x_service.res'
Debug: parsing parameter 'x_service.res'
Debug: parsing parameter 'x.res'
Debug: parsing parameter 'x_version.res'

x_service.res is added twice, now from the same location.

To be continued...

Marc Weustink wrote 48 lines
OK, I stashed my changes and compiled the previous version of the software without problems. '.\lib\x86_64-win64\x_service.res' is not linked, so somewhere my changes have triggered it. To be continued... Marc On 22-4-2022 10:09, Marc Weustink via fpc-devel wrote: > > > On 22-4-2022 09:55, Marco van de Voort via fpc-devel wrote: >> >> On 22-4-2022 09:12, Marc Weustink via fpc-devel wrote: >>> >>> On a project I'm working on I needed to refactor some units. After I >>> finished, I got a linking error about a duplicate resource. Maybe >>> accidentally a stale one got linked, so I removed 2 occurrences. >>> And now the compiler complains it cannot find the resource. >> >>> Debug: parsing parameter '.\lib\x86_64-win64\x_service.res' >>> Debug: parsing parameter 'C:\Users\marc\x\x_service.res' >> >> Well that is duplicate obviously. > > That was the original problem, so I removed the versions from both > locations. In the output you see that the new version is build as > 'C:\Users\marc\x\x_service.res' > > the '.\lib\x86_64-win64\x_service.res' is not build, hence my > question, why is it tried to link that one ? > >> Maybe you did some manual cmdline build that left a .res in the >> working dir , and your project has a stale {$R *.res} in the .dpr ? > > I do have a {$R *.res}, iirc this should link x.res (which you can see > in the files passed) > > Marc > > _______________________________________________ > fpc-devel maillist  -  > https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel _______________________________________________ fpc-devel maillist  -  https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply by email

Marc Weustink
to Marc Weustink

Solved....

One of the changes I made was a rename of the unit where the resource is included. And there was still one unit using the old name (and the old ppu/o could be found)

Sorry for the noise,
Marc

Marc Weustink wrote 64 lines
OK, stash pop. You would think the problems should be the back... Yes they are, only different: Debug: parsing parameter 'x_service.res' Debug: parsing parameter 'x_service.res' Debug: parsing parameter 'x.res' Debug: parsing parameter 'x_version.res' x_service.res is added twice, now from the same location. To be continued... On 22-4-2022 10:36, Marc Weustink via fpc-devel wrote: > OK, > I stashed my changes and compiled the previous version of the software > without problems. '.\lib\x86_64-win64\x_service.res' is not linked, so > somewhere my changes have triggered it. > > To be continued... > > Marc > > > On 22-4-2022 10:09, Marc Weustink via fpc-devel wrote: >> >> >> On 22-4-2022 09:55, Marco van de Voort via fpc-devel wrote: >>> >>> On 22-4-2022 09:12, Marc Weustink via fpc-devel wrote: >>>> >>>> On a project I'm working on I needed to refactor some units. After >>>> I finished, I got a linking error about a duplicate resource. Maybe >>>> accidentally a stale one got linked, so I removed 2 occurrences. >>>> And now the compiler complains it cannot find the resource. >>> >>>> Debug: parsing parameter '.\lib\x86_64-win64\x_service.res' >>>> Debug: parsing parameter 'C:\Users\marc\x\x_service.res' >>> >>> Well that is duplicate obviously. >> >> That was the original problem, so I removed the versions from both >> locations. In the output you see that the new version is build as >> 'C:\Users\marc\x\x_service.res' >> >> the '.\lib\x86_64-win64\x_service.res' is not build, hence my >> question, why is it tried to link that one ? >> >>> Maybe you did some manual cmdline build that left a .res in the >>> working dir , and your project has a stale {$R *.res} in the .dpr ? >> >> I do have a {$R *.res}, iirc this should link x.res (which you can >> see in the files passed) >> >> Marc >> >> _______________________________________________ >> fpc-devel maillist  -  >> https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel > _______________________________________________ > fpc-devel maillist  -  > https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel _______________________________________________ fpc-devel maillist  -  https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply by email