Details
-
Bug
-
Resolution: Duplicate
-
P2: Important
-
None
-
5.0.1
-
None
-
Win 7 x86/x64, MSVC2010
Description
When building Qt v5.0.1 with MySQL support, using the standard binary build of Mysql v5.6.10, the compilation of qtwebkit fails, because of a header conflict between:
qt-everywhere-opensource-src-5.0.1\qtwebkit\Source\WebCore\platform\Decimal.h
and
mysql\include\Decimal.h
From qtwebkit's build, see below an excerpt of the failure:
D:\dev\mysql\include\Decimal.h(22) : error C2146: syntax error : missing ';' before identifier 'decimal_digit_t'
D:\dev\mysql\include\Decimal.h(22) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
D:\dev\mysql\include\Decimal.h(22) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
D:\dev\mysql\include\Decimal.h(35) : error C2146: syntax error : missing ';' before identifier 'sign'
D:\dev\mysql\include\Decimal.h(35) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
D:\dev\mysql\include\Decimal.h(35) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
D:\dev\mysql\include\Decimal.h(36) : error C2143: syntax error : missing ';' before '*'
D:\dev\mysql\include\Decimal.h(36) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
D:\dev\mysql\include\Decimal.h(36) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
D:\dev\mysql\include\Decimal.h(40) : error C2061: syntax error : identifier 'my_bool'
D:\dev\mysql\include\Decimal.h(44) : error C2061: syntax error : identifier 'ulonglong'
D:\dev\mysql\include\Decimal.h(45) : error C2065: 'ulonglong' : undeclared identifier
D:\dev\mysql\include\Decimal.h(45) : error C2146: syntax error : missing ')' before identifier 'from'
D:\dev\mysql\include\Decimal.h(45) : error C2059: syntax error : ')'
D:\dev\mysql\include\Decimal.h(46) : error C2061: syntax error : identifier 'longlong'
D:\dev\mysql\include\Decimal.h(47) : error C2065: 'longlong' : undeclared identifier
D:\dev\mysql\include\Decimal.h(47) : error C2146: syntax error : missing ')' before identifier 'from'
D:\dev\mysql\include\Decimal.h(47) : error C2059: syntax error : ')'
f:\qt\qt-everywhere-opensource-src-5.0.1\qtwebkit\source\webcore\html\StepRange.h(66) : error C2146: syntax error : missing ';' before identifier 'defaultValue'
f:\qt\qt-everywhere-opensource-src-5.0.1\qtwebkit\source\webcore\html\StepRange.h(66) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
f:\qt\qt-everywhere-opensource-src-5.0.1\qtwebkit\source\webcore\html\StepRange.h(67) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
The problem is that mysql's decimal.h takes precedence over qtwebkit's decimal.h, because the INCLUDE search path of mysql comes before qtwebkit's.
For instance if I want to build Qt5 with MySQL support I will issue:
qt-everywhere-opensource-src-5.0.1/qtbase/configure <......> -debug -shared -qt-sql-mysql -I D:\dev\mysql\include -L D:\dev\mysql\lib -l libmysqld
but then Qt's build system when compiling source of Webkit appends at the end of the INCLUDE directories, for instance look at how the -I paths are ordered (a bit trimmed down to save space):
SQLStatementSync.cpp
SQLTransaction.cpp
SQLTransactionClient.cpp
SQLTransactionCoordinator.cpp
SQLTransactionSync.cpp
cl -c -nologo -Zm200 -Zc:wchar_t -wd4291 -wd4344 -wd4396 -wd4503 -wd4800 -wd4819 -wd4996 -Zi -MDd -MP -GR -DUNICODE -DWIN32 -DSQLITE_CORE -DSQLITE_OMIT_LOAD_EXTENSION -DSQLITE_OMIT_COMPLETE -DBUILDING_QT__=1 -DENABLE_3D_RENDERING=1 -DENABLE_BLOB=1 -DENABLE_CHANNEL_MESSAGING=1 -DENABLE_CSS_BOX_DECORATION_BREAK=1 -DENABLE_CSS_COMPOSITING=1 -DENABLE_CSS_EXCLUSIONS=1 -DENABLE_CSS_FILTERS=1 -DENABLE_CSS_IMAGE_SET=1
<...............................>
-DQT_MULTIMEDIA_LIB -DQT_SQL_LIB -DQT_NETWORK_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I"D:\dev\mysql\include" -I"F:\qt\qt-everywhere-opensource-src-5.0.1\qtwebkit\Source\WebCore" -I"F:\qt\qt-everywhere-opensource-src-5.0.1\qtwebkit\Source\WebCore\Modules\filesystem" -I"F:\qt\qt-everywhere-opensource-src-5.0.1\qtwebkit\Source\WebCore\Modules\geolocation" -I"F:\qt\qt-everywhere-opensource-src-5.0.1\qtwebkit\Source\WebCore\Modules\indexeddb"
<...............................>
-I"F:\qt\qt-everywhere-opensource-src-5.0.1\qtwebkit\Source\WebCore\platform\win" -I"F:\qt\qt-everywhere-opensource-src-5.0.1\qtwebkit\Source\WebCore\platform\graphics\win" -I"F:\qt\qt-everywhere-opensource-src-5.0.1\qtwebkit\Source\WebCore\loader\archive\mhtml" -I"F:\qt\qt-everywhere-opensource-src-5.0.1\qtwebkit\Source" -I"F:\qt\qt-x64-shared\qtwebkit\Source\include" -I"F:\qt\qt-x64-shared\qtbase\include" -I"F:\qt\qt-x64-shared\qtbase\include\QtScript" -I"F:\qt\qt-everywhere-opensource-src-5.0.1\qtwebkit\Source\JavaScriptCore" -I"F:\qt\qt-everywhere-opensource-src-5.0.1\qtwebkit\Source" -I"F:\qt\qt-everywhere-opensource-src-5.0.1\qtwebkit\Source\WTF" -I"F:\qt\qt-everywhere-opensource-src-5.0.1\qtwebkit\Source\JavaScriptCore\assembler" "..\JavaScriptCore\generated" -I"F:\qt\qt-everywhere-opensource-src-5.0.1\qtwebkit\Source\WTF" -I"F:\qt\qt-everywhere-opensource-src-5.0.1\qtwebkit\Source\JavaScriptCore\os-win32" -I"F:\qt\qt-x64-shared\qtbase\include\QtMultimedia" -I"F:\qt\qt-x64-shared\qtbase\include\QtSql" -I"F:\qt\qt-x64-shared\qtbase\include\QtNetwork" -I"F:\qt\qt-x64-shared\qtbase\include\QtGui" -I"F:\qt\qt-x64-shared\qtbase\include\QtGui\5.0.1" -I"F:\qt\qt-x64-shared\qtbase\include\QtGui\5.0.1\QtGui" -I"F:\qt\qt-x64-shared\qtbase\include\QtCore" -I"F:\qt\qt-x64-shared\qtbase\include\QtCore\5.0.1" -I"F:\qt\qt-x64-shared\qtbase\include\QtCore\5.0.1\QtCore" -I".moc\debug_shared" -I"." -I"F:\qt\qt-x64-shared\qtbase\mkspecs\win32-msvc2010" -Fo.obj\debug_shared\ @C:\Users\stathis\AppData\Local\Temp\nm134F.tmp
AccessibilityMenuList.cpp
Qt 4.8.4 builds without a problem, with the same MySQL version. It may be easier to just rename the qtwebkit decimal file rather than tweak the build system to avoid this?