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 = &pSrc->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

Reply via email to