Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: ... resource discarded..?


This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 10 - Last Post: Jan 20, 2018 8:11 PM Last Post By: Keith Latham Threads: [ Previous | Next ]
Guest
... resource discarded..?
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 12, 2017 4:24 PM
What is causing this:

[dcc32 Hint] H2161 Warning: Duplicate resource: Type 12 (CURSOR GROUP), ID 32763; File c:\program files (x86)\embarcadero\studio\19.0\lib\Win32\release\Controls.res resource kept; file c:\program files (x86)\embarcadero\studio\19.0\lib\Win32\release\FMX.Controls.Win.res resource discarded.

I have 5 of these in a row.
But I cannot find the files which could cause this?

Delphi 10.2.1, compiling for win32. When I compile for Android, no such issue.

Bart

--
Bart Kindt, CEO and developer
SARTrack Limited New Zealand
http://www.sartrack.co.nz/

Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: ... resource discarded..?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 12, 2017 4:51 PM   in response to: Guest in response to: Guest
Bart Kindt wrote:

What is causing this:

Isn't it obvious from the error message? Your project is linking to
two different .res files that define the same resource ID and type.
Resources in an executable cannot be duplicated, so the linker keeps
one and discards the other.

You probably shouldn't be linking to Controls.res in the first place,
only to FMX.Controls.Win.res.

But I cannot find the files which could cause this?

The error message tells you the exact files.

--
Remy Lebeau (TeamB)
Guest
Re: ... resource discarded..?
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 12, 2017 5:12 PM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
Remy Lebeau (TeamB) wrote:

You probably shouldn't be linking to Controls.res in the first place,
only to FMX.Controls.Win.res.

The error message tells you the exact files.

I cannot find any reference in any of my units to these .res files.
They must be referenced somewhere else, but I cannot find it, and I also cannot find any 'uses' clause which has the word 'controls' in it.
The warnings themselves do not tell me where this issue occurs.

In my EX7 this issue did not occur, it only shows in 10.2.

I simply cannot find where the problem is.

--
Bart Kindt, CEO and developer
SARTrack Limited New Zealand
http://www.sartrack.co.nz/
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: ... resource discarded..?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 12, 2017 8:17 PM   in response to: Guest in response to: Guest
Bart Kindt wrote:

I cannot find any reference in any of my units to these .res files.

Because they are not in YOUR units. Your project is using two units
that in turn reference the .res files.

They must be referenced somewhere else, but I cannot find it, and I
also cannot find any 'uses' clause which has the word 'controls' in
it.

They are likely in the 'uses' clause of other FMX units that you are
actually using in your code.

--
Remy Lebeau (TeamB)
Guest
Re: ... resource discarded..?
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 12, 2017 9:17 PM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
Remy Lebeau (TeamB) wrote:

They are likely in the 'uses' clause of other FMX units that you are
actually using in your code.

Yes, I understand that. But where are they.
Okay, I will have to go through every unit in every 'uses' unit in ALL the units in my App.

Which one (and this is just the main form)?
Any hints are welcome.

System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants,
  FMX.Types, FMX.Graphics, FMX.Controls, FMX.Forms, FMX.Dialogs, FMX.TabControl,
  FMX.StdCtrls, FMX.Gestures, FMX.Controls.Presentation, FMX.Edit, FMX.ListBox,
  DataU, FMX.Layouts, FMX.Memo,  FMX.EditBox,
  FMX.SpinBox, MessageHandlerU, FMX.NumberBox, System.IOUtils, FMX.pickers, FMX.Platform,
  DateUtils, FMX.Objects, System.Generics.Collections, FMX.VirtualKeyboard, FMX.Colors
  , IdGlobal
  {$IFDEF MSWINDOWS}
  ,Windows
  {$ENDIF}
  {$IFDEF ANDROID}
  , AndroidAPI.helpers, AndroidAPI.JNI, AndroidAPI.JNI.Location, Androidapi.JNIBridge
  , Androidapi.JNI.JavaTypes, Androidapi.JNI.Os, Androidapi.JNI.GraphicsContentViewText
  , VKControlManagerU, AndroidAPI.JNI.App
  {$ENDIF}
  , FMX.ListView.Types, FMX.ListView, FMX.DateTimeCtrls, System.Sensors,
  System.Sensors.Components, FMX.ExtCtrls, FMX.WebBrowser, FMX.Ani,
  System.Math.Vectors, FMX.MediaLibrary.Actions, FMX.StdActns, System.Actions,
  FMX.ActnList, FMX.Controls3D, System.Bluetooth, System.Bluetooth.Components,
  TNCU, Data.Bind.GenData, System.Rtti, System.Bindings.Outputs,
  Fmx.Bind.Editors, Data.Bind.EngExt, Fmx.Bind.DBEngExt, Data.Bind.Components,
  Data.Bind.ObjectScope, FMX.Grid, FMX.Grid.Style, FMX.ScrollBox;


--
Bart Kindt, CEO and developer
SARTrack Limited New Zealand
http://www.sartrack.co.nz/

Edited by: Bart Kindt on Sep 13, 2017 4:18 PM
Dave Nottage

Posts: 1,850
Registered: 1/7/00
Re: ... resource discarded..? [Edit]  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 13, 2017 12:31 AM   in response to: Guest in response to: Guest
Bart Kindt wrote:

TNCU, Data.Bind.GenData, System.Rtti, System.Bindings.Outputs,

What is in TNCU?

--
Dave Nottage [MVP, TeamB]
Find hints, tips and tricks at Delphi Worlds blog: http://www.delphiworlds.com
Guest
Re: ... resource discarded..? [Edit]
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 13, 2017 12:39 AM   in response to: Dave Nottage in response to: Dave Nottage
Dave Nottage wrote:

What is in TNCU?

uses Classes, SysUtils, IdGlobal
{$IFDEF MSWINDOWS}
  , Windows, ContNrs
{$ENDIF}
{$IFDEF ANDROID}
// , System.ByteStrings
, AndroidAPI.JNI.Location, System.Bluetooth, System.Bluetooth.Components
{$ENDIF}
, Types, System.Generics.Collections, UITypes, DataU, ToolsU;
 
---
{$IFDEF ANDROID}
uses SARTrackMemberU, SARExceptionU, MessageHandlerU, DecodeU;


// etc......

--
Bart Kindt, CEO and developer
SARTrack Limited New Zealand
http://www.sartrack.co.nz/
Dave Nottage

Posts: 1,850
Registered: 1/7/00
Re: ... resource discarded..? [Edit]  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 13, 2017 12:53 AM   in response to: Guest in response to: Guest
Bart Kindt wrote:

What is in TNCU?

uses Classes, SysUtils, IdGlobal
{$IFDEF MSWINDOWS}
  , Windows, ContNrs
{$ENDIF}
{$IFDEF ANDROID}
// , System.ByteStrings
, AndroidAPI.JNI.Location, System.Bluetooth, System.Bluetooth.Components
{$ENDIF}
, Types, System.Generics.Collections, UITypes, DataU, ToolsU;
 
---
{$IFDEF ANDROID}
uses SARTrackMemberU, SARExceptionU, MessageHandlerU, DecodeU;


// etc......

We could go on like this for a while. Bottom line: you need to find any units that have included VCL units (since your
project is FMX-based) in your project; specifically VCL units that include VCL.Controls, which is what ultimately links
Controls.res.

I'm having the same issue with some 3rd-party code at the moment; I just haven't bothered to track it down as yet
because I have more important things to work on than these warnings :-)

--
Dave Nottage [MVP, TeamB]
Find hints, tips and tricks at Delphi Worlds blog: http://www.delphiworlds.com
Brian Hamilton ...

Posts: 556
Registered: 10/14/04
Re: ... resource discarded..?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 13, 2017 2:11 AM   in response to: Guest in response to: Guest

[dcc32 Hint] H2161 Warning: Duplicate resource: Type 12 (CURSOR GROUP), ID 32763; File c:\program files (x86)\embarcadero\studio\19.0\lib\Win32\release\Controls.res resource kept; file c:\program files (x86)\embarcadero\studio\19.0\lib\Win32\release\FMX.Controls.Win.res resource discarded.

I get the same warning error for my VCL program (no FMX)
with Berlin

I just ignore it though, does not seem to affect anyything
Keith Latham


Posts: 2
Registered: 9/11/01
Re: ... resource discarded..?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 20, 2018 8:09 PM   in response to: Guest in response to: Guest
Guest wrote:
What is causing this:

[dcc32 Hint] H2161 Warning: Duplicate resource: Type 12 (CURSOR GROUP), ID 32763; File c:\program files (x86)\embarcadero\studio\19.0\lib\Win32\release\Controls.res resource kept; file c:\program files (x86)\embarcadero\studio\19.0\lib\Win32\release\FMX.Controls.Win.res resource discarded.

I have 5 of these in a row.
But I cannot find the files which could cause this?

Delphi 10.2.1, compiling for win32. When I compile for Android, no such issue.

Bart

--
Bart Kindt, CEO and developer
SARTrack Limited New Zealand
http://www.sartrack.co.nz/


I have found another 'culprit' causing this... after 3 hours of digging through all my units.

It seems that I put a component "TFDGUIxWaitCursor" in my main data module and set (or let default) the 'Provider' property to "FMX".

'Provider' can take on 3 values: 'FMX', 'Forms', and 'Console'. Clearly for a VCL application Provider should be set to 'Forms' - it was set to 'FMX' in my case.

Correcting this settings did away with the incorrect references and it now compiles cleanly.

Also the access violations I'm getting at shutdown are happening in the VCL.Controls code instead of the FMX.Platform.PlatformServices code. This should be a lot easier to track down than looking for a non-existent FMX control. I expect I'm just destroying something the system is trying to do for me.
Keith Latham


Posts: 2
Registered: 9/11/01
Re: ... resource discarded..?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 20, 2018 8:11 PM   in response to: Guest in response to: Guest
Guest wrote:
What is causing this:

[dcc32 Hint] H2161 Warning: Duplicate resource: Type 12 (CURSOR GROUP), ID 32763; File c:\program files (x86)\embarcadero\studio\19.0\lib\Win32\release\Controls.res resource kept; file c:\program files (x86)\embarcadero\studio\19.0\lib\Win32\release\FMX.Controls.Win.res resource discarded.

I have 5 of these in a row.
But I cannot find the files which could cause this?

Delphi 10.2.1, compiling for win32. When I compile for Android, no such issue.

Bart

--
Bart Kindt, CEO and developer
SARTrack Limited New Zealand
http://www.sartrack.co.nz/


I have found another 'culprit' causing this... after 3 hours of digging through all my units.

It seems that I put a component "TFDGUIxWaitCursor" in my main data module and set (or let default) the 'Provider' property to "FMX".

'Provider' can take on 3 values: 'FMX', 'Forms', and 'Console'. Clearly for a VCL application Provider should be set to 'Forms' - it was set to 'FMX' in my case.

Correcting this settings did away with the incorrect references and it now compiles cleanly.

Also the access violations I'm getting at shutdown are happening in the VCL.Controls code instead of the FMX.Platform.PlatformServices code. This should be a lot easier to track down than looking for a non-existent FMX control. I expect I'm just destroying something the system is trying to do for me.
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02