Lloyd wrote:
After performing this section I got lots of errors. (I shall Add it
at the end of mail)
Either you're going to have to fix these errors BEFORE you proceed OR
download the pre-built library from the site.
But when I browsed through the output directory, I found the
sqlite3.h file
sqlite3.h is built early on and is no indication that the library build
was successful. Although you can copy it into your source directory, you
shouldn't have to, it is supposed to be installed in a "standard place"
with "make install" so that the compiler can find it automatically.
copied that file too to mu desktop directory
then given the command
gcc sqlite.c -o sqlite
it shown the following erorrs.....
[EMAIL PROTECTED] gcc sqlite.c -o sqlite /tmp/ccE2LJqr.o(.text+0xe1):
In function `main': : undefined reference to `sqlite3_open'
/tmp/ccE2LJqr.o(.text+0xfb): In function `main': : undefined
reference to `sqlite3_errmsg' /tmp/ccE2LJqr.o(.text+0x11d):
Your program includes calls to functions in the SQLite library, but you
didn't successfully build that library so the references to the SQLite
functions in your code cannot be resolved (i.e. linked to the code in
the library).
So I tried this way...
gcc -c sqlite.c -c
thus got the sqlite.o file
All this command does is build a single object file. It doesn't produce
an executable or link your program with the SQLite library.
then I executed the ldconfig command this way
ldconfig /root/Desktop/
ldconfig is nothing to do with this - it updates the system when new
shared libraries are installed, but you haven't built or installed any.
ld /root/Desktop/sqlite-3.3.7.so /root/Desktop/sqlite.o
This too shown eorros..
Dunno what you thought this would do, but it isn't what you wanted it to
do. ;)
[EMAIL PROTECTED] ld /root/Desktop/sqlite-3.3.7.so
/root/Desktop/sqlite.o ld: warning: cannot find entry symbol _start;
defaulting to 080483d8
This is what I meant in my comment to your use of the -c flag. Imagine
that the linker puts a framework (with _start) around your code. You've
omitted that step completely.
Here I am adding the error output of the make command... (I am not
installed TCL on my macine.. and it is not needed)
.../src/tclsqlite.c:20:17: tcl.h: No such file or directory
.../src/tclsqlite.c:54: error: syntax error before "Tcl_Interp"
.../src/tclsqlite.c:54: warning: no semicolon at end of struct or
After you've run configure, open the Makefile in an editor and change
the line that starts HAVE_TCL to "HAVE_TCL =". That will tell make not
to build the Tcl extensions for SQLite. *NB* I think the proper way
round this should be to run configure with the without-tcl option, that
is type "../configure --without-tcl" in step 3.3 but when I tried this
configure failed with an error. I'm pretty sure I've seen a note saying
that configure is unsupported so maybe the failure isn't too surprising.
> Can I use the library alone without recompiling the whole sqlite?
> (Thus it will be easier for me to distribute my application along
> with sqlite)
If all you want to do is build an application using (some version of)
sqlite then just download the library and link against it - you don't
have to download the SQLite source and build it.
Assuming a very simple program saved in a file called ts.c:
---------- cut ----------
#include <stdio.h>
#include <sqlite3.h>
int main(void)
{
printf("SQLIte version: %s\n", sqlite3_libversion());
return 0;
}
---------- cut ----------
The command line to compile ts.c and link with the SQLite library is simply:
gcc -o ts tc.c -lsqlite3
This produces an executable called "ts" in the current directory. When I
run this program (with "./ts") I see:
SQLIte version: 3.3.7
Martin
-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------