Compilation error in qVector.h with Qt4.8.3
-
Hello All,
Recently, I tried the following:
- Build Qt4.8.3 with Visual Studio 2012
- Rebuild old project of (Visual Studio 2005 + Qt 4.3.3) with Visual Studio 2012 and Qt4.8.3
Now, I am getting multiple compilation error in qVector.h. The errors are quoted as below:
@c:\qt\4.8.3\include\qtcore../../src/corelib/tools/qvector.h(157): error C2182: 'at' : illegal use of type 'void'
1>c:\qt\4.8.3\include\qtcore../../src/corelib/tools/qvector.h(158): error C2182: '[]' : illegal use of type 'void'
1>c:\qt\4.8.3\include\qtcore../../src/corelib/tools/qvector.h(159): error C2182: '[]' : illegal use of type 'void'
1>c:\qt\4.8.3\include\qtcore../../src/corelib/tools/qvector.h(160): error C2182: 't' : illegal use of type 'void'
1>c:\qt\4.8.3\include\qtcore../../src/corelib/tools/qvector.h(161): error C2182: 't' : illegal use of type 'void'
1>c:\qt\4.8.3\include\qtcore../../src/corelib/tools/qvector.h(162): error C2182: 't' : illegal use of type 'void'
1>c:\qt\4.8.3\include\qtcore../../src/corelib/tools/qvector.h(163): error C2182: 't' : illegal use of type 'void'
1>c:\qt\4.8.3\include\qtcore../../src/corelib/tools/qvector.h(164): error C2182: 't' : illegal use of type 'void'
1>c:\qt\4.8.3\include\qtcore../../src/corelib/tools/qvector.h(168): error C2182: 't' : illegal use of type 'void'
1>c:\qt\4.8.3\include\qtcore../../src/corelib/tools/qvector.h(170): error C2182: 't' : illegal use of type 'void'
1>c:\qt\4.8.3\include\qtcore../../src/corelib/tools/qvector.h(171): error C2182: 't' : illegal use of type 'void'
1>c:\qt\4.8.3\include\qtcore../../src/corelib/tools/qvector.h(172): error C2182: 't' : illegal use of type 'void'
1>c:\qt\4.8.3\include\qtcore../../src/corelib/tools/qvector.h(173): error C2182: 't' : illegal use of type 'void'
1>c:\qt\4.8.3\include\qtcore../../src/corelib/tools/qvector.h(253): error C2182: 'x' : illegal use of type 'void'
1>c:\qt\4.8.3\include\qtcore../../src/corelib/tools/qvector.h(254): error C2182: 'x' : illegal use of type 'void'
1>c:\qt\4.8.3\include\qtcore../../src/corelib/tools/qvector.h(260): error C2182: 'first' : illegal use of type 'void'
1>c:\qt\4.8.3\include\qtcore../../src/corelib/tools/qvector.h(261): error C2182: 'first' : illegal use of type 'void'
1>c:\qt\4.8.3\include\qtcore../../src/corelib/tools/qvector.h(262): error C2182: 'last' : illegal use of type 'void'
1>c:\qt\4.8.3\include\qtcore../../src/corelib/tools/qvector.h(263): error C2182: 'last' : illegal use of type 'void'
1>c:\qt\4.8.3\include\qtcore../../src/corelib/tools/qvector.h(264): error C2182: 't' : illegal use of type 'void'
1>c:\qt\4.8.3\include\qtcore../../src/corelib/tools/qvector.h(265): error C2182: 't' : illegal use of type 'void'
1>c:\qt\4.8.3\include\qtcore../../src/corelib/tools/qvector.h(269): error C2182: 'defaultValue' : illegal use of type 'void'
1>c:\qt\4.8.3\include\qtcore../../src/corelib/tools/qvector.h(275): error C2182: 'reference' : illegal use of type 'void'
1>c:\qt\4.8.3\include\qtcore../../src/corelib/tools/qvector.h(276): error C2182: 'const_reference' : illegal use of type 'void'
1>c:\qt\4.8.3\include\qtcore../../src/corelib/tools/qvector.h(281): error C2182: 't' : illegal use of type 'void'
1>c:\qt\4.8.3\include\qtcore../../src/corelib/tools/qvector.h(282): error C2182: 't' : illegal use of type 'void'
1>c:\qt\4.8.3\include\qtcore../../src/corelib/tools/qvector.h(287): error C2182: 'front' : illegal use of type 'void'
1>c:\qt\4.8.3\include\qtcore../../src/corelib/tools/qvector.h(296): error C2182: 't' : illegal use of type 'void'
1>c:\qt\4.8.3\include\qtcore../../src/corelib/tools/qvector.h(298): error C2182: 't' : illegal use of type 'void'@To solve this, i tried to start a new blank project, and later on come to know that error is coming due to inclusion of "QtSql" module in my project. I am really stuck with this, Please guide.
Thanks & Regards,
Durgesh -
Hello All,
Changing from including complete module name to including only the required class names has removed this error.
For example, earlier I was doing @#include<QtSql>@and now I have changed this to @#include<QSqlDatabase>@
The same is applicable to QtXml Module.
Anyhow, Now I am unable to connect to database. What can be the possible reasons for this? More information, I am using MS Access as my database.
Thanks & Regards,
Durgesh