* * *

Author Topic: Fatal: Cannot find xxxxx unit  (Read 259 times)

daringly

  • New member
  • *
  • Posts: 31
Fatal: Cannot find xxxxx unit
« on: September 12, 2017, 04:53:11 pm »
I developed a math unit, and had been sharing it with other programmers. It compiled correctly, and was integrated into their software for the last year with no problems.

I upgraded to Windows 10 and reinstalled Lazarus. When I recompile the unit and copy it over, the teammate (using Windows 7 Enterpise) started getting this error: "Fatal: Cannot find xxxxx used by ... Make sure all ppu files of the package are in its output directory.

When we copied the older version of the unit (compiled on my machine under Windows 7), we didn't get an error. The code is the same in both versions, and the size is the same as well.

Has anyone experienced an issue compiling a unit under Windows 10, and including it in Windows 7?

wp

  • Hero Member
  • *****
  • Posts: 3894
Re: Fatal: Cannot find xxxxx unit
« Reply #1 on: September 12, 2017, 05:07:56 pm »
Is that unit part of a package? If not, create a run-time package, open and compile it ("Package" > "Open package file" > "Compile"), then the IDE knows where the compiled units of this package can be found. Packages are the recommended way to share units between various projects.

If you don't want to use a package add the unit to the project ("Project inspector" > "Add" > "Add files from file system"). I observed lots of "unit not found" messages if the unit's path is just added to the seach path ("Project options" > "Paths" > "Other unit files").

But usually I work with packages.
Lazarus trunk / fpc 3.0.4 / all 32-bit on Win-10

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3201
  • I like bugs.
Re: Fatal: Cannot find xxxxx unit
« Reply #2 on: September 12, 2017, 06:31:49 pm »
Yes, packages are the way to share code between Lazarus projects. The project search path must not be used for that.
This is different from Delphi which usually adds all library paths to it's global search path, thus polluting the namespace for all projects.

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus