Long time ago I added sqlite3.c file to my qmake project and successfully compiled this project for months using msvc-2013 and gcc-5.2 64 bit compilers.
However when I tried to recompile this project recently it compiles all files successfully but sqlite3.c file!!! and it gives me strange error messages:
cl -c -nologo -Zc:wchar_t -FS -Zc:strictStrings -Zi -MDd -W3 -w44456 -w44457 -w44458 /Fddebug\Builder3d.pdb -DUNICODE -DWIN32 -DWIN64 -DVL_PLATFORM_WINDOWS=1 -DVL_OPENGL=1 -D_UNICODE=1 -DNOMINMAX -D_USE_MATH_DEFINES -D_SCL_SECURE_NO_WARNINGS -DPROTOBUF_USE_DLLS -DB3D_DEBUG -DQT_GUI_LIB -DQT_SQL_LIB -DQT_WEBSOCKETS_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I..\Builder3d -I. -I..\libs\c3d\v98099\Win64_Visual_Studio_2013_Unicode\Include -I..\libs -I..\libs\protobuf\cmake\build\debug\include -ID:\Qt\5.7\msvc2015_64\include -ID:\Qt\5.7\msvc2015_64\include\QtGui -ID:\Qt\5.7\msvc2015_64\include\QtANGLE -ID:\Qt\5.7\msvc2015_64\include\QtSql -ID:\Qt\5.7\msvc2015_64\include\QtWebSockets -ID:\Qt\5.7\msvc2015_64\include\QtNetwork -ID:\Qt\5.7\msvc2015_64\include\QtCore -Idebug -ID:\Qt\5.7\msvc2015_64\mkspecs\win32-msvc2015 -Fodebug\ @C:\Users\Rem\AppData\Local\Temp\sqlite3.obj.20112.0.jom sqlite3.c
D:\Qt\5.7\msvc2015_64\include\QtCore/qnamespace.h(53): error C2143: syntax error: missing '{' before '*'
D:\Qt\5.7\msvc2015_64\include\QtCore/qnamespace.h(68): error C2061: syntax error: identifier 'Qt'
D:\Qt\5.7\msvc2015_64\include\QtCore/qnamespace.h(68): error C2059: syntax error: ';'
D:\Qt\5.7\msvc2015_64\include\QtCore/qnamespace.h(68): error C2449: found '{' at file scope (missing function header?)
So when compiling sqlite3.c it gives me tons of errors from qt libraries despite the fact sqlite3.c do not include any of them!!!
PS: The only change in my computer configuration that I can think of is update to MSVC compiler toolchain after installing VS update.
PPS: My project was configured to use msvc2013 & Qt 5.5. After the error I tried to use msvc2015 & Qt 5.7 but the problem persists.
extern
keyword to include sqlite.c to your project. – macroland