Thread overview
Probably trivial Linux link problem that I've spent hours on.
Jul 05, 2016
WhatMeWorry
Jul 05, 2016
lobo
Jul 05, 2016
Andrea Fontana
Jul 05, 2016
Ali Çehreli
Jul 05, 2016
Johannes Pfau
July 05, 2016
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.


July 05, 2016
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
July 04, 2016
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

July 05, 2016
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
July 05, 2016
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

July 05, 2016
Am Tue, 5 Jul 2016 00:37:54 -0700
schrieb Ali Çehreli <acehreli@yahoo.com>:

> 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
> 

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.