It looks very much as if your SQL statement is being truncated when you pass it to sqlite3_prepare. Are all your character arrays adequately sized?
JS

Matthew Veenstra wrote:
Hello,

First of Kudos for a such a great program. SQLite is easy to use, fast, and portable.

Now to my question.

I am building a Mac OS X universal binary framework (think dll or dylib). I build this with a makefile I did by hand based on the results of configure and the generic make file.

This builds and links properly to my application. I am testing with a very simple sample SQL "SELECT column1, column2 FROM table1". I can call sqlite3_exec() fine and return results. But when I try and parse the same SQL statement with sqlite3_prepare() this fails with error SQLITE_ERROR. As I step through to see where it is failing I find it fails at line 485 sqlite3RunParser() with an error zErrMsg "near "SELE": syntax error". Obviously this is not a problem as the statement looks perfect as it enters sqlite3RunParser().

If I link to the included version 3.1.3 all works properly. Is there a difference between 3.3.5 and 3.1.3 on how sqlite3_prepare() works?

If I just build with ./configure and make. I cannot link to the resulting dylib and find the proper symbols. Not sure what is up with this.

These are the flags I pass from to gcc to build libsqlite.

    -fno-common \
    -g \
    -DTHREADSAFE=0 \
    -DSQLITE_THREAD_OVERRIDE_LOCK=-1 \
    -DOS_UNIX=1 \
    -DHAVE_USLEEP=1 \
    -DSQLITE_OMIT_CURSOR \
    -DPIC \
    -I/src \
    -I. \
    -isysroot /Developer/SDKs/MacOSX10.4u.sdk \
    -arch i386 \
    -arch ppc \
    -Wall

Does anyone have any ideas? Am I missing something simple? I have not tested on another platform yet.

Thanks for you time,
Matt Veenstra
tribalmedia




Reply via email to