Repository navigation
Compile errors with MSVC 2017 #1592
Copy link
Copy link
Closed
Description
Trying to build master at the moment, using MSVC 2017.
One (so far) error is occurring. This is when compiling using MSVC from the command line:
> devenv /Build Release sqlitebrowser.sln /project "PACKAGE"
The error:
...
UniConversion.cpp
ViewStyle.cpp
XPM.cpp
mocs_compilation.cpp
c:\git_repos\sqlitebrowser\libs\qscintilla\qt4qt5\qsci\qsciscintillabase.h(70): error C2059: syntax error: 'constant'
c:\git_repos\sqlitebrowser\libs\qscintilla\qt4qt5\qsci\qsciscintillabase.h(2325): error C2143: syntax error: missing ';' before '}'
c:\git_repos\sqlitebrowser\libs\qscintilla\qt4qt5\qsci\qsciscintillabase.h(2325): error C2238: unexpected token(s) preceding ';'
c:\git_repos\sqlitebrowser\libs\qscintilla\qt4qt5\qsci\qsciscintillabase.h(2329): error C2059: syntax error: 'constant'
c:\git_repos\sqlitebrowser\libs\qscintilla\qt4qt5\qsci\qsciscintillabase.h(2334): error C2143: syntax error: missing ';' before '}'
c:\git_repos\sqlitebrowser\libs\qscintilla\qt4qt5\qsci\qsciscintillabase.h(2334): error C2059: syntax error: '}'
c:\git_repos\sqlitebrowser\libs\qscintilla\qt4qt5\qsci\qsciscintillabase.h(2338): error C2059: syntax error: 'constant'
c:\git_repos\sqlitebrowser\libs\qscintilla\qt4qt5\qsci\qsciscintillabase.h(2341): error C2143: syntax error: missing ';' before '}'
c:\git_repos\sqlitebrowser\libs\qscintilla\qt4qt5\qsci\qsciscintillabase.h(2341): error C2059: syntax error: '}'
c:\git_repos\sqlitebrowser\libs\qscintilla\qt4qt5\qsci\qsciscintillabase.h(2345): error C2059: syntax error: 'constant'
c:\git_repos\sqlitebrowser\libs\qscintilla\qt4qt5\qsci\qsciscintillabase.h(2348): error C2143: syntax error: missing ';' before '}'
c:\git_repos\sqlitebrowser\libs\qscintilla\qt4qt5\qsci\qsciscintillabase.h(2348): error C2059: syntax error: '}'
c:\git_repos\sqlitebrowser\libs\qscintilla\qt4qt5\qsci\qsciscintillabase.h(2352): error C2059: syntax error: 'constant'
c:\git_repos\sqlitebrowser\libs\qscintilla\qt4qt5\qsci\qsciscintillabase.h(2357): error C2143: syntax error: missing ';' before '}'
c:\git_repos\sqlitebrowser\libs\qscintilla\qt4qt5\qsci\qsciscintillabase.h(2357): error C2059: syntax error: '}'
c:\git_repos\sqlitebrowser\libs\qscintilla\qt4qt5\qsci\qsciscintillabase.h(2361): error C2059: syntax error: 'constant'
c:\git_repos\sqlitebrowser\libs\qscintilla\qt4qt5\qsci\qsciscintillabase.h(2365): error C2143: syntax error: missing ';' before '}'
c:\git_repos\sqlitebrowser\libs\qscintilla\qt4qt5\qsci\qsciscintillabase.h(2365): error C2059: syntax error: '}'
c:\git_repos\sqlitebrowser\libs\qscintilla\qt4qt5\qsci\qsciscintillabase.h(2369): error C2059: syntax error: 'constant'
c:\git_repos\sqlitebrowser\libs\qscintilla\qt4qt5\qsci\qsciscintillabase.h(2371): error C2143: syntax error: missing ';' before '}'
c:\git_repos\sqlitebrowser\libs\qscintilla\qt4qt5\qsci\qsciscintillabase.h(2371): error C2059: syntax error: '}'
c:\git_repos\sqlitebrowser\libs\qscintilla\qt4qt5\qsci\qsciscintillabase.h(2375): error C2059: syntax error: 'constant'
c:\git_repos\sqlitebrowser\libs\qscintilla\qt4qt5\qsci\qsciscintillabase.h(2377): error C2143: syntax error: missing ';' before '}'
c:\git_repos\sqlitebrowser\libs\qscintilla\qt4qt5\qsci\qsciscintillabase.h(2377): error C2059: syntax error: '}'
c:\git_repos\sqlitebrowser\libs\qscintilla\qt4qt5\qsci\qsciscintillabase.h(2381): error C2059: syntax error: 'constant'
c:\git_repos\sqlitebrowser\libs\qscintilla\qt4qt5\qsci\qsciscintillabase.h(2383): error C2143: syntax error: missing ';' before '}'
c:\git_repos\sqlitebrowser\libs\qscintilla\qt4qt5\qsci\qsciscintillabase.h(2383): error C2059: syntax error: '}'
...
This note is also displayed, which seems like it might be important:
...
sqlitetablemodel.cpp(967): warning C4267: '+=': conversion from 'size_t' to 'int', possible loss of data
C:\dev\Qt\5.11.2\msvc2017_64\include\QtCore/qobjectdefs_impl.h(297): warning C4267: 'argument': conversion from 'size_t' to 'const unsigned int', possible loss of data
C:\dev\Qt\5.11.2\msvc2017_64\include\QtCore/qobjectdefs_impl.h(316): note: see reference to class template instantiation 'QtPrivate::AreArgumentsCompatible<unsigned __int64,unsigned int>' being compiled
C:\dev\Qt\5.11.2\msvc2017_64\include\QtCore/qobjectdefs_impl.h(317): note: see reference to class template instantiation 'QtPrivate::CheckCompatibleArguments<QtPrivate::List<size_t,size_t>,QtPrivate::List<unsigned int,unsigned int>>' being compiled
C:\dev\Qt\5.11.2\msvc2017_64\include\QtCore/qobject.h(241): note: see reference to class template instantiation 'QtPrivate::CheckCompatibleArguments<QtPrivate::List<int,size_t,size_t>,QtPrivate::List<int,unsigned int,unsigned int>>' being compiled
sqlitetablemodel.cpp(35): note: see reference to function template instantiation 'QMetaObject::Connection QObject::connect<void(__cdecl RowLoader::* )(int,size_t,size_t),void(__cdecl SqliteTableModel::* )(int,unsigned int,unsigned int)>(const RowLoader *,Func1,const SqliteTableModel *,Func2,Qt::ConnectionType)' being compiled
with
[
Func1=void (__cdecl RowLoader::* )(int,size_t,size_t),
Func2=void (__cdecl SqliteTableModel::* )(int,unsigned int,unsigned int)
]
C:\dev\Qt\5.11.2\msvc2017_64\include\QtCore/qobjectdefs_impl.h(134): warning C4267: 'argument': conversion from 'size_t' to 'unsigned int', possible loss of data
C:\dev\Qt\5.11.2\msvc2017_64\include\QtCore/qobjectdefs_impl.h(133): note: while compiling class template member function 'void QtPrivate::FunctorCall<QtPrivate::IndexesList<0,1,2>,SignalArgs,R,void (__cdecl SqliteTableModel::* )(int,unsigned int,unsigned int)>::call(SlotRet (__cdecl SqliteTableModel::* )(int,unsigned int,unsigned int),Obj *,void **)'
with
[
SignalArgs=QtPrivate::List<int,size_t,size_t>,
R=void,
SlotRet=void,
Obj=SqliteTableModel
]
C:\dev\Qt\5.11.2\msvc2017_64\include\QtCore/qobjectdefs_impl.h(167): note: see reference to function template instantiation 'void QtPrivate::FunctorCall<QtPrivate::IndexesList<0,1,2>,SignalArgs,R,void (__cdecl SqliteTableModel::* )(int,unsigned int,unsigned int)>::call(SlotRet (__cdecl SqliteTableModel::* )(int,unsigned int,unsigned int),Obj *,void **)' being compiled
with
[
SignalArgs=QtPrivate::List<int,size_t,size_t>,
R=void,
SlotRet=void,
Obj=SqliteTableModel
]
C:\dev\Qt\5.11.2\msvc2017_64\include\QtCore/qobjectdefs_impl.h(167): note: see reference to class template instantiation 'QtPrivate::FunctorCall<QtPrivate::IndexesList<0,1,2>,SignalArgs,R,void (__cdecl SqliteTableModel::* )(int,unsigned int,unsigned int)>' being compiled
with
[
SignalArgs=QtPrivate::List<int,size_t,size_t>,
R=void
]
C:\dev\Qt\5.11.2\msvc2017_64\include\QtCore/qobjectdefs_impl.h(396): note: see reference to function template instantiation 'void QtPrivate::FunctionPointer<void (__cdecl SqliteTableModel::* )(int,unsigned int,unsigned int)>::call<Args,R>(void (__cdecl SqliteTableModel::* )(int,unsigned int,unsigned int),Obj *,void **)' being compiled
with
[
Args=QtPrivate::List<int,size_t,size_t>,
R=void,
Obj=SqliteTableModel
]
C:\dev\Qt\5.11.2\msvc2017_64\include\QtCore/qobjectdefs_impl.h(396): note: see reference to function template instantiation 'void QtPrivate::FunctionPointer<void (__cdecl SqliteTableModel::* )(int,unsigned int,unsigned int)>::call<Args,R>(void (__cdecl SqliteTableModel::* )(int,unsigned int,unsigned int),Obj *,void **)' being compiled
with
[
Args=QtPrivate::List<int,size_t,size_t>,
R=void,
Obj=SqliteTableModel
]
C:\dev\Qt\5.11.2\msvc2017_64\include\QtCore/qobjectdefs_impl.h(390): note: while compiling class template member function 'void QtPrivate::QSlotObject<Func2,QtPrivate::List<int,size_t,size_t>,void>::impl(int,QtPrivate::QSlotObjectBase *,QObject *,void **,bool *)'
with
[
Func2=void (__cdecl SqliteTableModel::* )(int,unsigned int,unsigned int)
]
C:\dev\Qt\5.11.2\msvc2017_64\include\QtCore/qobjectdefs_impl.h(405): note: see reference to function template instantiation 'void QtPrivate::QSlotObject<Func2,QtPrivate::List<int,size_t,size_t>,void>::impl(int,QtPrivate::QSlotObjectBase *,QObject *,void **,bool *)' being compiled
with
[
Func2=void (__cdecl SqliteTableModel::* )(int,unsigned int,unsigned int)
]
C:\dev\Qt\5.11.2\msvc2017_64\include\QtCore/qobject.h(253): note: see reference to class template instantiation 'QtPrivate::QSlotObject<Func2,QtPrivate::List<int,size_t,size_t>,void>' being compiled
with
[
Func2=void (__cdecl SqliteTableModel::* )(int,unsigned int,unsigned int)
]
sqlitetablemodel.cpp(35): note: see reference to function template instantiation 'QMetaObject::Connection QObject::connect<void(__cdecl RowLoader::* )(int,size_t,size_t),void(__cdecl SqliteTableModel::* )(int,unsigned int,unsigned int)>(const RowLoader *,Func1,const SqliteTableModel *,Func2,Qt::ConnectionType)' being compiled
with
[
Func1=void (__cdecl RowLoader::* )(int,size_t,size_t),
Func2=void (__cdecl SqliteTableModel::* )(int,unsigned int,unsigned int)
]
RowLoader.cpp
...
Anyone have ideas? 😄
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Activity
justinclift commentedon Oct 27, 2018
Ping @MKleusberg @mgrojo @karim, as this might be your kind of thing. 😄
FriedrichFroebel commentedon Oct 27, 2018
For the error it seems like this is the same as #1459.
justinclift commentedon Oct 27, 2018
Well spotted. I have CMake 3.11.4 installed. Will drop back to an earlier version and try again. Thanks @FriedrichFroebel. 😄
justinclift commentedon Oct 27, 2018
Yep. CMake 3.10.3 worked for the compiling.
Hitting problems with linking at the end:
Not sure what the problem really is. Obviously something to do with the SQLCipher part of things, but unsure why yet. Hopefully it's just something simple like needing extra library paths due to using OpenSSL 1.1 instead of the older OpenSSL 1.0.
Need to get sleep now, but I'll pick with up in the morning. If someone wants to have a go meanwhile (please do!), these are the bits I'm working with:
Newer dependencies
Source
nmake /f Makefile.msccmake -G "Visual Studio 15 2017 Win64" -Wno-dev -Dsqlcipher=1devenv /Build Release sqlitebrowser.sln /project "PACKAGE"MKleusberg commentedon Oct 27, 2018
It looks like it doesn't find the SQLCipher library. Because none of the mentioned functions refers to anything from OpenSSL I guess that wasn't the problem. If you haven't changed it, the cmake file seems to be looking for it in C:\git_repos\SQLCipher-Win64. Also the order of the libraries passed to the linker might matter. But hard to guess 😄
justinclift commentedon Oct 27, 2018
Yeah, that was one of the things I was thinking too. When compiling earlier in the day I was using a different path, but changed it to match
c:\git_repos\SQLCipher-Win64shortly after hitting problems. Just to minimise differences.Hmmm, I might try dropping the compiled sqlcipher pieces into a few different directories, and see if it suddenly starts finding them.
Should probably also grab the various Win debugging tools people have pointed out over time, such as WinDbg and similar.
MKleusberg commentedon Oct 30, 2018
Is there something like a build log? Qt Creator for example has one in the 'Compile Output' panel. Could be interesting to see what call to the linker cmake is generating for us.
justinclift commentedon Oct 31, 2018
Good thinking. I should have time to investigate it tomorrow or maybe the weekend (moving house again atm, so time limited). 😉
karim commentedon Nov 12, 2018
@justinclift I managed to build SQLCipher with MSVC 2017.
I followed your instructions here https://github.com/sqlitebrowser/sqlitebrowser/wiki/Win64-setup-%E2%80%94-Compiling-SQLCipher and it is very helpful.
I also found an easier way to do it. Instead of manually editing Makefile.msc we can send all these options in the commandline.
nmake /f Makefile.msc sqlcipher.dll USE_AMALGAMATION=1 NO_TCL=1 SQLITE3DLL=sqlcipher.dll SQLITE3LIB=sqlcipher.lib SQLITE3EXE=sqlcipher.exe LTLINKOPTS="C:\dev\OpenSSL-Win64\lib\libeay32.lib" OPT_FEATURE_FLAGS="-DSQLITE_TEMP_STORE=2 -DSQLITE_HAS_CODEC=1 -DSQLCIPHER_CRYPTO_OPENSSL=1 -IC:\dev\OpenSSL-Win64\include"Run this command without editing Makefile.msc and it will create sqlcipher.lib that you can link with DB4S. Then
cmake -G "Visual Studio 15 2017 Win64" -Wno-dev -Dsqlcipher=1after it and you shouldn't have any problems.justinclift commentedon Nov 12, 2018
That's fantastic @karim, thank you heaps. 😄
Which version of OpenSSL is that with?
We've been using OpenSSL 1.0.x for the released builds so far, but (ideally) we should be able to get OpenSSL 1.1.x working for this and future builds. In my above - failing - attempt with MSVC 2017 I tried OpenSSL 1.1.0i. I wonder if using a newer version contributed to the failure?
karim commentedon Nov 12, 2018
Yes, I'm also using OpenSSL 1.0.x (1.0.2p) because 1.1x didn't work for me. From this thread https://forum.qt.io/topic/71244/using-qsslsocket-with-custom-openssl
OpenSSL 1.0.x and 1.1.x are not compatible I think. The DLL names have changed and Qt can't find them. To make OpenSSL 1.1.x and above work we have to compile Qt from source. 😃
chrisjlocke commentedon Nov 12, 2018
I assume its not as simple as renaming the DLLs, so we're using 1.1.x but renamed to the 1.0.x names for Qt to find?
karim commentedon Nov 12, 2018
I think renaming doesn't work because there are some changes that made both version incompatible, hence the new names.
OpenSSL 1.0.2 is still supported for one more year. It is getting security updates and bug fixes, but no new features. We can continue using it till a newer version of Qt is built with OpenSSL 1.1.x.
justinclift commentedon Nov 23, 2018
Got all the bits downloaded to a local testing VM, including MSVC in local cache mode so it doesn't need to be downloaded again.
This time, using your SQLCipher compile line @karim it worked! Yay!
Next I'll muck around with the SQLCipher pieces a bit more, so the changes are in the Makefile.msc, then get MSVC 2017 onto our build server and try for a 3.11.0 beta1 release. 😄
karim commentedon Nov 23, 2018
Why? I think you can just use a the commandline to override the default settings in the Makefile.msc. This way you don't need your fork of SQLCipher and you can use the original repo as-is.
I see in your fork that you added other options (like
-DSQLITE_ENABLE_JSON1=1) and I guess you can just add them toOPT_FEATURE_FLAGSin the commandline.Something like...
nmake /f Makefile.msc sqlcipher.dll USE_AMALGAMATION=1 NO_TCL=1 SQLITE3DLL=sqlcipher.dll SQLITE3LIB=sqlcipher.lib SQLITE3EXE=sqlcipher.exe LTLINKOPTS="C:\dev\OpenSSL-Win64\lib\libeay32.lib" OPT_FEATURE_FLAGS="-DSQLITE_TEMP_STORE=2 -DSQLITE_HAS_CODEC=1 -DSQLITE_ENABLE_FTS5=1 -DSQLITE_ENABLE_FTS3_PARENTHESIS=1 -DSQLITE_ENABLE_JSON1=1 -DSQLCIPHER_CRYPTO_OPENSSL=1 -IC:\dev\OpenSSL-Win64\include"38 remaining items
justinclift commentedon Nov 26, 2018
Just pushed an untested commit (655dd49) that might correctly exclude those files for the Win32 builds. Now running the Win32 build process again to find out. 😉
justinclift commentedon Nov 26, 2018
Watching the batch file output as it's building, that error seems to be fixed. The Win32 binaries should be online in ~20 mins or so. 😄
justinclift commentedon Nov 26, 2018
Updated Win32 & Win64 builds are online now. I haven't started the OSX builds yet, but will do so sometime later today.
justinclift commentedon Nov 26, 2018
Just realised we should be able to cherry-pick the commits from this Issue across to the
v3.11.xbranch, which should then be ready for the beta1 release. 😄Ahhh. Assuming the OSX builds already contain the translation files, which they might not. I'll check that in a bit, after the nightly build server completes it's OSX builds (in progress presently).
Also, still need to check the Accessibility plugin situation for both OSX and Windows.
justinclift commentedon Nov 26, 2018
New OSX nightlies are online now too.
justinclift commentedon Nov 26, 2018
Looking through the plugins in the Qt 5.11.2 directory for MSVC 2017, I'm not seeing anything obvious for Accessibility. Not sure what to copy, so sounds like further research is needed.
There is a
plugins/printsupport/windowsprintersupport.dllplugin though. Anyone know if that might be needed for @mgrojo's printing stuff added a while back?justinclift commentedon Nov 26, 2018
In the Qt 5.11.2 directory, there seems to be some Accessibility related files:
Qt5AccessibilitySupport.libQt5AccessibilitySupport.prlAlong with the corresponding debugging versions:
Qt5AccessibilitySupportd.libQt5AccessibilitySupportd.prlKind of thinking the Accessibility bits might be bundled into Qt directly, and not need further plugin files added to our final binaries. But not sure.
@francipvb Any idea? We have building with Qt 5.11.2 now working for Windows, but I'm not sure if some kind of extra plugins need to be bundled along with the installer. 😄
justinclift commentedon Nov 26, 2018
Ignore that. It turns out we're already bundling it. 😄
justinclift commentedon Nov 26, 2018
Looking in our OSX installer now:
Contents/MacOS/translations/. No sign of the standard Qt translation files though, so it looks like we'll need to include them on OSX next too.Guess that's the next task for today. I'll make a new issue for tracking that, and close this as the MSVC 2017 compile error problem is definitely solved thanks to @karim. 😄
francipvb commentedon Nov 26, 2018
Update the location of MSVC 2017 merge modules
Fix "The network is not accessible" error
Remove the bearer plugin from the 32-bit build
Add the missing *.qm translations files