versuche grade ne SQL Datenbank in C einzubinden und kriege dabei diese Fehlermeldung:
Fehlermeldungen:
Code: Alles auswählen
"undefined reference to ||=== Build: Debug in database (compiler: GNU GCC Compiler) ===|
/usr/bin/ld: obj/Debug/sqlite3.o||in function `pthreadMutexAlloc':|
/home/n4seweis/programming/learnC/k16/sqlite3.c|26691|undefined reference to `pthread_mutexattr_init'|
/usr/bin/ld: /home/n4seweis/programming/learnC/k16/sqlite3.c|26692|undefined reference to `pthread_mutexattr_settype'|
/usr/bin/ld: /home/n4seweis/programming/learnC/k16/sqlite3.c|26694|undefined reference to `pthread_mutexattr_destroy'|
/usr/bin/ld: obj/Debug/sqlite3.o||in function `pthreadMutexTry':|
/home/n4seweis/programming/learnC/k16/sqlite3.c|26836|undefined reference to `pthread_mutex_trylock'|
/usr/bin/ld: obj/Debug/sqlite3.o||in function `sqlite3ThreadCreate':|
/home/n4seweis/programming/learnC/k16/sqlite3.c|30744|undefined reference to `pthread_create'|
/usr/bin/ld: obj/Debug/sqlite3.o||in function `sqlite3ThreadJoin':|
/home/n4seweis/programming/learnC/k16/sqlite3.c|30764|undefined reference to `pthread_join'|
/usr/bin/ld: obj/Debug/sqlite3.o||in function `unixDlOpen':|
/home/n4seweis/programming/learnC/k16/sqlite3.c|40398|undefined reference to `dlopen'|
/usr/bin/ld: obj/Debug/sqlite3.o||in function `unixDlError':|
/home/n4seweis/programming/learnC/k16/sqlite3.c|40412|undefined reference to `dlerror'|
/usr/bin/ld: obj/Debug/sqlite3.o||in function `unixDlSym':|
/home/n4seweis/programming/learnC/k16/sqlite3.c|40438|undefined reference to `dlsym'|
/usr/bin/ld: obj/Debug/sqlite3.o||in function `unixDlClose':|
/home/n4seweis/programming/learnC/k16/sqlite3.c|40443|undefined reference to `dlclose'|
||error: ld returned 1 exit status|
||=== Build failed: 11 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|
Code: Alles auswählen
#include <stdio.h>
#include <stdlib.h>
#include"sqlite3.h"
int main()
{
sqlite3 *db;
int rc;
rc=sqlite3_open("test.db",&db);
if(rc !=0){
printf("Datenbanken konnte nicht geöffnet werden %s \n",sqlite3_errmsg(db));
exit (EXIT_FAILURE);
} else{
printf("Datenbanken erfolgreich geöffnet");
}
sqlite3_close(db);
return 0;
}