[Rubyinstaller-devel] Trying to compile sqlite3

Luis Lavena luislavena at gmail.com
Sat Jul 26 16:11:32 EDT 2008

On Sat, Jul 26, 2008 at 9:37 PM, Fabio Akita <fabioakita at gmail.com> wrote:
> Hi, Luis I am re-copying the question I sent you here in the list.
> I've built the most current One-Click installer and it worked great. I
> installed the devkit version and I am now trying to install the
> sqlite3-ruby gem.
> C:\>gem install sqlite3-ruby -- --with-sqlite3-dir=c:/src/sqlite-source-3_6_0
> Building native extensions.  This could take a while...
> ERROR:  Error installing sqlite3-ruby:
>        ERROR: Failed to build gem native extension.
> c:/ruby18/bin/ruby.exe extconf.rb install sqlite3-ruby --
> --with-sqlite3-dir=c:/src/sqlite-source-3_6_0
> checking for fdatasync() in -lrt... no
> checking for sqlite3.h... no
> *** extconf.rb failed ***
> Could not create Makefile due to some reason, probably lack of
> necessary libraries and/or headers.  Check the mkmf.log file for more
> details.  You may need configuration options.
> ...
> I've downloaded the sqlite3 sources from:
> http://www.sqlite.org/sqlite-source-3_6_0.zip
> Am I missing something?

Actually, is not 100% your fault ;-)

You need the pre-built binaries besides the source code:

Then you can grab either source or the amalgamation version, we only
care about sqlite3.h which is inside.

>From the dll package you will have the dll and a .def file. We now
need to create the linking library that will be used by gcc to link
against sqlite3 dll.

So, until they provide a ready to use sqlite3 package:

1) create a sqlite3 folder
2) unzip sqlitedll-3_6_0.zip into sqlite3/lib folder
3) unzil from the sources the sqlite3.h file and put into sqlite3/include folder
3) you will need to call dlltool to create the .a library to be able
to compile with gcc:

D:\src\sqlite3\lib>c:\Ruby18\devkit\mingw\bin\dlltool.exe --dllname sqlite3.dll
--def sqlite3.def --output-lib sqlite3.a

4) Now you can supply the --with-sqlite3-dir to gem install:

gem install sqlite3-ruby -- --with-sqlite3-dir=d:/src/sqlite3
Building native extensions.  This could take a while...
Successfully installed sqlite3-ruby-1.2.2
1 gem installed
Installing ri documentation for sqlite3-ruby-1.2.2...
Installing RDoc documentation for sqlite3-ruby-1.2.2...

Maybe we should point this in the Wiki? :-D

Luis Lavena
Human beings, who are almost unique in having the ability to learn from
the experience of others, are also remarkable for their apparent
disinclination to do so.
Douglas Adams

More information about the Rubyinstaller-devel mailing list