www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - DDBI sqlite example?

reply Gregor Kopp <gregor.kopp chello.at> writes:
I installed tango and ddbi over dsss net install ... with dmd 1.020 on 
Windows XP. Next, I tried to work out the sqlite example provided here:
http://www.dsource.org/projects/ddbi

Following my example, and below the errors while compiling with
dsss build sqliteconnect.d

Can anyone point me to the solution to get it working right?



SOURCE:

module sqliteconnect;
import dbi.sqlite.SqliteDatabase;
import dbi.Row;
import tango.io.Console;
void main() {
SqliteDatabase db = new SqliteDatabase();
db.connect("test.db");
Row[] rows = db.queryFetchAll("SELECT * FROM names");
foreach (Row row; rows) {
Cout("name:")(row["name"]).newline()("zip:")(row["zip"]).newline();
}
db.close();
}

ERRORS:


sqliteconnect.d => sqliteconnect
+ c:\digitalmars\dmd\bin\rebuild.exe -Idsss_imports\ -I. -S.\
-Ic:\digitalmars\dmd\include\d -Sc:\digitalmars\dmd\lib\
-Ic:\digitalmars\dmd\include\d -Sc:\digitalmars\dmd\lib  -oqdsss_objs 
sqliteconnect.d -ofsqliteconnect
c:\digitalmars\dmd\bin\..\..\dm\bin\link.exe 
dsss_objs\_sqliteconnect+dsss_objs\tango-stdc-stringz
+dsss_objs\tango-text-Util+dsss_objs\tango-core-Vararg
+dsss_objs\tango-text-Regex+dsss_objs\tango-stdc-string
+dsss_objs\tango-stdc-stddef+dsss_objs\tango-stdc-stdio
+dsss_objs\tango-stdc-stdarg+dsss_objs\tango-stdc-config
+dsss_objs\tango-stdc-ctype+dsss_objs\tango-stdc-stdlib
+dsss_objs\tango-core-BitArray+dsss_objs\tango-io-Console
+dsss_objs\tango-sys-Common+dsss_objs\tango-io-Buffer
+dsss_objs\tango-io-model-IBuffer
+dsss_objs\tango-io-model-IConduit
+dsss_objs\tango-io-DeviceConduit
+dsss_objs\tango-io-Conduit,sqliteconnect,,user32+kernel32/noi
+SDD-dbi-sqlite.lib+SDD-dbi.lib+.\+c:\digitalmars\dmd\lib\
+c:\digitalmars\dmd\lib\+tango.lib+tango.lib;

OPTLINK (R) for Win32  Release 7.50B1
Copyright (C) Digital Mars 1989 - 2001  All Rights Reserved

c:\digitalmars\dmd\lib\SDD-dbi-sqlite.lib(SqliteDatabase)
Error 42: Symbol Undefined _sqlite3_open
c:\digitalmars\dmd\lib\SDD-dbi-sqlite.lib(SqliteDatabase)
Error 42: Symbol Undefined _sqlite3_close
c:\digitalmars\dmd\lib\SDD-dbi-sqlite.lib(SqliteDatabase)
Error 42: Symbol Undefined _sqlite3_errmsg
c:\digitalmars\dmd\lib\SDD-dbi-sqlite.lib(SqliteDatabase)
Error 42: Symbol Undefined _sqlite3_exec
c:\digitalmars\dmd\lib\SDD-dbi-sqlite.lib(SqliteDatabase)
Error 42: Symbol Undefined _sqlite3_prepare
c:\digitalmars\dmd\lib\SDD-dbi-sqlite.lib(SqliteDatabase)
Error 42: Symbol Undefined _sqlite3_errcode
c:\digitalmars\dmd\lib\SDD-dbi-sqlite.lib(SqliteDatabase)
Error 42: Symbol Undefined _sqlite3_last_insert_rowid
c:\digitalmars\dmd\lib\SDD-dbi-sqlite.lib(SqliteDatabase)
Error 42: Symbol Undefined _sqlite3_changes
c:\digitalmars\dmd\lib\SDD-dbi-sqlite.lib(SqliteResult)
Error 42: Symbol Undefined _sqlite3_step
c:\digitalmars\dmd\lib\SDD-dbi-sqlite.lib(SqliteResult)
Error 42: Symbol Undefined _sqlite3_column_count
c:\digitalmars\dmd\lib\SDD-dbi-sqlite.lib(SqliteResult)
Error 42: Symbol Undefined _sqlite3_column_name
c:\digitalmars\dmd\lib\SDD-dbi-sqlite.lib(SqliteResult)
Error 42: Symbol Undefined _sqlite3_column_text
c:\digitalmars\dmd\lib\SDD-dbi-sqlite.lib(SqliteResult)
Error 42: Symbol Undefined _sqlite3_column_decltype
c:\digitalmars\dmd\lib\SDD-dbi-sqlite.lib(SqliteResult)
Error 42: Symbol Undefined _sqlite3_column_type
c:\digitalmars\dmd\lib\SDD-dbi-sqlite.lib(SqliteResult)
Error 42: Symbol Undefined _sqlite3_finalize
--- errorlevel 15
Command c:\digitalmars\dmd\bin\rebuild.exe returned with code -1, aborting.
Aug 10 2007
parent reply Radu <radu.racariu void.space> writes:
you'll need the sqlite3.lib for this to link and work.
 refer to http://www.dsource.org/forums/viewtopic.php?=&p=5729 third post.


Gregor Kopp wrote:
 I installed tango and ddbi over dsss net install ... with dmd 1.020 on 
 Windows XP. Next, I tried to work out the sqlite example provided here:
 http://www.dsource.org/projects/ddbi

 Following my example, and below the errors while compiling with
 dsss build sqliteconnect.d

 Can anyone point me to the solution to get it working right?



 SOURCE:

 module sqliteconnect;
 import dbi.sqlite.SqliteDatabase;
 import dbi.Row;
 import tango.io.Console;
 void main() {
 SqliteDatabase db = new SqliteDatabase();
 db.connect("test.db");
 Row[] rows = db.queryFetchAll("SELECT * FROM names");
 foreach (Row row; rows) {
 Cout("name:")(row["name"]).newline()("zip:")(row["zip"]).newline();
 }
 db.close();
 }

 ERRORS:


 sqliteconnect.d => sqliteconnect
 + c:\digitalmars\dmd\bin\rebuild.exe -Idsss_imports\ -I. -S.\
 -Ic:\digitalmars\dmd\include\d -Sc:\digitalmars\dmd\lib\
 -Ic:\digitalmars\dmd\include\d -Sc:\digitalmars\dmd\lib  -oqdsss_objs 
 sqliteconnect.d -ofsqliteconnect
 c:\digitalmars\dmd\bin\..\..\dm\bin\link.exe 
 dsss_objs\_sqliteconnect+dsss_objs\tango-stdc-stringz
 +dsss_objs\tango-text-Util+dsss_objs\tango-core-Vararg
 +dsss_objs\tango-text-Regex+dsss_objs\tango-stdc-string
 +dsss_objs\tango-stdc-stddef+dsss_objs\tango-stdc-stdio
 +dsss_objs\tango-stdc-stdarg+dsss_objs\tango-stdc-config
 +dsss_objs\tango-stdc-ctype+dsss_objs\tango-stdc-stdlib
 +dsss_objs\tango-core-BitArray+dsss_objs\tango-io-Console
 +dsss_objs\tango-sys-Common+dsss_objs\tango-io-Buffer
 +dsss_objs\tango-io-model-IBuffer
 +dsss_objs\tango-io-model-IConduit
 +dsss_objs\tango-io-DeviceConduit
 +dsss_objs\tango-io-Conduit,sqliteconnect,,user32+kernel32/noi
 +SDD-dbi-sqlite.lib+SDD-dbi.lib+.\+c:\digitalmars\dmd\lib\
 +c:\digitalmars\dmd\lib\+tango.lib+tango.lib;

 OPTLINK (R) for Win32  Release 7.50B1
 Copyright (C) Digital Mars 1989 - 2001  All Rights Reserved

 c:\digitalmars\dmd\lib\SDD-dbi-sqlite.lib(SqliteDatabase)
 Error 42: Symbol Undefined _sqlite3_open
 c:\digitalmars\dmd\lib\SDD-dbi-sqlite.lib(SqliteDatabase)
 Error 42: Symbol Undefined _sqlite3_close
 c:\digitalmars\dmd\lib\SDD-dbi-sqlite.lib(SqliteDatabase)
 Error 42: Symbol Undefined _sqlite3_errmsg
 c:\digitalmars\dmd\lib\SDD-dbi-sqlite.lib(SqliteDatabase)
 Error 42: Symbol Undefined _sqlite3_exec
 c:\digitalmars\dmd\lib\SDD-dbi-sqlite.lib(SqliteDatabase)
 Error 42: Symbol Undefined _sqlite3_prepare
 c:\digitalmars\dmd\lib\SDD-dbi-sqlite.lib(SqliteDatabase)
 Error 42: Symbol Undefined _sqlite3_errcode
 c:\digitalmars\dmd\lib\SDD-dbi-sqlite.lib(SqliteDatabase)
 Error 42: Symbol Undefined _sqlite3_last_insert_rowid
 c:\digitalmars\dmd\lib\SDD-dbi-sqlite.lib(SqliteDatabase)
 Error 42: Symbol Undefined _sqlite3_changes
 c:\digitalmars\dmd\lib\SDD-dbi-sqlite.lib(SqliteResult)
 Error 42: Symbol Undefined _sqlite3_step
 c:\digitalmars\dmd\lib\SDD-dbi-sqlite.lib(SqliteResult)
 Error 42: Symbol Undefined _sqlite3_column_count
 c:\digitalmars\dmd\lib\SDD-dbi-sqlite.lib(SqliteResult)
 Error 42: Symbol Undefined _sqlite3_column_name
 c:\digitalmars\dmd\lib\SDD-dbi-sqlite.lib(SqliteResult)
 Error 42: Symbol Undefined _sqlite3_column_text
 c:\digitalmars\dmd\lib\SDD-dbi-sqlite.lib(SqliteResult)
 Error 42: Symbol Undefined _sqlite3_column_decltype
 c:\digitalmars\dmd\lib\SDD-dbi-sqlite.lib(SqliteResult)
 Error 42: Symbol Undefined _sqlite3_column_type
 c:\digitalmars\dmd\lib\SDD-dbi-sqlite.lib(SqliteResult)
 Error 42: Symbol Undefined _sqlite3_finalize
 --- errorlevel 15
 Command c:\digitalmars\dmd\bin\rebuild.exe returned with code -1, 
 aborting.

Aug 10 2007
parent Gregor Kopp <gregor.kopp chello.at> writes:
Radu wrote:
 you'll need the sqlite3.lib for this to link and work.
 refer to http://www.dsource.org/forums/viewtopic.php?=&p=5729 third post.

Thank you, that's working fine now!
Aug 10 2007