This is not a link issue, but a compiler one. SQLite is ANSI C, so you
should compile it with gcc. It will still be usable within your C++
library/project, as sqlite3.h qualifies all functions extern "C".
For example, given a C++ file main.cpp:
#include <sqlite3.h>
int main()
{
sqlite3* db;
sqlite3_open("foo.db", &db);
sqlite3_close(db);
return 0;
}
Build it as follows:
gcc -c sqlite3.c
g++ -c main.cpp
g++ -o program main.o sqlite3.o -lpthread -ldl
Just make sure you associate .c files with gcc in your makefile and
this will be taken care of for you automatically. Something like:
.cpp.o:
$(CPP) -c $(CPPFLAGS) $<
.c.o:
$(CC) -c $(CFLAGS) $<
-- Mike
On Dec 16, 2007 11:50 AM, David Gelt <[EMAIL PROTECTED]> wrote:
> Hi there,
>
> I have compiled version 3.5.2 of the amalgamation in C without any errors or
> warnings but when I am trying to do the same in C++ using g++ I keep getting
> lots of errors and warnings. I have -ldl -lpthread in Makefile and running
> Fedora Core 6.
>
> Here are some reported errors and warnings:
> ./sqlite3.c:4265: error: uninitialized const 'sqlite3One'
> ../sqlite3.c: In function 'void computeJD(DateTime*)':
> ../sqlite3.c:7241: warning: converting to 'int' from 'double'
> .....................................................
> ../sqlite3.c: In function 'void strftimeFunc(sqlite3_context*, int,
> sqlite3_value**)':
> ../sqlite3.c:7840: error: invalid conversion from 'void*' to 'char*'
> .....................................................
>
> Do I need to define other flags or do something else?
>
> Thanks in advance.
>
> Regards,
> David
>
>
> ---------------------------------
> Looking for last minute shopping deals? Find them fast with Yahoo! Search.
-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------