FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Compiling program on Linux, DMD and Tango with DSSS [newbie]

 
Post new topic   Reply to topic     Forum Index -> DDBI
View previous topic :: View next topic  
Author Message
piotrek



Joined: 16 Aug 2008
Posts: 6

PostPosted: Sat Aug 16, 2008 4:34 am    Post subject: Compiling program on Linux, DMD and Tango with DSSS [newbie] Reply with quote

I'm trying to compile a simple program but I haven't managed to.

I performed following steps:
Installed DMD, Tango, ddbi(ddbi is installed in DSSS directory with net install command)
I have sqlite library installed on Ubuntu (version 3.4.2).
I have created the dsss.conf file.

Code:
[sql.d]


And sql.d file source:
Code:
import dbi.sqlite.SqliteDatabase;
import dbi.Row;
import tango.io.Stdout;

void main() {
    SqliteDatabase db = new SqliteDatabase();
    db.connect("test.db");

    Row[] rows = db.queryFetchAll("SELECT * FROM names");
    foreach (Row row; rows) {
        Stdout("name:")(row["name"]).newline()("zip:")(row["zip"]).newline();
    }

    db.close();
}


And I'm trying to execute command
Code:
$~/ddev/proj/sqlite$ dsss build -version=dbi_sqlite

But I get this errors:
Code:

sql.d => sql
+ /home/piotrek/ddev/dsss/bin/rebuild -Idsss_imports/ -I. -S./ -I/home/piotrek/ddev/dsss/include/d -S/home/piotrek/ddev/dsss/lib/ -version=dbi_sqlite  -I/home/piotrek/ddev/dsss/include/d -S/home/piotrek/ddev/dsss/lib -I/home/piotrek/d/include/d -S/home/piotrek/d/lib  -oqdsss_objs/D  sql.d -ofsql
WARNING: Module sql.d does not have a module declaration. This can cause problems
         with rebuild's -oq option. If an error occurs, fix this first.
Please post your usage of tango.group to this ticket: http://dsource.org/projects/tango/ticket/1013
Please post your usage of tango.group to this ticket: http://dsource.org/projects/tango/ticket/1013
dsss_objs/D/nmd_sql.o: In function `_Dmain':
sql.d:(.text._Dmain+0x9): undefined reference to `_D3dbi6sqlite14SqliteDatabase 14SqliteDatabase7__ClassZ'
sql.d:(.text._Dmain+0x14): undefined reference to `_D3dbi6sqlite14SqliteDatabase 14SqliteDatabase5_ ctorMFZC3dbi6sqlite14 SqliteDatabase 14SqliteDatabase'
collect2: ld returned 1 exit status
--- errorlevel 1
Command /home/piotrek/ddev/dsss/bin/rebuild returned with code 65280, aborting.
Error: Command failed, aborting.


Any suggestions?
Back to top
View user's profile Send private message Send e-mail
larsivi
Site Admin


Joined: 27 Mar 2004
Posts: 453
Location: Trondheim, Norway

PostPosted: Sat Aug 16, 2008 5:09 am    Post subject: Reply with quote

Somewhat difficult to say what is happening here, but it is possible that the DDBI in dsss repo is outdated, such that you would be better off using dsss install in the ddbi src root.
Back to top
View user's profile Send private message
piotrek



Joined: 16 Aug 2008
Posts: 6

PostPosted: Sat Aug 16, 2008 5:47 am    Post subject: Reply with quote

Thanks for reply.
I manually copied the ddbi source files form the trunk to dsss import directory but I get the same error. I guess it's something wrong with linking the sqlite library (maybe wrong lib version or there's a need to give exclipt path or something similar but I have no idea where to look).

I only successfully compiled ddbi library (with info: You will need to manually link in the InterBase library) and testddbi - using dsss.

OK. Thanks again. I thought I made some obvious mistake but if that error info doesn't say much I will try it later. Fortunately I have option to use Windows platform so I'll go there for the time being.
Back to top
View user's profile Send private message Send e-mail
larsivi
Site Admin


Joined: 27 Mar 2004
Posts: 453
Location: Trondheim, Norway

PostPosted: Sat Aug 16, 2008 5:51 am    Post subject: Reply with quote

Hmm, if you compiled and installed DDBI, then you may have missed the -version=dbi_sqlite at that point? Without it, the library won't contain the sqlite portions
Back to top
View user's profile Send private message
piotrek



Joined: 16 Aug 2008
Posts: 6

PostPosted: Sat Aug 16, 2008 6:37 am    Post subject: Reply with quote

Actually I haven't installed compiled lib. I was just wondering If it compiles. (and it compiles).

I moved the directory with source files (trunk/dbi) into directory dsss/include/d/ which is used during compilation. And then perform compilation using the command: dsss build -version=dbi_sqlite . That's all.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> DDBI All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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