Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2016-01

Cannot find unit lNet when building project

15 messages · 4 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Bo Berglund

I have a test project that I try to run using 1.6RC2. In the source editor I can right click the uses line where lNet is specified and select "Find declaration" and it opens the unit in a new tab.
But when I try to build the project there is a message: Fatal: Cannot find lNet used by....

What could be the problem? Obviously Lazarus knows how to find the unit and still the compile fails...

Bo Berglund Developer in Sweden

Reply by email

Mattias Gaertner
to Bo Berglund
Show quoted text 9 lines
I have a test project that I try to run using 1.6RC2. In the source editor I can right click the uses line where lNet is specified and select "Find declaration" and it opens the unit in a new tab. But when I try to build the project there is a message: Fatal: Cannot find lNet used by.... What could be the problem? Obviously Lazarus knows how to find the unit and still the compile fails...

Did you install lnet via fppkg?
Maybe you updated your compiler and forgot to update lnet? Also check that you have only one lnet.ppu.

Mattias

Reply by email

Bo Berglund
to Mattias Gaertner
Mattias Gaertner wrote 6 lines
On Fri, 15 Jan 2016 11:53:25 +0100 Bo Berglund wrote: > But when I try to build the project there is a message: > Fatal: Cannot find lNet used by.... Did you install lnet via fppkg?

No, I did not install it. This is one of the first tests following download and build (bigide) of RC2. Seems like the IDE finds the files without any need for installation....
Do I have to install non-visuel components in Lazarus? I usually create the objects in code anyway and my test program is a console (non-gui) program.

Maybe you updated your compiler and forgot to update lnet?

Same compiler as before (3.0.0)
And the IDE picks up the source unit from:
/usr/fpc/3.0.0/utils/fppkg/lnet/lnet.pp

Also check that you have only one lnet.ppu.

I only have fpc 3.0.0 plus the seed 2.6.4 on this computer (Raspberry Pi2). I don't know where the lnet.ppu file would be located...

Bo Berglund Developer in Sweden

Reply by email

Bo Berglund
to Bo Berglund
Bo Berglund wrote
>Did you install lnet via fppkg? No, I did not install it. This is one of the first tests following download and build (bigide) of RC2. Seems like the IDE finds the files without any need for installation....

Furthermore:
I had a look in Lazarus RC2 and I could not even find the lNet package listed among the ones that could be installed/uninstalled. Nothing in the "Installed" list and nothing in "Available for installation" either.

So I don't even know how one could install this package...

I am still wondering why it won't compile when the IDE clearly finds the unit file?

Bo Berglund Developer in Sweden

Reply by email

Mattias Gaertner
to Bo Berglund: On Fri, 15 Jan 2016 11:58:40 +0100, Mattias Gaertner No, I did not install it. This is…
Show quoted text 12 lines
On Fri, 15 Jan 2016 11:58:40 +0100, Mattias Gaertner wrote: >On Fri, 15 Jan 2016 11:53:25 +0100 >Bo Berglund wrote: >> But when I try to build the project there is a message: >> Fatal: Cannot find lNet used by.... > >Did you install lnet via fppkg? No, I did not install it. This is one of the first tests following download and build (bigide) of RC2. Seems like the IDE finds the files without any need for installation....

"lnet" is a normal unit of FPC.
Compile with -vut to see where the compiler searches and what it finds.

Do I have to install non-visuel components in Lazarus?

Packages only need to be "Install"ed if they provide IDE addons.

Show quoted text 8 lines
I usually create the objects in code anyway and my test program is a console (non-gui) program. >Maybe you updated your compiler and forgot to update lnet? Same compiler as before (3.0.0) And the IDE picks up the source unit from: /usr/fpc/3.0.0/utils/fppkg/lnet/lnet.pp

Good. That's the usual place on Linux.

Mattias

Reply by email

Bo Berglund
to Mattias Gaertner: On Fri, 15 Jan 2016 12:09:58 +0100 "lnet" is a normal unit of FPC. Compile with -vut to…
Mattias Gaertner wrote 6 lines
> >Maybe you updated your compiler and forgot to update lnet? > Same compiler as before (3.0.0) > And the IDE picks up the source unit from: > /usr/fpc/3.0.0/utils/fppkg/lnet/lnet.pp Good. That's the usual place on Linux.

OK, when I hover the mouse over the error message in Lazarus there is additional info about it. It says that it is missing the corresponding PPU file...
So I searched for it:
sudo find / -iname lnet.*
/usr/share/src/fpc-2.6.4/fpc/utils/fppkg/lnet/lnet.pp /usr/fpc/3.0.0/utils/fppkg/lnet/lnet.pp

So there does not seem to exist an lnet.ppu file.
How is that created? When compiling fpc or as part of building an application that uses it (would be what I'd assume)?

I installed fpc using the make functions in the source: sudo make all
sudo make install sourceinstall
Maybe it does not really build the full system?
Is there a command to actually also create the ppu files?

Bo Berglund Developer in Sweden

Reply by email

Bo Berglund
to Bo Berglund

On Fri, 15 Jan 2016 13:44:08 +0100, Bo Berglund
wrote:

I copied the lnet source dir from fpc into my Projects dir below /home/pi and set the compiler search path to include this location. Now it works again.
Don't know why it needed this since the IDE actually found the files at fpc 3.0.0.
Not good to have to copy distribution files into the local project folder.

Bo Berglund Developer in Sweden

Reply by email

Sven Barth
to Mattias Gaertner: On Fri, 15 Jan 2016 12:09:58 +0100 "lnet" is a normal unit of FPC. Compile with -vut to…
"Mattias Gaertner" wrote 10 lines
> I usually > create the objects in code anyway and my test program is a console > (non-gui) program. > > >Maybe you updated your compiler and forgot to update lnet? > Same compiler as before (3.0.0) > And the IDE picks up the source unit from: > /usr/fpc/3.0.0/utils/fppkg/lnet/lnet.pp Good. That's the usual place on Linux.

That's the place where fppkg needs it during compilation, yes, but not where the compiler would and should find it. The user should use fppkg (just a coincidence that both times fppkg is involved here) to install the package (AFAIK "fppkg install lnet").

Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20160115/91d6e26b/attachment.html>

Reply by email

Bo Berglund
to Sven Barth
Sven Barth wrote 10 lines
> > And the IDE picks up the source unit from: > > /usr/fpc/3.0.0/utils/fppkg/lnet/lnet.pp > > Good. That's the usual place on Linux. That's the place where fppkg needs it during compilation, yes, but not where the compiler would and should find it. The user should use fppkg (just a coincidence that both times fppkg is involved here) to install the package (AFAIK "fppkg install lnet").

Is that a command in terminal inside the fpc source dir: /usr/fpc/3.0.0/
or somewhere else Like:
/usr/fpc/3.0.0/utils/fppkg/lnet/

Or is it inside Lazarus somewhere?

A search for fppkg gives this:

pi at rpi2-jessie2:~/Projects/fpc $ sudo find / -iname fppkg /usr/lib/fpc/3.0.0/units/arm-linux/fppkg
/usr/lib/fpc/2.6.4/units/arm-linux/fppkg
/usr/share/src/fpc-2.6.4/fpc/packages/fppkg
/usr/share/src/fpc-2.6.4/fpc/utils/fppkg
/usr/fpc/3.0.0/packages/fppkg
/usr/fpc/3.0.0/utils/fppkg
/usr/bin/fppkg
/etc/fppkg
/home/pi/dev/lazarus/1.6RC2/components/fppkg
/home/pi/dev/lazarus/1.6RC1/components/fppkg

And this is on path:
pi at rpi2-jessie2:~/Projects/fpc $ which fppkg
/usr/bin/fppkg

Bo Berglund Developer in Sweden

Reply by email

Mattias Gaertner
to Bo Berglund
[...](AFAIK "fppkg install lnet").

Yes.
It is a bit confusing, that lnet is in FPC sources, but needs to be installed by fppkg.

Show quoted text 6 lines
Is that a command in terminal inside the fpc source dir: /usr/fpc/3.0.0/ or somewhere else Like: /usr/fpc/3.0.0/utils/fppkg/lnet/ Or is it inside Lazarus somewhere?

Please read the wiki page about fppkg I gave.

Mattias

Reply by email

Mark Morgan Lloyd
to Mattias Gaertner
Mattias Gaertner wrote 8 lines
On Fri, 15 Jan 2016 14:50:35 +0100 Bo Berglund wrote: > [...](AFAIK "fppkg install lnet"). Yes. It is a bit confusing, that lnet is in FPC sources, but needs to be installed by fppkg.

I agree. Does anybody know the historical reason for this?

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email

Bo Berglund
to Mattias Gaertner: On Fri, 15 Jan 2016 14:50:35 +0100 Yes. It is a bit confusing, that lnet is in FPC…
Mattias Gaertner wrote
Please read the wiki page about fppkg I gave.

Did so but I was confused about the statements there regarding the extra line to add to /etc/fpc.conf
Not clear enough in my view regarding the *exact* looks of the line.

But I looked through my fpc.conf file and found this, which looks similar to the wiki page:

# searchpath for fppkg user-specific packages
-Fu~/.fppkg/lib/fpc/$fpcversion/units/$FPCTARGET/*

Note that it says $FPCTARGET at the end rather than $fpctarget (case not sensitive here?)

In any case I did not edit the conf file but instead launched fppkg install lnet

and after a minute or so I got this:

Lazarus directory '/home/pi/.fppkg/build/lnet/' does not contain a valid Lazarus installation. Lazarus-package registration skipped. Installation package lnet for target arm-linux succeeded

What does it mean that registration skipped?

In any case my test program does build now using both Lazarus RC1 and RC2.

Thanks for your help!

Trying to create a clean environment for my embedded RPi2 development, my last installation is wrecked by too many experiments with fpc and lazarus versions from svn and other things...
This one only contains the seed fpc 2.6.4, release fpc 3.0.0 and lazarus RC1 and now RC2.

Real soon I will be able to get back to working on the real project. :)

Bo Berglund Developer in Sweden

Reply by email

Sven Barth
to Mark Morgan Lloyd: I agree. Does anybody know the historical reason for this? Mark Morgan Lloyd markMLl .AT.…

Am 15.01.2016 16:08 schrieb "Mark Morgan Lloyd" <

Show quoted text 16 lines
: Mattias Gaertner wrote: > > On Fri, 15 Jan 2016 14:50:35 +0100 > Bo Berglund wrote: > >> [...](AFAIK "fppkg install lnet"). > > > Yes. > It is a bit confusing, that lnet is in FPC sources, but needs to be > installed by fppkg. I agree. Does anybody know the historical reason for this?

fppkg needs socket support, but that was needed before our own implementation was ready enough, so lnet was imported directly into fppkg as to avoid the appearance that lnet is distributed in the fpc sources.

Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20160115/b43e252a/attachment.html>

Reply by email