Recent

Author Topic: Warning: other unit files search path (aka unit path) of "MyPackage" contains ..  (Read 4033 times)

bobonwhidbey

  • Hero Member
  • *****
  • Posts: 586
    • Double Dummy Solver - free download
I get this error message with every compile now. Yes, I have a component in MyPackage that uses a pointer to another component. Is this a bad idea? Can I (or should I if I can) remove this error message.
Lazarus 3.0RC2, FPC 3.2.2 x86_64-win64-win32/win64

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9754
  • Debugger - SynEdit - and more
    • wiki
I have a component in MyPackage that uses a pointer to another component. Is this a bad idea?
This is an extremely bad idea.

If you use units from another package, add that package to your packages dependencies.

Remove any path config you added.

Well yes, it is possible to do something like this with pathes. But it needs a lot of knowledge, including knowledge off *ALL* other packages, and checking *ALL* of them whenever you do updates.
In short: It is almost guaranteed to go wrong.

If it goes wrong, you get duplicate ppu files. Some of them will get outdated. You will get random errors in your application. (because it runs code, that you don't even have anymore.)

-----------
Once you removed the path config, go to your packages folder, and delete all .ppu and .o files.
(Or try forcing a "clean" build)

Thaddy

  • Hero Member
  • *****
  • Posts: 14164
  • Probably until I exterminate Putin.
Is this a bad idea?
Basically you gave the answer yourself. Combine the code into the same package or add the dependency. The latter may not even always work. Martin is right.
Specialize a type, not a var.

bobonwhidbey

  • Hero Member
  • *****
  • Posts: 586
    • Double Dummy Solver - free download
The warning message ends with ...contains "c:\lazarus\components\rtticontrols", which belongs to package "RunTimeTypeInfoControls"

The "RunTimeTypeInfoControls" package contains just two .pas file, rttictrls.pas and rttigrids.pas. I would have expected to find at least one unit in MyPackage with one of these rtti files mentioned in the Uses statement. But I don't. Also, MyPackage compiles, and installs, whether or not I include RunTimeTypeInfoControls in the RequiredPackages.

In summary, I have been unable to figure out how to remove this warning. How to find the unit with the offending code/unit. What should I be looking for?
Lazarus 3.0RC2, FPC 3.2.2 x86_64-win64-win32/win64

Thaddy

  • Hero Member
  • *****
  • Posts: 14164
  • Probably until I exterminate Putin.
Insufficient separation of run-time and design-time code.
Specialize a type, not a var.

bobonwhidbey

  • Hero Member
  • *****
  • Posts: 586
    • Double Dummy Solver - free download
You suggested that I combine the code into the same package. I'm trying to figure out exactly what code is causing the problem. Wouldn't that code have something to do with the rttictrl.pas or rttigrids.pas files?
Lazarus 3.0RC2, FPC 3.2.2 x86_64-win64-win32/win64

del

  • Sr. Member
  • ****
  • Posts: 258
Same problem here. I think the idea is they want you to add the entire library as a dependency (makes sense - let the package police itself) instead of cherry-picking files from within the library. So I removed the file dependency (Project Inspector - Files):
 
~/.lazarus/onlinepackagemanager/packages/bgrabitmap-master/bgrabitmap/bgrabitmap.pas

And added the full library (Project Inspector - Required Packages) BGRABitmapPack. Works for me. Got rid of the warning. Unfortunately, even though I have laz_synapse 40.1 installed, and it's a required package (Project Inspector - Required Packages), I still need to explicitly path to:

~/.lazarus/onlinepackagemanager/packages/synapse-40.1/ssl_openssl.pas

Or it won't be found by the compiler. Also - perhaps related - is the fact that the file ssl_openssl.pas is not "exposed" when you click on the laz_synapse icon in the Required Packages section. So there's some weirdness going on inside the Synapse package that's hiding ssl_openssl.pas from the compiler. The other ones I need (like httpsend.pas) are exposed when you click on the icon. So I'm stuck with the warning:

Warning: other unit files search path (aka unit path) of ... contains "... /.lazarus/onlinepackagemanager/packages/synapse40.1", which belongs to package "laz_synapse"

But it's always a bit of a dance to get the Synapse internet stuff up and running. I'm good.

del

  • Sr. Member
  • ****
  • Posts: 258
OK. Figured it out. To get rid of the need for the explicit path to

~/.lazarus/onlinepackagemanager/packages/synapse-40.1/ssl_openssl.pas

I had to "Add" ssl_openssl.pas to the synapse-40.1 package, even though it was already IN the package. IOW it was already present among the several files included in the distribution / installation of the synapse-40.1. But the compiler was unable to "see" it until I went through the dance of "adding" it to its own package. If this makes no sense to you - don't feel bad. Join the party. See attached. Cool. This solved another issue - but that's discussed on another thread.

wp

  • Hero Member
  • *****
  • Posts: 11830
I had to "Add" ssl_openssl.pas to the synapse-40.1 package, even though it was already IN the package. IOW it was already present among the several files included in the distribution / installation of the synapse-40.1. But the compiler was unable to "see" it until I went through the dance of "adding" it to its own package.
I guess it would have been enough to just recompile (or clean recompile) the package. I've never seen such a behavior.

del

  • Sr. Member
  • ****
  • Posts: 258
Nope. It had nothing to do with build residue. It's an idiosyncrasy of the synapse-40.1 package.

 

TinyPortal © 2005-2018