× General Purpose Components and Libraries, discussions, problems and suggestions

Question Duplicate unit UniqueInstanceRaw

  • Avra
  • Topic Author
  • Visitor
  • Visitor
4 years 2 months ago - 4 years 2 months ago #9697 by Avra
Duplicate unit UniqueInstanceRaw was created by Avra
If I add pl_luicontrols to Project Inspector and put UniqueInstance component on my form, if I want raw check for another application instance at the very beginning of LPR file by testing for InstanceRunning like this:
if InstanceRunning then      // described at http://wiki.freepascal.org/UniqueInstance#How_To_Use_.28Raw.29
    Exit;

then I am forced to use unit uniqueinstanceraw like this (adding pl_luicontrols package was not enough to recognize InstanceRunning):
uses
  uniqueinstanceraw in 'c:\codetyphon\typhon\components\pl_LuiControls\source\uniqueinstance\uniqueinstanceraw.pas';

After that IDE gives me these hints:

Messages, Hints: 2
Note: Duplicate unit "uniqueinstanceraw" in "pl_luicontrols 5.5.2", source="C:\codetyphon\typhon\components\pl_LuiControls\source\uniqueinstance\uniqueinstanceraw.pas"
Note: Duplicate unit "uniqueinstanceraw" in "L1toOracle", orphaned ppu "M:\Lazarus Projects\L1toOracle\lib\i386-win32\uniqueinstanceraw.ppu"


What needs to be done to solve this duplicate unit problem?
Last edit: 4 years 2 months ago by Avra.

Please Log in or Create an account to join the conversation.

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Away
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
More
4 years 2 months ago - 4 years 2 months ago #9698 by Sternas Stefanos
Replied by Sternas Stefanos on topic Duplicate unit UniqueInstanceRaw
Sir
Did you have in your project options the path of pl_LuiControls ?

1) You can declare in your project, pl_LuiControls as need package,
In this case the CT-FPC use “ppu” from pl_LuiControls/lib/ directory.

2) You can add in your “project options” the path for pl_LuiControls
in this case the CT-FPC will build pl_LuiControls ppu in your project “ppu” out path.

You can’t use both methods at the same time,
because the CT-FPC compiler found in project paths the same ppu 2 times...
it's logical :)

My suggestion is to use the first one.
and delete or clear old “ppu” files from your project out directory

PS: Please always use the latest CT version Stable 5.70 or LAB 5.80

PilotLogic Architect and Core Programmer
Last edit: 4 years 2 months ago by Sternas Stefanos.

Please Log in or Create an account to join the conversation.

  • Avra
  • Topic Author
  • Visitor
  • Visitor
4 years 2 months ago - 4 years 2 months ago #9709 by Avra
Replied by Avra on topic Duplicate unit UniqueInstanceRaw

Sternas Stefanos wrote: Sir
Did you have in your project options the path of pl_LuiControls ?

No (see Lui1 screenshot). I have added pl_LuiControls to ProjectInspector (Lui2 screenshot).

1) You can declare in your project, pl_LuiControls as need package,
In this case the CT-FPC use “ppu” from pl_LuiControls/lib/ directory.

I did as you can see in Lui3 screenshot, but then InstanceRunning from "uniquesinstanceraw.pas" is not found and compiler errors.

2) You can add in your “project options” the path for pl_LuiControls
in this case the CT-FPC will build pl_LuiControls ppu in your project “ppu” out path.

This shouldn't be needed if I have added a package, right?

You can’t use both methods at the same time

I think I didn't. Look at Lui3 and Lui4 screnshots.

My suggestion is to use the first one.
and delete or clear old “ppu” files from your project out directory

That was what I originally did, but I get error in Lui3 screenshot.

Please always use the latest CT version Stable 5.70 or LAB 5.80

Everything mentioned is running on latest CT LAB 5.80 on WinXP SP3.
Attachments:
Last edit: 4 years 2 months ago by Avra.

Please Log in or Create an account to join the conversation.