Help Building DBI

Brad Anderson brad at dsource.org
Fri Jan 5 09:44:39 PST 2007


jicman wrote:
> Greetings!  Congratulations to all of us for 1.0!  Woowoowoowoooooo!
> 
> Sorry to ask about this on this newsgroup, but I am kinda trapped
> for time and the DBI forum on dsource.org is kinda slow and perhaps
> I get faster response here.  Thanks.
> 
> Ok, so I want to compile this test program,
> 
> ----------------
> import dbi.sqlite.SqliteDatabase;
> import dbi.Row;
> //import dbi.all;
> import std.stdio;
> 
> void main() {
>   char[] sqldb  = r"C:\OpenJobs.db";
>   SqliteDatabase db = new SqliteDatabase();
>   db.connect(sqldb);
> 
>   Row[] rows = db.queryFetchAll("SELECT * FROM sqlite_master WHERE
> type='table' AND name='LSOpenJobs'");
>   foreach (Row row; rows)
>   {
>     writefln("username: %s Project: %s\n", row["login"], row
> ["proj"]);
>   }
> 
>   db.close();
> }
> 
> ----------------
> 
> But I am getting this error,
> 
> 23:24:19.89>build -clean dbitest.d
> dbitest.d(1): module SqliteDatabase cannot read
> file 'dbi\sqlite\SqliteDatabase.d'
> 
> I tried to build dbi, and here is what I get,
> 
> 23:24:42.54>dmd -run buildme.d sqlite
> Digital Mars Librarian Version 8.00n
> Copyright (C) Digital Mars 2000-2002 All Rights Reserved
> www.digitalmars.com
> Digital Mars Librarian complete.
> 
> I took the dbi.lib and placed it on c:\dmd\lib and I get the same
> thing.
> 
> Any ideas as to what to do to get this above program compiled?
> 
> Thanks so much.
> 
> jos�

Hi,

I have a symlink to the dbi code so that the source can be found by the
compiler.  So my dbi folder would be in the same one as the dbitest.d file.
You may just want to put a copy of the code there, if you can't do symlinks.
Or, get a libddbi.a or ddbi.lib somewhere and send it to the linker.

I then give build the following switches in a build.brf file that (for you)
would look like this:

dbitest
-op
-L-lsqlite
-cleanup

Then, you just type build

hth,
BA

P.S.  I still would have posted this in the ddbi forum on dsource.  I'm
watching it a bit...


More information about the Digitalmars-d-learn mailing list