Re: [sqlite] Problem building amalgamation
> On Jun 14, 2017, at 11:03 AM, Simon Slavinwrote: > > This problem is especially bad on Apple devices, since many people use ".c" > as an extension for C++ files, when Apple’s compiler assumes they’ll use > ".cpp". I think you mean “.C” (with a capital C) which I’ve seen used occasionally for C++, though not in a long time. Since the Mac filesystem is case-insensitive (though case-preserving), I believe the logic that maps extensions to languages ignores case, so treats “.C” like “.c”. —Jens ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Problem building amalgamation
g++ assumes that all source input files are c++ sqlite3.c is C source, not C++ Compile the C files using gcc using the -c option (to output .o files) Compile the C++ files using gcc or g++ using the -c option (to output .o files) Link the files using g++ so that the c++ runtime is included OR link using gcc and manually add the -lstdc++ runtime library Alternatively you can use gcc for the compile & link all-in-one step and manually add the library -lstdc++ -- ˙uʍop-ǝpısdn sı ɹoʇıuoɯ ɹnoʎ 'sıɥʇ pɐǝɹ uɐɔ noʎ ɟı > -Original Message- > From: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] > On Behalf Of Jeff Archer > Sent: Wednesday, 14 June, 2017 07:33 > To: SQLite mailing list > Subject: [sqlite] Problem building amalgamation > > SQLite 3.13.0 > > I have just grabbed the sqlite3.c and sqlite3.h from another (working) > project and dropped then into a new project and I am seeing compile > errors. > > New project is a C++ project in Eclipse. using GCC 5.4.0 from cygwin64. > Just trying to make a simple command line app. > > I'm sure I'm missing something simple but nothing is clicking... > > > g++ -std=c++11 -fpermissive -P -dD -o HelloCPP.exe HelloCPP.cpp sqlite3.c > > > Errors... > > sqlite3.c:25153:48: error: cannot convert 'SrcList::SrcList_item*' to > 'SrcList_item*' in initialization > struct SrcList_item *pItem = >a[k]; > ^ > sqlite3.c:25156:18: error: invalid use of incomplete type 'struct > SrcList_item' > if( pItem->zDatabase ){ > ^ > > sqlite3.c:25157:49: error: invalid use of incomplete type 'struct > SrcList_item' >sqlite3StrAccumAppendAll(pAccum, pItem->zDatabase); > ^ > ___ > sqlite-users mailing list > sqlite-users@mailinglists.sqlite.org > http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Problem building amalgamation
On 14 Jun 2017, at 6:55pm, Clemens Ladischwrote: > Jeff Archer wrote: >> I have just grabbed the sqlite3.c and sqlite3.h from another (working) >> project and dropped then into a new project and I am seeing compile errors. >> >> New project is a C++ project > > SQLite is not C++ but C. But most compilers can cope with both in the same project. Just make sure that your compiler compiles files with ".c" extension as C and not C++. This problem is especially bad on Apple devices, since many people use ".c" as an extension for C++ files, when Apple’s compiler assumes they’ll use ".cpp". Simon. ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Problem building amalgamation
Jeff Archer wrote: > I have just grabbed the sqlite3.c and sqlite3.h from another (working) > project and dropped then into a new project and I am seeing compile errors. > > New project is a C++ project SQLite is not C++ but C. Regards, Clemens ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] Problem building amalgamation
SQLite 3.13.0 I have just grabbed the sqlite3.c and sqlite3.h from another (working) project and dropped then into a new project and I am seeing compile errors. New project is a C++ project in Eclipse. using GCC 5.4.0 from cygwin64. Just trying to make a simple command line app. I'm sure I'm missing something simple but nothing is clicking... g++ -std=c++11 -fpermissive -P -dD -o HelloCPP.exe HelloCPP.cpp sqlite3.c Errors... sqlite3.c:25153:48: error: cannot convert 'SrcList::SrcList_item*' to 'SrcList_item*' in initialization struct SrcList_item *pItem = >a[k]; ^ sqlite3.c:25156:18: error: invalid use of incomplete type 'struct SrcList_item' if( pItem->zDatabase ){ ^ sqlite3.c:25157:49: error: invalid use of incomplete type 'struct SrcList_item' sqlite3StrAccumAppendAll(pAccum, pItem->zDatabase); ^ ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users