(I say, I say…that’s a joke, son. An in-house one, even)

But behold!! C#!


kkennedy@roark:~$ mcs TestExample.cs
TestExample.cs(2) error CS0246: The namespace `System.Data' can not be found (missing assembly reference?)
Try using -r:System.Data
TestExample.cs(3) error CS0246: The namespace `Mono.Data.SqliteClient' can not be found (missing assembly reference?)
Compilation failed: 2 error(s), 0 warnings

??? *rustle, rustle* Ah!


kkennedy@roark:~$ mcs TestExample.cs -r System.Data.dll -r Mono.Data.SqliteClient.dll
Compilation succeeded
kkennedy@roark:~$ mono TestExample.exe

** (TestExample.exe:3399): WARNING **: Failed to load library ./libsqlite.so (sqlite): ./libsqlite.so: cannot open shared object file: No such file or directory
** (TestExample.exe:3399): WARNING **: Failed to load library ./libsqlite.so (sqlite): ./libsqlite.so: cannot open shared object file: No such file or directory
** (TestExample.exe:3399): WARNING **: Failed to load library ./libsqlite.so (sqlite): ./libsqlite.so: cannot open shared object file: No such file or directory
Unhandled Exception: System.MissingMethodException: A missing method exception has occurred.
in 0x00042 (wrapper managed-to-native) Mono.Data.SqliteClient.SqliteConnection:sqlite_open (string,int,string&)
in 0x0005d Mono.Data.SqliteClient.SqliteConnection:Open ()
in 0x00071 .Test:Main (string[])

Frack. Screwed now…what the…Oh!


kkennedy@roark:~$ dpkg -L libsqlite0|grep so
/usr/lib/libsqlite.so.0.8.6
/usr/lib/libsqlite.so.0

(Pay no attention to the man behind the curtain, installing static libraries…hey, I could be a supervillain!)


kkennedy@roark:~$ dpkg -L libsqlite0-dev | grep so
/usr/lib/libsqlite.so

Exx…cellent!


kkennedy@roark:~$ mono TestExample.exe
Name: Foo Kennedy

Vengeance Is Mine! My first mono program! A mere 6 months from now, I’ll be able to do it without just cutting and pasting from the site! *grin*

Leave a Reply

Your email address will not be published. Required fields are marked *