www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Probably trivial Linux link problem that I've spent hours on.

reply WhatMeWorry <kheaser gmail.com> writes:
Just learning Linux. Got my first vibe/dub project which dies at:

Compiling diet template 'index.dt'...
Linking...
/usr/bin/ld: cannot find -lsqlite3
collect2: error: ld returned 1 exit status


I downloaded DUB's d2sqlite3 and built it fine.
I've got sqlite3 on my system by default (came with Xununtu) I 
even tried:

$ sudo apt-get install sqlite3
[sudo] password for generic:
Reading package lists... Done
Building dependency tree
Reading state information... Done
sqlite3 is already the newest version (3.11.0-1ubuntu1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Aren't we trying to link to the sqlite3 a library?  So that would 
mean either a sqlite3.a or sqlite3.so file?  However, since this 
is a link time problem, it must be the sqlite3.so we want. Right?

I did a system wide search for sqlite3 and I come up only with 
libd2sqlite3.a?

The dependencies in my dub project file looks like:

dependency  "vibe-d" version="~>0.7.26"
dependency  "d2sqlite3" version="~>0.7.3"



Any ideas would be greatly appreciated. Thanks in advance.
Jul 04 2016
next sibling parent lobo <swamplobo gmail.com> writes:
On Tuesday, 5 July 2016 at 03:32:25 UTC, WhatMeWorry wrote:
 Just learning Linux. Got my first vibe/dub project which dies 
 at:

 [...]
You need to install sqlite3, or download and build it yourself, to get libsqlite3.a. I don't use Ubuntu so not sure of the package but you will be able to "apt-get install libsqlite3" or something similar. bye, lobo
Jul 04 2016
prev sibling next sibling parent via Digitalmars-d-learn <digitalmars-d-learn puremagic.com> writes:
On Tue, Jul 05, 2016 at 03:32:25AM +0000, WhatMeWorry via Digitalmars-d-learn
wrote:
 $ sudo apt-get install sqlite3
I'm just guessing, but try install sqlite3-devel too
Jul 04 2016
prev sibling next sibling parent Andrea Fontana <nospam example.com> writes:
On Tuesday, 5 July 2016 at 03:32:25 UTC, WhatMeWorry wrote:
 Just learning Linux. Got my first vibe/dub project which dies 
 at:

 Compiling diet template 'index.dt'...
 Linking...
 /usr/bin/ld: cannot find -lsqlite3
 collect2: error: ld returned 1 exit status


 I downloaded DUB's d2sqlite3 and built it fine.
 I've got sqlite3 on my system by default (came with Xununtu) I
You need *-dev package probabily. Something like: sudo apt-get install libsqlite3-dev Andrea
Jul 05 2016
prev sibling parent reply =?UTF-8?Q?Ali_=c3=87ehreli?= <acehreli yahoo.com> writes:
On 07/04/2016 08:32 PM, WhatMeWorry wrote:

 /usr/bin/ld: cannot find -lsqlite3
 collect2: error: ld returned 1 exit status
I had the same issue when building Button with dub on Ubuntu 16.04. My hack was to create the following symlink to the already existing libsqlite3.so.0: sudo ln -s /usr/lib/x86_64-linux-gnu/libsqlite3.so.0 /usr/lib/x86_64-linux-gnu/libsqlite3.so Ali
Jul 05 2016
parent Johannes Pfau <nospam example.com> writes:
Am Tue, 5 Jul 2016 00:37:54 -0700
schrieb Ali =C3=87ehreli <acehreli yahoo.com>:

 On 07/04/2016 08:32 PM, WhatMeWorry wrote:
=20
  > /usr/bin/ld: cannot find -lsqlite3
  > collect2: error: ld returned 1 exit status =20
=20
 I had the same issue when building Button with dub on Ubuntu 16.04.
 My hack was to create the following symlink to the already existing=20
 libsqlite3.so.0:
=20
    sudo ln -s /usr/lib/x86_64-linux-gnu/libsqlite3.so.0=20
 /usr/lib/x86_64-linux-gnu/libsqlite3.so
=20
 Ali
=20
Some time ago Debian (and therefore Ubuntu as well) moved the unversioned .so symlinks into the -dev packages. This means you'll always need the -dev packages now when linking with a C library, even if you only use the dynamic library.
Jul 05 2016