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

Compile errors

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



Joined: 07 Jul 2005
Posts: 1

PostPosted: Thu Jul 07, 2005 8:25 am    Post subject: Compile errors Reply with quote

Has anyone tried to compile the libraries for use on Windows? I am new to 'D' and would appreciate any guidance from someone who has it working on their Windows box.
I did notice that there where a few errors that needed correcting like '!==' converted to '!is'.
Back to top
View user's profile Send private message
MarkD



Joined: 18 Jul 2005
Posts: 8

PostPosted: Mon Jul 18, 2005 3:00 pm    Post subject: Reply with quote

Haven't gotten it working yet. Here's what I've done so far:

- changed the !=='s to !is's like you said.
- commented out a typedef line within a version(windows) block...
- ran the makefile (required me to find that build.exe file, and I renamed the .a's to .lib's)

My current problem is that :
Code:
import dbi.sqlite.SqliteDatabase;
int main(char[][] args) {return 0;}

compiles fine, but :
Code:
import dbi.sqlite.SqliteDatabase;
int main(char[][] args)
{
   SqliteDatabase db = new SqliteDatabase();
   db.connect("mydb.sqlite");
   db.close();
   return 0;
}

compiles, but does not link into an .exe. This probably has to do with my lack of knowledge rather than anything else. I get ~15 "Symbol Undefined" errors (_sqlite3_open, _sqlite3_close, etc...).

I am trying "dmd unittest_sqlite.d libddbi_sqlite3.lib"

I'll let you know if I get it working...
Back to top
View user's profile Send private message
MarkD



Joined: 18 Jul 2005
Posts: 8

PostPosted: Fri Jul 22, 2005 2:20 am    Post subject: Reply with quote

Okay, after sinking my teeth into it for way too long... here's what I had to do to get DDBI with SQLite working on Windows:

Prep work:
1) Clean up that .d code a bit as previously stated.
2) Get the SQLite3 DLL from http://www.sqlite.org/download.html (I used sqlitedll-3_2_2.zip)
3) Download "Basic Utilities" from http://www.digitalmars.com/download/freecompiler.html

Actual steps:
1) Run makefile (after replacing .a with .lib) to get libddbi_sqlite3.lib
2) implib /s sqlite3.lib sqlite3.dll (Creates a Lib from a DLL)
3) dmd unittest_sqlite.d libddbi_sqlite3.lib sqlite3.lib

Enjoy! I'll test it in the morning, but that gets me an exe - finally!
_________________
Mark Delano
Back to top
View user's profile Send private message
mitja



Joined: 18 Feb 2005
Posts: 19

PostPosted: Tue Aug 16, 2005 8:49 am    Post subject: Reply with quote

Hi!

I did exactly like you described (although it seems weird way to me), but to no avail. Linker still complains about symbols it can't find definitions for:
Code:
sq.obj(sq)
 Error 42: Symbol Undefined __Class_3dbi6sqlite14SqliteDatabase14SqliteDatabase
sq.obj(sq)
 Error 42: Symbol Undefined _D3dbi6sqlite14SqliteDatabase14SqliteDatabase5_ctorF
ZC3dbi6sqlite14SqliteDatabase14SqliteDatabase
--- errorlevel 2
.

I compiled all your .d files needed for sqlite into one library file, then made a .lib out of a .dll you suggested, but it still doesn't work.

Maybe should I export functions in the source somehow?

And which makefile are you talking about? I just named filenames to be compiled into a .bat file.


Kind regards,
Mitja Ursic
Back to top
View user's profile Send private message
MarkD



Joined: 18 Jul 2005
Posts: 8

PostPosted: Tue Aug 16, 2005 3:52 pm    Post subject: Reply with quote

Quote:
I compiled all your .d files needed for sqlite into one library file, then made a .lib out of a .dll you suggested, but it still doesn't work.

Maybe should I export functions in the source somehow?

And which makefile are you talking about? I just named filenames to be compiled into a .bat file.

Hi. =) First, they aren't my .d files in any possible way! =)

When I say Makefile I'm talking about the one that comes with DDBI, not one that you need to make yourself. I had to run it once myself and it made the database-specific libraries (I added c:\dm\bin to my path, and then typed "make"). Since I wanted to try SQLite, I used the libddbi_sqlite3.lib file that it created. I suppose you don't have to do it that way, of course.

I was not able to successfully compile until I had both sqlite3.lib (created from the SQLite-provided DLL) and libddbi_sqlite3.lib (created by the Makefile and which is the DDBI stuff). Then it was easy enough to just type: dmd unittest_sqlite.d libddbi_sqlite3.lib sqlite3.lib

All of those steps may be a bit convulted but I don't know that any of them can be skipped. I had no luck at all trying to directly compile the DDBI files together with a short test of my own.
_________________
Mark Delano
Back to top
View user's profile Send private message
DuronXP



Joined: 09 Apr 2007
Posts: 3

PostPosted: Mon Apr 09, 2007 6:51 am    Post subject: Reply with quote

Since Tango version Library can't compiIed, I use -version=Phobos to compile library.

Then I try example below:
I try to connect to mySQL in Apache2Tried i use.
Code:

private import dbi.all;
private import dbi.mysql.all;

void main(char[][] args)
{
  MysqlDatabase db = new MysqlDatabase("host=localhost", "root", "triadpass");
  db.connect("host=localhost;dbname=egrup", "root", "triadpass");
}


I tried the example, but won't work

Code:
H:\myProject\D>dmd cobamysql.d -version=Phobos
h:\dmd\bin\..\..\dm\bin\link.exe cobamysql,,,user32+kernel32/noi;
OPTLINK (R) for Win32  Release 7.50B1
Copyright (C) Digital Mars 1989 - 2001  All Rights Reserved

cobamysql.obj(cobamysql)
 Error 42: Symbol Undefined _D3dbi5mysql13MysqlDatabase13MysqlDatabase7__ClassZ
cobamysql.obj(cobamysql)
 Error 42: Symbol Undefined _D3dbi5mysql13MysqlDatabase13MysqlDatabase5_ctorMFAa
AaAaZC3dbi5mysql13MysqlDatabase13MysqlDatabase
--- errorlevel 2


I try get a mysql DLL from my Apache2Triad directory and use implib to make mysql lib files, then i link with my file, but also dont work.[/code]
Back to top
View user's profile Send private message
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