View previous topic :: View next topic |
Author |
Message |
jicman
Joined: 22 Dec 2004 Posts: 298 Location: Rochester, NY
|
Posted: Thu Jan 04, 2007 2:39 pm Post subject: Steps to building dbi |
|
|
Greetings and happy new 2007.
I am trying to build dbi and I am on the path where buildme.d is found as you can see:
Code: | 15:38:46.73>dir
Volume in drive E is MyStuff
Volume Serial Number is 10B3-6C04
Directory of E:\Software\Programming\d\DDBI\trunk
01/04/2007 03:38 PM <DIR> .
01/04/2007 03:38 PM <DIR> ..
11/09/2006 11:41 PM 4,520 buildme.d
12/17/2006 01:25 AM <DIR> dbi
12/17/2006 01:25 AM <DIR> docs
1 File(s) 4,520 bytes
4 Dir(s) 979,410,944 bytes free |
when I apply the command to build dbi, here is what I get:
Quote: | 15:38:48.68>dmd -run buildme.d all
dbi\odbc\OdbcResult.d(25): module odbcinst cannot read file 'win32\odbcinst.d'
Press any key to continue . . . |
Any ideas?
thanks,
josé |
|
Back to top |
|
|
un_guru
Joined: 14 Sep 2005 Posts: 32
|
Posted: Thu Jan 04, 2007 3:46 pm Post subject: |
|
|
you need the win32 headers for the odbc package, this are not shiped with ddbi but you'll need to download 'em. Take a look in the bindings project, there you'll find the winapi project.
You can also skip building the odbc package
Quote: | dmd -run buildme all -odbc |
|
|
Back to top |
|
|
jicman
Joined: 22 Dec 2004 Posts: 298 Location: Rochester, NY
|
Posted: Thu Jan 04, 2007 5:03 pm Post subject: |
|
|
un_guru wrote: | you need the win32 headers for the odbc package, this are not shiped with ddbi but you'll need to download 'em. Take a look in the bindings project, there you'll find the winapi project.
You can also skip building the odbc package
Quote: | dmd -run buildme all -odbc |
|
Ok, that gives me another error, but then I tried to build just sqlite, I got this, Quote: | dbi\sqlite\SqliteDatabase.d(63): function dbi.sqlite.imp.sqlite3_open (char*,sqlite3 **) does not match parameter types (char[],sqlite3 **)
dbi\sqlite\SqliteDatabase.d(63): Error: cannot implicitly convert expression (params) of type char[] to char*
dbi\sqlite\SqliteDatabase.d(92): function dbi.sqlite.imp.sqlite3_exec (sqlite3 *,char*,int(*)(void*, int, char**, char**),void*,char**) does not match parameter types (sqlite3 *,char[],void*,void*,char**)
dbi\sqlite\SqliteDatabase.d(92): Error: cannot implicitly convert expression (sql) of type char[] to char*
dbi\sqlite\SqliteDatabase.d(113): function dbi.sqlite.imp.sqlite3_prepare (sqlite3 *,char*,int,sqlite3_stmt **,char**) does not match parameter types (sqlite3 *,char[],uint,sqlite3_stmt **,char**)
dbi\sqlite\SqliteDatabase.d(113): Error: cannot implicitly convert expression (sql) of type char[] to char*
Press any key to continue . . .
|
so, apparently, we have not touched this since 177. And 1.0 is out.
So, I fixed this and I buildme.d created a dbi.lib. I placed this on
c:\dmd\lib
and when I compile this program,
Code: |
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();
} |
I get,
Quote: | 17:52:55.78>build -I.. -clean dbitest.d
OPTLINK (R) for Win32 Release 7.50B1
Copyright (C) Digital Mars 1989 - 2001 All Rights Reserved
C:\cygwin\home\us319318\source\d\dbi\sqlite\SqliteDatabase.obj(SqliteDatabase)
Error 42: Symbol Undefined _sqlite3_open
C:\cygwin\home\us319318\source\d\dbi\sqlite\SqliteDatabase.obj(SqliteDatabase)
Error 42: Symbol Undefined _sqlite3_close
C:\cygwin\home\us319318\source\d\dbi\sqlite\SqliteDatabase.obj(SqliteDatabase)
Error 42: Symbol Undefined _sqlite3_errmsg
C:\cygwin\home\us319318\source\d\dbi\sqlite\SqliteDatabase.obj(SqliteDatabase)
Error 42: Symbol Undefined _sqlite3_exec
C:\cygwin\home\us319318\source\d\dbi\sqlite\SqliteDatabase.obj(SqliteDatabase)
Error 42: Symbol Undefined _sqlite3_prepare
C:\cygwin\home\us319318\source\d\dbi\sqlite\SqliteDatabase.obj(SqliteDatabase)
Error 42: Symbol Undefined _sqlite3_errcode
C:\cygwin\home\us319318\source\d\dbi\sqlite\SqliteDatabase.obj(SqliteDatabase)
Error 42: Symbol Undefined _sqlite3_last_insert_rowid
C:\cygwin\home\us319318\source\d\dbi\sqlite\SqliteDatabase.obj(SqliteDatabase)
Error 42: Symbol Undefined _sqlite3_changes
C:\cygwin\home\us319318\source\d\dbi\sqlite\SqliteResult.obj(SqliteResult)
Error 42: Symbol Undefined _sqlite3_step
C:\cygwin\home\us319318\source\d\dbi\sqlite\SqliteResult.obj(SqliteResult)
Error 42: Symbol Undefined _sqlite3_column_count
C:\cygwin\home\us319318\source\d\dbi\sqlite\SqliteResult.obj(SqliteResult)
Error 42: Symbol Undefined _sqlite3_column_name
C:\cygwin\home\us319318\source\d\dbi\sqlite\SqliteResult.obj(SqliteResult)
Error 42: Symbol Undefined _sqlite3_column_text
C:\cygwin\home\us319318\source\d\dbi\sqlite\SqliteResult.obj(SqliteResult)
Error 42: Symbol Undefined _sqlite3_column_decltype
C:\cygwin\home\us319318\source\d\dbi\sqlite\SqliteResult.obj(SqliteResult)
Error 42: Symbol Undefined _sqlite3_column_type
C:\cygwin\home\us319318\source\d\dbi\sqlite\SqliteResult.obj(SqliteResult)
Error 42: Symbol Undefined _sqlite3_finalize
|
So, where am I going wrong on this?
thanks.
jic |
|
Back to top |
|
|
brad Site Admin
Joined: 22 Feb 2004 Posts: 490 Location: Atlanta, GA USA
|
Posted: Fri Jan 05, 2007 4:09 pm Post subject: |
|
|
jicman,
Couple of things.
1. Here are the thoughts from the D.learn NG:
brad wrote: |
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
|
aarti_pl wrote: |
... And add -d switch to allow depreciated features, when compiling with D
1.0. Currently DDBI is a little bit broken as implicit conversion of D char
arrays to char* is depreciated....
|
2. So you used the -d to get past these errors, and build with the -L-lsqlite option seemed to have worked for you...
See http://www.dsource.org/projects/ddbi/changeset/43 and update your working copy, if you want, so you can get rid of -d when using a compiler >= 0.177
Let me know how it goes. I made some changes to your dbitest.d program (sql syntax only), and tested it using my own sqlite database ... it worked. One note, I did have to use -L-lsqlite3 instead of -L-lsqlite in the build.brf file.
BA |
|
Back to top |
|
|
jicman
Joined: 22 Dec 2004 Posts: 298 Location: Rochester, NY
|
Posted: Fri Jan 05, 2007 4:37 pm Post subject: |
|
|
Yes, thanks. I am working ok and back on time with the project.
Here is some things that also need to be explained somewhere on,
http://www.dsource.org/projects/ddbi
Code: |
1) Get the SQLite3 DLL from http://www.sqlite.org/download.html
2) Download "Basic Utilities" from http://www.digitalmars.com/download/freecompiler.html
3) implib /s sqlite3.lib sqlite3.dll (Creates a Lib from a DLL)
4) place on [c:]\dmd\lib
5) place the dbi trunk on your path or use the -I option to pass it to.
|
Anyway, thanks for all your help.
jic |
|
Back to top |
|
|
brad Site Admin
Joined: 22 Feb 2004 Posts: 490 Location: Atlanta, GA USA
|
|
Back to top |
|
|
jicman
Joined: 22 Dec 2004 Posts: 298 Location: Rochester, NY
|
Posted: Fri Jan 05, 2007 10:57 pm Post subject: |
|
|
I didn't know that. Let me put something together with more logistic data and post it there. |
|
Back to top |
|
|
betty_betty2008
Joined: 29 Apr 2007 Posts: 1
|
Posted: Sat Jan 05, 2008 10:10 pm Post subject: |
|
|
Dear Sirs,
I am almost crazy for the compile of ddbi.I have dmd 1.015+the lasted phobos+the lasted bud+DDBI 0.25 trunk.I use implib to compile sqlite3.lib successfully and placed it in dmd\lib.Now I use dmd -run buildme.d all to compile but the error is as below:
buildme.d(39):module FileConst cannot read file 'tango\io\FileConst.d'
Does tango is a must for compile DDBI?
I am liking D so much but so many stones on my way...
God saves someone can help me on this and let me have a try on database with D.I was so eager to do so for a very very long time but every time the DDBI can not passed...
Regards,
Sam |
|
Back to top |
|
|
larsivi Site Admin
Joined: 27 Mar 2004 Posts: 453 Location: Trondheim, Norway
|
Posted: Sun Jan 06, 2008 5:23 am Post subject: |
|
|
For DDBI trunk (latest release is very outdated) Tango is required. |
|
Back to top |
|
|
samhu.samhu
Joined: 05 Jan 2008 Posts: 6
|
Posted: Thu Jan 10, 2008 8:00 pm Post subject: |
|
|
I reinstalled DMD with tango and pobos side by side under the instruction of Method 1 on the webpage:
http://www.dsource.org/projects/tango/wiki/PhobosTangoCooperation
Now I can compile d source code either using phobos or using tango.But still can not compile DDBI under your instruction of
1) Get the SQLite3 DLL from http://www.sqlite.org/download.html
2) Download "Basic Utilities" from http://www.digitalmars.com/download/freecompiler.html
3) implib /s sqlite3.lib sqlite3.dll (Creates a Lib from a DLL)
4) place on [c:]\dmd\lib
5) place the dbi trunk on your path or use the -I option to pass it to.
I really need help to fix this problem ,for example ,It would be grateful if anybody would like give me a step by step instruction from the first step to the end,compile a testDdbi source.Thanks...
Sam |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|