www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - using sqlite3

reply Knud Soerensen <4tuu4k002 sneakemail.com> writes:
When using etc.c.sqlite3  i get the following errors.

usr/include/dmd/phobos/etc/c/sqlite3.d:(.text._Dmain+0x98): undefined
reference to `sqlite3_open'
/usr/include/dmd/phobos/etc/c/sqlite3.d:(.text._Dmain+0xa7): undefined
reference to `sqlite3_errmsg'
/usr/include/dmd/phobos/etc/c/sqlite3.d:(.text._Dmain+0xcc): undefined
reference to `sqlite3_close'

What am I doing wrong ?


My code look like this.



import etc.c.sqlite3;

void main()
{

 sqlite3* db;
  int code=sqlite3_open("file.db", &db);

  if (SQLITE_OK != code)		
   {
      printf("DB create error: %s\n", sqlite3_errmsg(db));
   }
   printf("DB open!\n");

   sqlite3_close(db);
   printf("DB closed.\n");


}


-- 
Join me on
Skype	   knudhs
Facebook   http://www.facebook.com/profile.php?id=1198821880
Linkedin   http://www.linkedin.com/pub/0/117/a54
Twitter    http://twitter.com/knudsoerensen
bitcoin donations: 13ofyUKqFL43uRJHZtNozyMVP4qxKPsAR2
Jan 15 2013
parent reply "Adam D. Ruppe" <destructionator gmail.com> writes:
You might have to add -L-lsqlite3 to your dmd command line, to 
link in the library.

May also be necessary to install the sqlite library, e.g. "yum 
install sqlite-devel" on red hat linuxes.
Jan 15 2013
parent Knud Soerensen <4tuu4k002 sneakemail.com> writes:
On 2013-01-15 22:02, Adam D. Ruppe wrote:
 You might have to add -L-lsqlite3 to your dmd command line, to link in
 the library.
 
 May also be necessary to install the sqlite library, e.g. "yum install
 sqlite-devel" on red hat linuxes.
Thanks, I just added it to my /etc/dmd.conf -- Join me on Skype knudhs Facebook http://www.facebook.com/profile.php?id=1198821880 Linkedin http://www.linkedin.com/pub/0/117/a54 Twitter http://twitter.com/knudsoerensen bitcoin donations: 13ofyUKqFL43uRJHZtNozyMVP4qxKPsAR2
Jan 15 2013