Hi,
I am using Debian 11.
I want to setup CodeBlocks for use of SQLite, having following simple program:
#include<stdio.h>
#include <sqlite3.h>
int main(int argc, char* argv[]) {
sqlite3 *db;
char *zErrMsg = 0;
int rc;
rc = sqlite3_open("test.db", &db);
if( rc ) {
printf("Can't open database: %s\n", sqlite3_errmsg(db));
return(0);
} else {
printf("Database successfully opened\n");
}
sqlite3_close(db);
}
At command line
# gcc testsq01.c -l sqlite3 -o testsq01 works without problems.
In Settings / Compiler - Linker settings I added
/usr/lib/x86_64-linux-gnu/libsqlite3
/usr/lib/x86_64-linux-gnu/libpthread.a
/usr/lib/x86_64-linux-gnu/libdl.a
Build leads to
...
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libsqlite3.a(sqlite3.o)||in function `unixDlOpen':|
||warning: Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking|
||warning: relocation against `_dl_init_static_tls' in read-only section `.text'
...
I'd like to use the existing libraries an not copy anything into the code directory.
What is wrong with my CodeBlocks setup?
Thanks
Michel
Because of posting problems see my following reply