Thank you for your answer Stephan 
I tried to adding -L command apparently it solved the problem but another error 
occur.


root@ubuntu:/home/y_sako/Documents/sqlite-amalgamation-3071100# gcc 
-L/home/y_sako/Documents/sqlite-amalgamation-3071100/ -lsqlite -L/usr/lib/ -ldl 
-lpthread -o compil compil.c  
/tmp/cccbS6DV.o: In function `main': 
compil.c:(.text+0x6f): multiple definition of `main' 
/home/y_sako/Documents/sqlite-amalgamation-3071100//libsqlite.a(shell.o):shell.c:(.text+0x7515):
 first defined here 
collect2: ld a retourné 1 code d'état d'exécution 


I tried to add just the sqlite.c file in the library and recompile and there 
the first problem is comeback. 

root@ubuntu:/home/y_sako/Documents/sqlite-amalgamation-3071100# ar -rv 
libsqlite.a sqlite3.o 
ar: creating libsqlite.a 
a - sqlite3.o 
root@ubuntu:/home/y_sako/Documents/sqlite-amalgamation-3071100# gcc 
-L/home/y_sako/Documents/sqlite-amalgamation-3071100/ -lsqlite -L/usr/lib/ -ldl 
-lpthread -o compil compil.c  
/tmp/cc7IDdvz.o: In function `main': 
compil.c:(.text+0xc3): undefined reference to `sqlite3_open' 
compil.c:(.text+0xda): undefined reference to `sqlite3_errmsg' 
compil.c:(.text+0x101): undefined reference to `sqlite3_close' 
compil.c:(.text+0x138): undefined reference to `sqlite3_exec' 
compil.c:(.text+0x16d): undefined reference to `sqlite3_free' 
compil.c:(.text+0x179): undefined reference to `sqlite3_close' 
collect2: ld a retourné 1 code d'état d'exécution


do you see what I have to changed? 

-----Message d'origine-----
De : sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] 
De la part de Stephan Beal
Envoyé : jeudi 12 avril 2012 16:18
À : General Discussion of SQLite Database
Objet : Re: [sqlite] error compilation with Sqlite in C program

On Thu, Apr 12, 2012 at 4:14 PM, Sako Youssouf <
youssouf.s...@renault-trucks.com> wrote:

> root@ubuntu:/home/y_sako/Documents/sqlite-amalgamation-3071100# gcc
> -lsqlite -o compil compil.c
>

Are you sure your -lsqlite isn't picking up an sqlite2 under /usr/lib?
Could you try adding -L. to your compile command?

-- 
----- stephan beal
http://wanderinghorse.net/home/stephan/
http://gplus.to/sgbeal
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to