Building Qt 4.8.2 with Visual Studio 2012 RC
-
Hello,
A little up to this post.
I've followed http://rritw.com/a/JAVAbiancheng/ANT/20120630/178737.html post to compile Qt 4.8.2 for visual studio 2012.
At step 6, we have to deal with the error in wtf/hashset.h. I fixed it as alzi said. But I can't still compile qt. I have still this error :(@.\wtf/HashSet.h(180) : error C2664: 'std::pair<_Ty1,_Ty2>::pair(const std::pair<
_Ty1,_Ty2> &)' : impossible de convertir le paramètre 1 de 'std::pair<_Ty1,_Ty2>
' en 'const std::pair<_Ty1,_Ty2> &'
with
[
_Ty1=WTF::HashTableConstIteratorAdapter<WTF::HashTable<void *,void *
,WTF::IdentityExtractor<void *>,WTF::PtrHash<void *>,WTF::HashTraits<void *>,WTF
::HashTraits<void *>>,void *>,
_Ty2=bool
]
and
[
_Ty1=WTF::HashTableIterator<void *,void *,WTF::IdentityExtractor<voi
d *>,WTF::PtrHash<void *>,WTF::HashTraits<void *>,WTF::HashTraits<void *>>,
_Ty2=bool
]
and
[
_Ty1=WTF::HashTableConstIteratorAdapter<WTF::HashTable<void *,void *
,WTF::IdentityExtractor<void *>,WTF::PtrHash<void *>,WTF::HashTraits<void *>,WTF
::HashTraits<void *>>,void *>,
_Ty2=bool
]
Raison : impossible de convertir de 'std::pair<_Ty1,_Ty2>' en 'const std
::pair<_Ty1,_Ty2>'
with
[
_Ty1=WTF::HashTableIterator<void *,void *,WTF::IdentityExtractor<voi
d *>,WTF::PtrHash<void *>,WTF::HashTraits<void *>,WTF::HashTraits<void *>>,
_Ty2=bool
]
and
[
_Ty1=WTF::HashTableConstIteratorAdapter<WTF::HashTable<void *,void *
,WTF::IdentityExtractor<void *>,WTF::PtrHash<void *>,WTF::HashTraits<void *>,WTF
::HashTraits<void *>>,void *>,
_Ty2=bool
]
Aucun opérateur de conversion définie par l'utilisateur disponible qui p
uisse effectuer cette conversion, ou l'opérateur ne peut pas être appelé
.\wtf/HashSet.h(179) : lors de la compilation de la fonction membre 'std
::pair<_Ty1,_Ty2> WTF::HashSet<ValueArg>::add(void *const &)' de la classe modèl
e
with
[
_Ty1=WTF::HashTableConstIteratorAdapter<WTF::HashTable<void *,void *
,WTF::IdentityExtractor<void *>,WTF::PtrHash<void *>,WTF::HashTraits<void *>,WTF
::HashTraits<void *>>,void *>,
_Ty2=bool,
ValueArg=void *
]
heap\MarkStack.h(74) : voir la référence à l'instanciation de la fonctio
n modèle 'std::pair<_Ty1,_Ty2> WTF::HashSet<ValueArg>::add(void *const &)' en co
urs de compilation
with
[
_Ty1=WTF::HashTableConstIteratorAdapter<WTF::HashTable<void *,void *
,WTF::IdentityExtractor<void *>,WTF::PtrHash<void *>,WTF::HashTraits<void *>,WTF
::HashTraits<void *>>,void *>,
_Ty2=bool,
ValueArg=void *
]
heap\MarkStack.h(195) : voir la référence à l'instanciation de la classe
modèle 'WTF::HashSet<ValueArg>' en cours de compilation
with
[
ValueArg=void *
]
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 11.0
\VC\BIN\cl.EXE"' : code retour '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 11.0
\VC\BIN\nmake.exe"' : code retour '0x2'
Stop.
NMAKE : fatal error U1077: 'cd' : code retour '0x2'
Stop.
NMAKE : fatal error U1077: 'cd' : code retour '0x2'
Stop.@My hashset.h modification are :
@ template<typename T, typename U, typename V>
inline pair<typename HashSet<T, U, V>::iterator, bool> HashSet<T, U, V>::add(const ValueType& value)
{
typedef typename HashSet<T, U, V>::iterator iter_type;
auto& temp = m_impl.add(value);
return make_pair((iter_type)temp.first, temp.second);
}template<typename Value, typename HashFunctions, typename Traits> template<typename T, typename HashTranslator> inline pair<typename HashSet<Value, HashFunctions, Traits>::iterator, bool> HashSet<Value, HashFunctions, Traits>::add(const T& value) { typedef HashSetTranslatorAdapter<ValueType, ValueTraits, T, HashTranslator> Adapter; typedef typename HashSet<Value, HashFunctions, Traits>::iterator iter_type; auto& temp = m_impl.template addPassingHashCode<T, T, Adapter>(value, value); return make_pair((iter_type)temp.first, temp.second); }@
What am I doing wrong?
Can you help me please?Paolo
-
I posted it on PasteBin.
What you posted looked to me 100% like the same I have.
-
Thanks Floge,
Yeah :( I don't know why it doesn't want to compile with me. I'll try with your hashset.h.
-
Ok, so I've still got this stupid error.
I can't compile all the qt project with vs2012:/
I've configure the compiliation without the webtoolkit (I don't need it in fact) and it works nowThanks again Floge!
Paolo
-
patrick_g's patch also works with Qt 4.8.3, no idea why it isn't "in" yet tho
oh well, what to expect when there is still no official win32-msvc2012 target available, leave alone win32-msvc2012_xp
-
Qt 4.8.4 now has an official win32-msvc2012 target.
But this fix has yet to be patched in.
-
I had the same issue building Qt 4.8.4 on win32-msvc2012.
I would like to add to the discussion that there are actually two versions of the HashSet.h file:
The one that causes the problem is src/3rdparty/webkit/Source/JavaScriptCore/wtf/HashSet.h.The other version of the file is src/3rdparty/javascriptcore/JavaScriptCore/wtf/HashSet.h. Its add methods look like this:
@
template<typename T, typename U, typename V>
pair<typename HashSet<T, U, V>::iterator, bool> HashSet<T, U, V>::add(const ValueType& value)
{
pair<typename HashTable<T, T, IdentityExtractor<T>, U, V, V>::iterator, bool> p = m_impl.add(value);
typename HashSet<T, U, V>::iterator temp = p.first;
pair<typename HashSet<T, U, V>::iterator, bool> p2 = pair<typename HashSet<T, U, V>::iterator, bool>(temp, p.second);
// p2.first = p.first;
// p2.second = p.second;
return p2;
}template<typename Value, typename HashFunctions, typename Traits>
template<typename T, typename HashTranslator>
pair<typename HashSet<Value, HashFunctions, Traits>::iterator, bool>
HashSet<Value, HashFunctions, Traits>::add(const T& value)
{
typedef HashSetTranslatorAdapter<ValueType, ValueTraits, T, HashTranslator> Adapter;
pair<typename HashTableType::iterator, bool> p = m_impl.template addPassingHashCode<T, T, Adapter>(value, value);
return pair<iterator, bool>(p.first, p.second);
}
@They were obviously taken from two different versions of the WebKit project.
-
I followed http://stackoverflow.com/questions/12113400/compiling-qt-4-8-x-for-visual-studio-2012/14928303#14928303 to build Qt 4.8.4 specifically for VS2012, but got link error: qtmaind.lib(qtmain_win.obj) : error LNK2038: mismatch detected for ‘_MSC_VER’: value ‘1600’ doesn’t match value ‘1700’ in main.obj
I tried two options:
- use command
configure -mp -opensource -nomake demos -nomake examples -platform win32-msvc2012
and 2) Go to mkspecs\win32-msvc2010. Open qmake.conf and change:
QMAKE_COMPILER_DEFINES += _MSC_VER=1600 WIN32
to:
QMAKE_COMPILER_DEFINES += _MSC_VER=1700 WIN32
then use command configure -mp -opensource -nomake demos -nomake examples -platform win32-msvc2010
both gave me the same error.
I checked configure.cache under my qt folder, it is showing: -platform win32-msvc2012
Does anybody know what is wrong here? Thanks
- use command
-
[quote author="justDance" date="1361163855"]I followed http://stackoverflow.com/questions/12113400/compiling-qt-4-8-x-for-visual-studio-2012/14928303#14928303 to build Qt 4.8.4 specifically for VS2012, but got link error: qtmaind.lib(qtmain_win.obj) : error LNK2038: mismatch detected for ‘_MSC_VER’: value ‘1600’ doesn’t match value ‘1700’ in main.obj
I tried two options:
- use command
configure -mp -opensource -nomake demos -nomake examples -platform win32-msvc2012
and 2) Go to mkspecs\win32-msvc2010. Open qmake.conf and change:
QMAKE_COMPILER_DEFINES += _MSC_VER=1600 WIN32
to:
QMAKE_COMPILER_DEFINES += _MSC_VER=1700 WIN32
then use command configure -mp -opensource -nomake demos -nomake examples -platform win32-msvc2010
both gave me the same error.
I checked configure.cache under my qt folder, it is showing: -platform win32-msvc2012
Does anybody know what is wrong here? Thanks[/quote]
While figuring out the correct way to compile, you might have prematurely compiled some parts with the MSC 1600 settings (either a qtmain_win.cpp or a main.cpp).
Try the following:
nmake clean
nmake confcleanDecide whether you want to use the win32-msvc2012 or the modified win32-msvc2010 mkspec. Both should work, but you should pick only one.
Then check the mkspec file you want to use is set up correctly, run configure one time, then do an nmake.
Each time you want to change something with the configuration you should do an nmake clean & nmake confclean first, or to be absolutely safe, start each time from a fresh unpacked source zip.
- use command
-
This problem (the original HashSet.h one) is tracked in "QTBUG-28335":https://bugreports.qt-project.org/browse/QTBUG-28335