I have read almost whole internet about setting up SQLite3 but without effect! I am really frustrated at this point and I would really appreciate some assistance with it. I am not going to describe all errors and problems I went through, instead I would like you to take my step by step through this process. I would REALLY appreciate this!!!!!!!!
In details, I would like to use SQLite3 database in my C++ project. I would like to set it up for Code::Blocks AND Sublime Text(although setting this up for Sublime Text is not necessary). I use Linux Mint. THANK YOU FOR YOUR HELP!!!
Have a nice day !!!
is it the same as just installing SQLite3? If so i have it already installed an i can use it from terminal?
if it is not the same how should i install it?
I do guess that the sqlite is first and foremost a library that is called and linked with other code, just like, say the iostream.
If you already have a compiled binary of a program, then you only need the library file(s). Dynamically linked, shared objects, ...
My guess is that Mint has that in package named libsqlite3.
For compiling a program you do need the header file(s) of the library. You need to include the necessary headers in your source code and you need to tell the linker to use the library. Mint seems to put the header file in package named libsqlite3-dev. If a library has name libfoo.so, then one would add option -lfoo for g++ (that passes it to linker).
There is probably a dependency that installing libsqlite3-dev will install the library package too.
I don't use Mint, but it probably has both CLI and GUI package management tools. If you don't know how to use them, then you really should learn.
The Code::Blocks and Sublime are some GUI gizmos? Do they have a concept of "project" and a button to "build"? There is probably some "additional libraries to link into project" option too?
when i try to include it by #include <sqlite3.h> and pass -lsqlite3 to g++ compiler it still gives me an error that sqlite3.h no such a file or directory. when i compile it in codeblcks it says that it cannot find -lsqlite3. This is when i try to complite c program from https://www.tutorialspoint.com/sqlite/sqlite_c_cpp.htm. the first one titled "connecting to database".
Idea: Maybe compiler doesnt have path provided to sqlite3? Becuase I can use it perfectly fine from the terminal...
I have: libsqlite3.so in /opt/google/earth/free type: unknown
libsqlite3.so.0 in /usr/lib/i386-linux-gnu type: Link to unknown
libsqlite3.so.0.8.6 in /usr/lib/i386-linux-gnu type: unknown
I have sqlite3.h in home/filip/Downloads/sqlite-autoconf-3180000
You were right libsqlite3-dev wasnt installed. Now I've installed it and used this command: g++ SQLite3.c -l sqlite3
no errors, but compiler didnt create executable file...