Re: [Lazarus] /usr/bin/ld: cannot find -lwhatever

2016-02-21 Thread Giuliano Colla



Il 21/02/2016 18:41, David W Noon ha scritto:

You should not put .o files into library directories. You should use
the ar command to build a library and put the resulting .a file into
you library directory.

E.g.,

 ar -crs libsomething.a something.o


Thanks a lot. I wasn't aware that I must prepend *lib* to the library 
name. Just renaming my link to something.so into libsomething.so did the 
trick!


Giuliano


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] /usr/bin/ld: cannot find -lwhatever

2016-02-21 Thread David W Noon
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Sun, 21 Feb 2016 15:46:37 +0100, Giuliano Colla
(giuliano.co...@fastwebnet.it) wrote about "[Lazarus] /usr/bin/ld:
cannot find -lwhatever" (in <56c9cdcd.6070...@fastwebnet.it>):

[snip]
> I tried adding the path where the .o/.so file is located in the -Fl
> path of the Compiler Options.

You should not put .o files into library directories. You should use
the ar command to build a library and put the resulting .a file into
you library directory.

E.g.,

ar -crs libsomething.a something.o

Then put libsomething.a into /usr/local/lib; then use ldconfig (or
SuSEconfig if you're using SuSE linux) to refresh the ld cache.

This is documented in man 1 ar.
- -- 
Regards,

Dave  [RLU #314465]
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
david.w.n...@googlemail.com (David W Noon)
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

-BEGIN PGP SIGNATURE-
Version: GnuPG v2

iEYEARECAAYFAlbJ9q8ACgkQogYgcI4W/5SJlgCgrNzNvYxYDBnyWT+AJyIVQjc2
qYUAoMzNBJ7OCWnyAbSmk71qxcMk05kL
=85Ws
-END PGP SIGNATURE-

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] /usr/bin/ld: cannot find -lwhatever

2016-02-21 Thread Giuliano Colla



Il 21/02/2016 16:29, Vojtěch Čihák ha scritto:


Probably not your case but when you add manually libs to system 
(/usr/lib or /usr/local/lib), you need to run


ldconfig

as superuser in terminal so the system rescans available libraries.



I'm aware of that, and I did it, but no luck:-(

Giuliano


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] /usr/bin/ld: cannot find -lwhatever

2016-02-21 Thread Vojtěch Čihák

Probably not your case but when you add manually libs to system (/usr/lib or 
/usr/local/lib), you need to run
ldconfig
as superuser in terminal so the system rescans available libraries.
 
V.
__

Od: Giuliano Colla 
Komu: Lazarus mailing list 
Datum: 21.02.2016 15:47
Předmět: [Lazarus] /usr/bin/ld: cannot find -lwhatever


Hi,

The result is always the same: cannot find -lwhatever, with "whatever" 
reflecting exactly my external library path/name.


I'm at loss. What I'm missing?

Giuliano



--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus 
<http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus>

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] /usr/bin/ld: cannot find -lwhatever

2016-02-21 Thread Giuliano Colla

Hi,

I'm need to link some C modules to a Lazarus app.

I started with just a minimal console app, and one module, I've created 
with h2pas the binding module, and edited to make it compile properly, 
but when it comes to link I get the "cannot find" error.


I tried both a mymodule.o object and a mymodule.so shared object.

I tried putting the .o/.so in the source directory, in the unit 
directory, and in /usr/lib64 directory (with an ldconfig to update ld 
cache).


I tried declaring the external library just with the module name, and 
with the full path.


I tried adding the path where the .o/.so file is located in the -Fl path 
of the Compiler Options.


The result is always the same: cannot find -lwhatever, with "whatever" 
reflecting exactly my external library path/name.


I'm at loss. What I'm missing?

Giuliano



--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus