Recent

Author Topic: Compiler error "/usr/bin/ld: cannot find -lsqlite"  (Read 4825 times)

ocpaul20

  • New Member
  • *
  • Posts: 18
Compiler error "/usr/bin/ld: cannot find -lsqlite"
« on: April 26, 2015, 01:19:18 am »
I am trying to compile the IDE with the sqlite package enabled.
The package itself compiles OK but the IDE cannot find the sqlite library when it comes to linking into the IDE.

Where do I have to place sqlite.so it for it to be found please?

I have linked the libsqlite3.so.0.8.6 in /usr/lib to any place I can think of and it STILL is not being found and I get the error shown below in the verbose output log.

I have placed a link in
1) /opt/gnome/lib
2) {the directory which contain my projects which compile successfully}
3) development
4) development/lazarus

I have added to LD_LIBRARY_PATH environment variable
1) {the directory which contain my projects which compile successfully}

I have added to PATH
1) {the directory which contain my projects which compile successfully}

I have added environment variable  PPC_EXEC_PATH
1) {the directory which contain my projects which compile successfully}

As you can see from the compile statement below obtained with the --verbose option on fpcup_update, I have /usr/lib in the -Fl options which show the compiler where to find the libraries.

There must be something obvious I am missing. Can anyone help please?

==========================================
Code: [Select]
/usr/bin/make --assume-new=lazarus.pp lazarus OPT=' @/mnt/sda5/development/config_lazarus/idemake.cfg'
make[2]: Entering directory `/mnt/sda5/development/lazarus/ide'
/mnt/sda5/development/fpc/bin/i386-linux/fpc.sh -gl -vbqewnhi -Sci -dlclgtk2 -Fu../designer -Fu../debugger -Fu../debugger/frames -Fu../converter -Fu../packager -Fu../packager/frames -Fu../components/custom -Fuframes -Fu. -Fiinclude -Fiinclude/linux -Fi../images -FE.. -FU../units/i386-linux/gtk2 -Fl/usr/lib/gcc/i486-slackware-linux/4.7.1 -Fl/lib -Fl/usr/lib -Fl/usr/local/lib -Fl/usr/X11R7/lib -Fl/root/my-applications/lib @/mnt/sda5/development/config_lazarus/idemake.cfg -di386 lazarus.pp
Hint: (11030) Start of reading config file /mnt/sda5/development/fpc/bin/i386-linux/fpc.cfg
Hint: (11031) End of reading config file /mnt/sda5/development/fpc/bin/i386-linux/fpc.cfg
Hint: (11030) Start of reading config file /mnt/sda5/development/config_lazarus/idemake.cfg
Hint: (11031) End of reading config file /mnt/sda5/development/config_lazarus/idemake.cfg
Free Pascal Compiler version 2.6.5 [2015/04/26] for i386
Copyright (c) 1993-2012 by Florian Klaempfl and others
(1002) Target OS: Linux for i386
(3104) Compiling lazarus.pp
(9022) Compiling resource /mnt/sda5/development/lazarus/units/i386-linux/gtk2/lazarus.or
(9015) Linking ../lazarus
/usr/bin/ld: warning: ../link.res contains output sections; did you forget -T?
/usr/bin/ld: cannot find -lsqlite
/mnt/sda5/development/lazarus/ide/lazarus.pp(146,1) Error: (9013) Error while linking
/mnt/sda5/development/lazarus/ide/lazarus.pp(146,1) Fatal: (10026) There were 1 errors compiling module, stopping
Fatal: (1018) Compilation aborted
make[2]: *** [lazarus] Error 1
make[1]: *** [idepkg] Error 2
make: *** [idepkg] Error 2
Error: /mnt/sda5/development/fpc/bin/i386-linux/ppc386 returned an error exitcode (normal if you did not specify a source file to be compiled)
make[2]: Leaving directory `/mnt/sda5/development/lazarus/ide'
make[1]: Leaving directory `/mnt/sda5/development/lazarus/ide'
make: Leaving directory `/mnt/sda5/development/lazarus'
Error: (lazarus) Build IDE: stopped with exit code 2
Error: (lazarus) Building IDE: Building IDE failed.
...
a few more lines and then stops

it seems no-one knows the answer to this one but there MUST be an answer somewhere.
This similar question from back in 2008
http://forum.lazarus.freepascal.org/index.php/topic,5954.15.html

=======================================
Free Pascal Compiler version 2.6.5 [2015/04/26] for i386
Puppy Linux Slacko 5.7 Frugal

Blaazen

  • Hero Member
  • *****
  • Posts: 3241
  • POKE 54296,15
    • Eye-Candy Controls
Re: Compiler error "/usr/bin/ld: cannot find -lsqlite"
« Reply #1 on: April 26, 2015, 01:32:05 am »
If you added library manually, you need to do
Code: [Select]
ldconfig(as superuser).

Anyway it's better to install sqlite from repositories of your distro.

But I myself don't have much experience with sqlite.
Lazarus 2.3.0 (rev main-2_3-2863...) FPC 3.3.1 x86_64-linux-qt Chakra, Qt 4.8.7/5.13.2, Plasma 5.17.3
Lazarus 1.8.2 r57369 FPC 3.0.4 i386-win32-win32/win64 Wine 3.21

Try Eye-Candy Controls: https://sourceforge.net/projects/eccontrols/files/

ocpaul20

  • New Member
  • *
  • Posts: 18
Re: Compiler error "/usr/bin/ld: cannot find -lsqlite"
« Reply #2 on: April 26, 2015, 02:52:42 am »
rebuilding the IDE also has problems but I seem to eventually figured out a fix.
From the install/uninstall packages menu item, uninstall the sqlitelaz package. This allows the 'rebuild IDE' to complete at least. Still dont know how to get the compiler finding the sqlite library.

I assume it is looking for the sqlite.so file somewhere.
=======================================
Free Pascal Compiler version 2.6.5 [2015/04/26] for i386
Puppy Linux Slacko 5.7 Frugal

Leledumbo

  • Hero Member
  • *****
  • Posts: 8757
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Compiler error "/usr/bin/ld: cannot find -lsqlite"
« Reply #3 on: April 26, 2015, 07:26:04 am »
Watch out, there are sqlitelaz and sqlite3laz. The former links to sqlite version < 3, while the latter is likely to be what you have installed currently.

 

TinyPortal © 2005-2018