Forum > Designer

"Error: Unit Not Found" when adding event in Object Inspector

<< < (2/2)

cdbc:
Hi
I use FPC/Lazarus on more PCLinuxOS-kde/QT computers for years now, with only the occasional rebuild of Qt4Pas/Qt5Pas*) library, counting as errors, otherwise no errors  ;)
*) Mostly due to a rolling release and the distro updating the library with an older one  %) :P
<edit:> FPC = 3.2.2 & Laz = 2.2.6, both release versions. my own  libQt5Pas.so
Regards Benny

DarkBlueMonkey:
Ah ok..  That sounds like Mandrake-derived.   Good to know it works there.  I've got it on Mint, so I've just installed the standard apt packages from the Ubuntu archives... It's possible there may be a folder error or naming error, so looking for anyone that's running it on Ubuntu-derived Linuces :)

Interesting to hear about PCLinuxOS though... I've never heard of it before! Thanks!

cdbc:
Hi
Come to think of it, it's not the first time, I see something about Linux Mint and Lazarus, in this forum... Especially with regards to Ubuntu/Mint's way of working with the different packages of fpc/laz and the problems thereof. IRC, it can be a bit challenging to get them to work properly without installing from source etc... So, definitely, there are people here on the forum that knows about these troubles and how to get it all to play nice together, maybe @zeljko or @dbannon, they're both usually in the know, Linux-wise as well as pascal  ;)
Try searching this forum, for Linux Mint / Installation / packages.
I distro-hopped Mint once many years ago, and quite liked it, but the Mandrake derived PCLinuxOS won that race and I haven't looked back since  :D :-X
Regards Benny

Diverod:
I'm new to Lazarus, Free Pascal and Ubuntu 22.04.

I have this issue often and I just save and exit Lazarus, restart Lazarus, go back and add the event again and it has always worked after that for an undermined amount of time.

Lazarus loads so quick and keeps track of my last position so well that I've not pursued trying to find out why it does this for me. I don't have enough experience to be of any real help on a resolution, so hope this might help some.

JuhaManninen:
It does not sound like a Linux distro specific problem.
My guess is that you run "lazarus" binary instead of "startlazarus". It runs to original IDE version which does not have the newly installed packages.
You installed Lazarus into a write-protected directory, thus it must rebuild itself into your local configuration directory (usually ~/.lazarus).
Then "startlazarus" is clever enough to run the right binary.
See:
 https://wiki.freepascal.org/Unit_not_found_-_How_to_find_units
As you can see, the compiler and the IDE find units in a different way. Your code compiles and only the IDE has a problem.
The wiki page does not even mention running "lazarus" instead of "startlazarus" as a potential cause for problems. Please test it. Then if it helped, it can be added to the page.

I can also recommend getting Lazarus sources from GitLab into a writable directory and building it there ("make").
Then the "lazarus" binary can be started and rebuilt directly without worries about write-protection.
It has many benefits, like:
- You can "git pull" the latest bug fixes and updates any time.
- It prevents having duplicate compiler generated files when they are all compiled in one place.
- You can easily switch between Lazarus versions, eg. "git switch fixes_3_0", "git switch main". (Use the --pcp= parameter when running). This is especially useful now that Lazarus 3.0 release has not happened yet.
- It allows you to participate in Lazarus development which all happens in the "main" branch. Build the IDE with debug info, fix a bug, commit into your local Git branch, then generate a patch: "git format-patch main".

I myself use Lazarus built from sources under Manjaro Linux.

Navigation

[0] Message Index

[*] Previous page

Go to full version