Sqlite Undefined Reference To `sqlite3_open' Error In Netbeans C++ On Ubuntu, Integrating Sqlite Into Netbeans C++ Ubuntu
Solution 1:
(please see EDIT below)
Not sure how C++ works in NetBeans, but your adding libsqlite3.a looks pretty good. Now if you have a Makefile you could edit it and define (or edit) the LDFLAGS variable, and pass it as an option to the linker...
SQLite in its default configuration needs to link with libdl and libpthread, that is why you might need to add -ldl -lpthread to your linking options.
For instance (if this is possible in NetBeans) add this to your Makefile :
LDFLAGS= -ldl -lpthread
In my projects I use it like so :
target: $(OBJ)
gcc $(LDFLAGS)$(OBJ) -o $@EDIT :
Actually it is also possible to add linker options in the GUI, without editing the Makefile by hand :
In submenu Configuration Properties -> Linker -> Command Line, just add -ldl -lpthread in "Additional options" and recompile your project.
Solution 2:
Integrating Sqlite into Netbeans on Linux 1)Synaptic Package Manager - Install libsqlite3-dev 2)Netbeans->Your_Project Properties->Linker->Libraries->Add Library-> libsqlite3.a 3)#include sqlite3.h It works!
Post a Comment for "Sqlite Undefined Reference To `sqlite3_open' Error In Netbeans C++ On Ubuntu, Integrating Sqlite Into Netbeans C++ Ubuntu"