Quantcast

libsqlite3.0.dylib - SQLITE_ENABLE_COLUMN_METADATA required

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

libsqlite3.0.dylib - SQLITE_ENABLE_COLUMN_METADATA required

Andrew Bryson
Hi all,

I've got a application which usess NHibernate to access SQLite.  This works well on Windows, and I'm trying to get the application unit tests (Nunit) to run on Mac OS X 10.5.

The unit tests have been failing because the native library (libsqlite3.0.dylib) was not compiled with the SQLITE_ENABLE_COLUMN_METADATA directive.  My nunit tests started working again once I:

 - recompiled from source (http://www.sqlite.org/sqlite-amalgamation-3.6.19.tar.gz) passing SQLITE_ENABLE_COLUMN_METADATA through CFLAGS to configure.
 - overwriting the existing mono version of libsqlite3.0.dylib (/Library/Frameworks/Mono.framework/Versions/Current/lib/libsqlite3.0.dylib) with the resulting library.

I'm also using the ADO.NET provider for SQLite from http://sourceforge.net/projects/sqlite-dotnet2/files/SQLite%20for%20ADO.NET%202.0/1.0.65.0/SQLite-1.0.65.0-managedonly-binaries.zip/download (http://sqlite.phxsoftware.com/).  This requires the native SQlite library to be in place though.

I've run my unit tests on the Mono 2.4 VMWare image which I downloaded from the Mono website, and the tests work as expected.

Questions:

1. Does mono ship a version of libsqlite3.0.dylib, and if so, can it be updated to support SQLITE_ENABLE_COLUMN_METADATA please?
2. What else could I do to resolve this problem?  I don't want to provide a copy of the native library alongside my application, but would this be possible to do?

Thanks,

Andrew Bryson
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: libsqlite3.0.dylib - SQLITE_ENABLE_COLUMN_METADATA required

Andrew Bryson
abryson wrote
Hi all,

I've got a application which usess NHibernate to access SQLite.  This works well on Windows, and I'm trying to get the application unit tests (Nunit) to run on Mac OS X 10.5.

The unit tests have been failing because the native library (libsqlite3.0.dylib) was not compiled with the SQLITE_ENABLE_COLUMN_METADATA directive.  My nunit tests started working again once I:

 - recompiled from source (http://www.sqlite.org/sqlite-amalgamation-3.6.19.tar.gz) passing SQLITE_ENABLE_COLUMN_METADATA through CFLAGS to configure.
 - overwriting the existing mono version of libsqlite3.0.dylib (/Library/Frameworks/Mono.framework/Versions/Current/lib/libsqlite3.0.dylib) with the resulting library.

I'm also using the ADO.NET provider for SQLite from http://sourceforge.net/projects/sqlite-dotnet2/files/SQLite%20for%20ADO.NET%202.0/1.0.65.0/SQLite-1.0.65.0-managedonly-binaries.zip/download (http://sqlite.phxsoftware.com/).  This requires the native SQlite library to be in place though.

I've run my unit tests on the Mono 2.4 VMWare image which I downloaded from the Mono website, and the tests work as expected.

Questions:

1. Does mono ship a version of libsqlite3.0.dylib, and if so, can it be updated to support SQLITE_ENABLE_COLUMN_METADATA please?
2. What else could I do to resolve this problem?  I don't want to provide a copy of the native library alongside my application, but would this be possible to do?

Thanks,

Andrew Bryson
Bump... can anybody help?

Thanks,
andy
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: libsqlite3.0.dylib - SQLITE_ENABLE_COLUMN_METADATA required

Stanley
I've the same issue and found this (very) old thread.
Any new solutions?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: libsqlite3.0.dylib - SQLITE_ENABLE_COLUMN_METADATA required

d0ugmac1
I have fought with SQLite and Mono for years now and finally things seem to be pretty stable with Mono.Data.Sqlite.  I still wish there was some actual documentation for it...or at least a pointer saying you can pretty much any ADO.NET docs out there!  

Unfortunately the dylib version of sqlite supplied with Leopard 10.5.8 is too old for the latest version of Mono, never mind the column metadata issue which has been around for years.

My solution for my application is to package the dylib alongside my application rather than replace the OS version with who knows what consequences.  I place the library file in the same folder as my production executable.

You can easily build your own version of sqlite's library if you have the dev tools installed.  Here's an older sample command line to build a universal binary PPC/Intel compatible library. (I just built a standard x86 version)

$ CFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch ppc -arch i386" LDFLAGS="-Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk -arch ppc -arch i386" make


If that doesn't work for you, then download sqlite 3.5.X source, configure, and tweak the resulting Makefile by adding this option -DSQLITE_ENABLE_COLUMN_METADATA=1 with the rest of -D options (around line 40?).

Build it and look in the .libs folder. You will find something like

sqlite-3.5.4/.libs/libsqlite3.0.8.6.dylib

Copy this file into your application folder as libsqlite3.0.dylib

Your last bit is to make sure your environment has a DYLIB path set, or add it to the command line.

Here's a shell launcher I use with my application


#!/bin/sh
DYLD_LIBRARY_PATH=/Path/to/My/SqliteDll mono MyApp.exe


HTH

D.


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: libsqlite3.0.dylib - SQLITE_ENABLE_COLUMN_METADATA required

Stanley
Thank you!  Thats exactly what I'm looking for.
Loading...