Programming with MonoMac on OSX (Snow Leopard)

Using SQLite (System.Data.SQLite)

Needed Downloads

Compiling SQLite / creating a dynamic library

Extract the SQLite source code

$ unzip sqlite-amalgamation-3070500.zip

Compile the source

$ gcc -Os -arch i386 -DSQLITE_OS_UNIX=1 -DSQLITE_THREADSAFE=1 \
-DSQLITE_THREAD_OVERRIDE_LOCK=-1 -DSQLITE_ENABLE_COLUMN_METADATA=1 \
-DSQLITE_TEMP_STORE=1 -DSQLITE_ENABLE_LOAD_EXTENSION=1 -c sqlite3.c -o sqlite3.o
$
$ gcc -dynamiclib -Wl,-undefined -Wl,dynamic_lookup -o libsqlite3.dylib sqlite3.o \
-arch i386 -install_name libsqlite3.dylib -compatibility_version 9 \
-current_version 9.6 -Wl,-single_module

Extract System.Data.SQLite

$ unzip SQLite-1.0.66.0-managedonly-binaries.zip

Copy SQLite dynamic library

$ cd bin/ManagedOnly
$ cp <SOURCE_PATH_OF_SQLITE_LIB> libsqlite3.dylib

Create System.Data.SQLite DLL config file

$ cat System.Data.SQLite.dll.config
<dllmap dll="sqlite3" target="libsqlite3.dylib" os="!windows"/>

Test the new SQLite dynamic library

DYLD_FALLBACK_LIBRARY_PATH=./:/usr/local/lib:/lib:/usr/lib: mono test.exe
programming/monomac/main.txt · Zuletzt geändert: 2011/07/22 23:26 (Externe Bearbeitung)
 
Falls nicht anders bezeichnet, ist der Inhalt dieses Wikis unter der folgenden Lizenz veröffentlicht: CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki