Thread overview
using sqlite3
Jan 15, 2013
Knud Soerensen
Jan 15, 2013
Adam D. Ruppe
Jan 15, 2013
Knud Soerensen
January 15, 2013
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
January 15, 2013
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.
January 15, 2013
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