1
votes

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.

1
Are you using the extern keyword to include sqlite.c to your project.macroland
No, I added sqlite3.c to SOURCES in qmake file and include sqlite3.h in other filesRem

1 Answers

1
votes

I can be sure that what happened is the "crossing" of includes.

From what you listed, the compilation of sqlite3.c happens with a lot of "-Ipath_to_qt", so include paths to qt headers are propagated.

Then, for example, sqlite3.c includes config.h to read options how sqlite should be configured. Sure there is another config.h coming from some qt include folder and this config.h brings references/subincludes to qt.