9

Am इस tutorial विजुअल स्टूडियो 2013 के साथ क्यूटी 4.8 संकलित करने के लिए folowing लेकिन मैं nmake चलाने के बाद मिलती है:क्यूटी 4.8, विजुअल स्टूडियो 2013 के संकलन त्रुटि

C:\Qt\4.8.5.src\src\3rdparty\javascriptcore\JavaScriptCore\wtf/MathExtras.h(103) : error C2491: 'round' : definition of dllimport function not allowed 
C:\Qt\4.8.5.src\src\3rdparty\javascriptcore\JavaScriptCore\wtf/MathExtras.h(110) : error C2491: 'roundf' : definition of dllimport function not allowed 
C:\Qt\4.8.5.src\src\3rdparty\javascriptcore\JavaScriptCore\wtf/MathExtras.h(128) : error C2084: function 'bool signbit(double)' already has a body 
     C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\math.h(324) : see previous definition of 'signbit' 
c:\qt\4.8.5.src\src\3rdparty\javascriptcore\javascriptcore\runtime\JSValue.h(615) : error C2264: 'signbit' : error in function definition or declaration; function not called 
c:\qt\4.8.5.src\src\3rdparty\javascriptcore\javascriptcore\runtime\JSValue.h(696) : error C2264: 'signbit' : error in function definition or declaration; function not called 
JSCallbackConstructor.cpp 
C:\Qt\4.8.5.src\src\3rdparty\javascriptcore\JavaScriptCore\wtf/MathExtras.h(103) : error C2491: 'round' : definition of dllimport function not allowed 
C:\Qt\4.8.5.src\src\3rdparty\javascriptcore\JavaScriptCore\wtf/MathExtras.h(110) : error C2491: 'roundf' : definition of dllimport function not allowed 
C:\Qt\4.8.5.src\src\3rdparty\javascriptcore\JavaScriptCore\wtf/MathExtras.h(128) : error C2084: function 'bool signbit(double)' already has a body 
     C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\math.h(324) : see previous definition of 'signbit' 
c:\qt\4.8.5.src\src\3rdparty\javascriptcore\javascriptcore\runtime\JSValue.h(615) : error C2264: 'signbit' : error in function definition or declaration; function not called 
c:\qt\4.8.5.src\src\3rdparty\javascriptcore\javascriptcore\runtime\JSValue.h(696) : error C2264: 'signbit' : error in function definition or declaration; function not called 
JSCallbackFunction.cpp 
C:\Qt\4.8.5.src\src\3rdparty\javascriptcore\JavaScriptCore\wtf/MathExtras.h(103) : error C2491: 'round' : definition of dllimport function not allowed 
C:\Qt\4.8.5.src\src\3rdparty\javascriptcore\JavaScriptCore\wtf/MathExtras.h(110) : error C2491: 'roundf' : definition of dllimport function not allowed 
C:\Qt\4.8.5.src\src\3rdparty\javascriptcore\JavaScriptCore\wtf/MathExtras.h(128) : error C2084: function 'bool signbit(double)' already has a body 
     C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\math.h(324) : see previous definition of 'signbit' 
c:\qt\4.8.5.src\src\3rdparty\javascriptcore\javascriptcore\runtime\JSValue.h(615) : error C2264: 'signbit' : error in function definition or declaration; function not called 
c:\qt\4.8.5.src\src\3rdparty\javascriptcore\javascriptcore\runtime\JSValue.h(696) : error C2264: 'signbit' : error in function definition or declaration; function not called 
JSCallbackObject.cpp 
C:\Qt\4.8.5.src\src\3rdparty\javascriptcore\JavaScriptCore\wtf/MathExtras.h(103) : error C2491: 'round' : definition of dllimport function not allowed 
C:\Qt\4.8.5.src\src\3rdparty\javascriptcore\JavaScriptCore\wtf/MathExtras.h(110) : error C2491: 'roundf' : definition of dllimport function not allowed 
C:\Qt\4.8.5.src\src\3rdparty\javascriptcore\JavaScriptCore\wtf/MathExtras.h(128) : error C2084: function 'bool signbit(double)' already has a body 
     C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\math.h(324) : see previous definition of 'signbit' 
c:\qt\4.8.5.src\src\3rdparty\javascriptcore\javascriptcore\runtime\JSValue.h(615) : error C2264: 'signbit' : error in function definition or declaration; function not called 
c:\qt\4.8.5.src\src\3rdparty\javascriptcore\javascriptcore\runtime\JSValue.h(696) : error C2264: 'signbit' : error in function definition or declaration; function not called 
JSClassRef.cpp 
C:\Qt\4.8.5.src\src\3rdparty\javascriptcore\JavaScriptCore\wtf/MathExtras.h(103) : error C2491: 'round' : definition of dllimport function not allowed 
C:\Qt\4.8.5.src\src\3rdparty\javascriptcore\JavaScriptCore\wtf/MathExtras.h(110) : error C2491: 'roundf' : definition of dllimport function not allowed 
C:\Qt\4.8.5.src\src\3rdparty\javascriptcore\JavaScriptCore\wtf/MathExtras.h(128) : error C2084: function 'bool signbit(double)' already has a body 
     C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\math.h(324) : see previous definition of 'signbit' 
c:\qt\4.8.5.src\src\3rdparty\javascriptcore\javascriptcore\runtime\JSValue.h(615) : error C2264: 'signbit' : error in function definition or declaration; function not called 
c:\qt\4.8.5.src\src\3rdparty\javascriptcore\javascriptcore\runtime\JSValue.h(696) : error C2264: 'signbit' : error in function definition or declaration; function not called 
JSContextRef.cpp 
C:\Qt\4.8.5.src\src\3rdparty\javascriptcore\JavaScriptCore\wtf/MathExtras.h(103) : error C2491: 'round' : definition of dllimport function not allowed 
C:\Qt\4.8.5.src\src\3rdparty\javascriptcore\JavaScriptCore\wtf/MathExtras.h(110) : error C2491: 'roundf' : definition of dllimport function not allowed 
C:\Qt\4.8.5.src\src\3rdparty\javascriptcore\JavaScriptCore\wtf/MathExtras.h(128) : error C2084: function 'bool signbit(double)' already has a body 
     C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\math.h(324) : see previous definition of 'signbit' 
c:\qt\4.8.5.src\src\3rdparty\javascriptcore\javascriptcore\runtime\JSValue.h(615) : error C2264: 'signbit' : error in function definition or declaration; function not called 
c:\qt\4.8.5.src\src\3rdparty\javascriptcore\javascriptcore\runtime\JSValue.h(696) : error C2264: 'signbit' : error in function definition or declaration; function not called 
JSObjectRef.cpp 
C:\Qt\4.8.5.src\src\3rdparty\javascriptcore\JavaScriptCore\wtf/MathExtras.h(103) : error C2491: 'round' : definition of dllimport function not allowed 
C:\Qt\4.8.5.src\src\3rdparty\javascriptcore\JavaScriptCore\wtf/MathExtras.h(110) : error C2491: 'roundf' : definition of dllimport function not allowed 
C:\Qt\4.8.5.src\src\3rdparty\javascriptcore\JavaScriptCore\wtf/MathExtras.h(128) : error C2084: function 'bool signbit(double)' already has a body 
     C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\math.h(324) : see previous definition of 'signbit' 
c:\qt\4.8.5.src\src\3rdparty\javascriptcore\javascriptcore\runtime\JSValue.h(615) : error C2264: 'signbit' : error in function definition or declaration; function not called 
c:\qt\4.8.5.src\src\3rdparty\javascriptcore\javascriptcore\runtime\JSValue.h(696) : error C2264: 'signbit' : error in function definition or declaration; function not called 
JSStringRef.cpp 
JSValueRef.cpp 
C:\Qt\4.8.5.src\src\3rdparty\javascriptcore\JavaScriptCore\wtf/MathExtras.h(103) : error C2491: 'round' : definition of dllimport function not allowed 
C:\Qt\4.8.5.src\src\3rdparty\javascriptcore\JavaScriptCore\wtf/MathExtras.h(110) : error C2491: 'roundf' : definition of dllimport function not allowed 
C:\Qt\4.8.5.src\src\3rdparty\javascriptcore\JavaScriptCore\wtf/MathExtras.h(128) : error C2084: function 'bool signbit(double)' already has a body 
     C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\math.h(324) : see previous definition of 'signbit' 
c:\qt\4.8.5.src\src\3rdparty\javascriptcore\javascriptcore\runtime\JSValue.h(615) : error C2264: 'signbit' : error in function definition or declaration; function not called 
c:\qt\4.8.5.src\src\3rdparty\javascriptcore\javascriptcore\runtime\JSValue.h(696) : error C2264: 'signbit' : error in function definition or declaration; function not called 
OpaqueJSString.cpp 
C:\Qt\4.8.5.src\src\3rdparty\javascriptcore\JavaScriptCore\wtf/MathExtras.h(103) : error C2491: 'round' : definition of dllimport function not allowed 
C:\Qt\4.8.5.src\src\3rdparty\javascriptcore\JavaScriptCore\wtf/MathExtras.h(110) : error C2491: 'roundf' : definition of dllimport function not allowed 
C:\Qt\4.8.5.src\src\3rdparty\javascriptcore\JavaScriptCore\wtf/MathExtras.h(128) : error C2084: function 'bool signbit(double)' already has a body 
     C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\math.h(324) : see previous definition of 'signbit' 
c:\qt\4.8.5.src\src\3rdparty\javascriptcore\javascriptcore\runtime\JSValue.h(615) : error C2264: 'signbit' : error in function definition or declaration; function not called 
c:\qt\4.8.5.src\src\3rdparty\javascriptcore\javascriptcore\runtime\JSValue.h(696) : error C2264: 'signbit' : error in function definition or declaration; function not called 
Generating Code... 
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\BIN\cl.EXE"' : return code '0x2' 
Stop. 
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\BIN\nmake.exe"' : return code '0x2' 
Stop. 
NMAKE : fatal error U1077: 'cd' : return code '0x2' 

किसी भी मदद

उत्तर

17

'दौर' और 'roundf' त्रुटियों की जगह (लाइनों 103 और 110) ठीक करने के लिए:

साथ
static double round(double num) 
static float roundf(float num) 

:

static inline double round(double num) 
static inline float roundf(float num) 

ठीक करने के लिए 'signbit' त्रुटि मैक्रो पालन करते हुए उसे लगा (लाइन 128):

#if _MSC_VER < 1800 
inline bool signbit(double num) { return _copysign(1.0, num) < 0; } 
#endif 
+4

अभी तक बेहतर, का उपयोग आधिकारिक [पैच] (https://qt.gitorious.org/qt/qtscript/commit/24d678ce9c3996f46d1069c2b1193e7ec1083fc8)। – JPaget

+0

मैंने जेपीगेट और ज़ेनडेक से दोनों पैच का परीक्षण किया और वे क्यूटी 4.8.6 में काम नहीं करते हैं। यह एकमात्र कामकाजी उत्तर है। – Nil

+0

वीएस2013 में विस्तारित सी 99 लाइब्रेरी के आधार पर - आलेख देखें [दृश्य स्टूडियो 2013 में सी 99 लाइब्रेरी समर्थन] (https://blogs.msdn.microsoft.com/vcblog/2013/07/19/c99-library-support-in-visual -स्टूडियो -2013 /) कोड के साथ पुराने कार्यान्वयन को संलग्न करता है: '#if _MSC_VER <1800 ... # endif' – N0dGrand87

2

आपके द्वारा चलाए गए के लिए धन्यवाद "vcvars32 संकलन से पहले .bat "? ऐसा लगता है कि वीसी ++ के पर्यावरण चर उचित रूप से सेट नहीं हैं।

वीसी ++ के पर्यावरण के बारे में जानकारी के लिए http://msdn.microsoft.com/en-us/library/f2ccy3wt.aspx देखें।

अलविदा

2

आपकी समस्या यह है कि आप Visual Studio 2012 लेकिन 2013 वी.एस. 2012 का उपयोग नहीं करते है, जबकि वी.एस. 2013 VS12 है और VS11 है अपने पथ "C: \ प्रोग्राम फ़ाइलें (x86) \ माइक्रोसॉफ्ट विजुअल स्टूडियो 12.0" वीएस 2013 से संबंधित है।

मूल समस्या हालांकि यह है कि वीएस 2013 सी 99 अनुपालन है जो वी 8 इंजन और जावास्क्रिप्ट में समस्याएं पैदा करता है।

वर्तमान में कोई समाधान नहीं है लेकिन मैन्युअल पैचिंग है।

7

वी.एस. 2013 संगतता के लिए आधिकारिक patch का प्रयोग करें।

+2

पूर्ण पैच [यहां] है (https://qt.gitorious.org/qt/qtdeclarative/commit/a3f01331263eddbc502fb88734568ac38df5e316) – Zdenik

2

ऊपर प्रस्तावित दो पैच पर्याप्त नहीं थे।

HashSet.h(180) : error C2664: 'std::pair<WTF::HashTableConstIteratorAdapter<WTF::HashTable<void *,void *,WTF::IdentityExtractor<void *>,WTF::PtrHash<JSC::EncodedJSValue>,WTF::HashTraits<JS 
C::EncodedJSValue>,WTF::HashTraits<JSC::EncodedJSValue>>,void *>,bool>::pair(const std::pair<WTF::HashTableConstIteratorAdapter<WTF::HashTable<void *,void *,WTF::IdentityExtractor<void *>,WTF::P 
trHash<JSC::EncodedJSValue>,WTF::HashTraits<JSC::EncodedJSValue>,WTF::HashTraits<JSC::EncodedJSValue>>,void *>,bool> &)' : cannot convert argument 1 from 'std::pair<WTF::HashTableIterator<Key,Va 
lue,Extractor,HashFunctions,Traits,KeyTraits>,bool>' to 'const std::pair<WTF::HashTableConstIteratorAdapter<WTF::HashTable<void *,void *,WTF::IdentityExtractor<void *>,WTF::PtrHash<JSC::EncodedJ 
SValue>,WTF::HashTraits<JSC::EncodedJSValue>,WTF::HashTraits<JSC::EncodedJSValue>>,void *>,bool> &'                        
     with                                              
     [                                               
      Key=void *                                            
,   Value=void *                                           
,   Extractor=WTF::IdentityExtractor<void *>                                    
,   HashFunctions=WTF::PtrHash<JSC::EncodedJSValue>                                  
,   Traits=WTF::HashTraits<JSC::EncodedJSValue>                                   
,   KeyTraits=WTF::HashTraits<JSC::EncodedJSValue>                                  
     ]                                               
     Reason: cannot convert from 'std::pair<WTF::HashTableIterator<Key,Value,Extractor,HashFunctions,Traits,KeyTraits>,bool>' to 'const std::pair<WTF::HashTableConstIteratorAdapter<WTF::HashT 
able<void *,void *,WTF::IdentityExtractor<void *>,WTF::PtrHash<JSC::EncodedJSValue>,WTF::HashTraits<JSC::EncodedJSValue>,WTF::HashTraits<JSC::EncodedJSValue>>,void *>,bool>'      
     with                                              
     [                                               
      Key=void *                                            
,   Value=void *                                           
,   Extractor=WTF::IdentityExtractor<void *>                                    
,   HashFunctions=WTF::PtrHash<JSC::EncodedJSValue>                                  
,   Traits=WTF::HashTraits<JSC::EncodedJSValue>                                   
,   KeyTraits=WTF::HashTraits<JSC::EncodedJSValue>                                  
     ]                                               
     No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called                   
     .\wtf/HashSet.h(179) : while compiling class template member function 'std::pair<WTF::HashTableConstIteratorAdapter<WTF::HashTable<void *,void *,WTF::IdentityExtractor<void *>,WTF::PtrHa 
sh<JSC::EncodedJSValue>,WTF::HashTraits<JSC::EncodedJSValue>,WTF::HashTraits<JSC::EncodedJSValue>>,void *>,bool> WTF::HashSet<void *,WTF::PtrHash<JSC::EncodedJSValue>,WTF::HashTraits<JSC::Encode 
dJSValue>>::add(void *const &)'                                         

समाधान Git क्यूटी 4 रिपोजिटरी से 3 फ़ाइल को पकड़ने की थी:: मेरे मामले में, उन्हें क्यूटी 4.8.5 के लिए आवेदन करने के बाद मैं एक त्रुटि मिली

/src/3rdparty/वेबकिट/स्रोत/JavaScriptCore/WTF/HashSet.h https://qt.gitorious.org/qt/mi-clone/raw/b45cc6bba9f85497eedf10cb5969d24273cb11db:src/3rdparty/webkit/Source/JavaScriptCore/wtf/HashSet.h

/src/3rdparty/webkit/Source/JavaScriptCore/wtf/MathExtras.h https://qt.gitorious.org/qt/mi-clone/raw/b45cc6bba9f85497eedf10cb5969d24273cb11db:src/3rdparty/webkit/Source/JavaScriptCore/wtf/MathExtras.h

/src/3rdparty/javascriptcore/JavaScriptCore/wtf/MathExtras.h https://qt.gitorious.org/qt/mi-clone/raw/b45cc6bba9f85497eedf10cb5969d24273cb11db:src/3rdparty/javascriptcore/JavaScriptCore/wtf/MathExtras.h

+0

स्पष्टता के लिए, मैं प्रश्न टिप्पणियों में प्रस्तावित पैच को रिंकंक करता हूं: https://qt.gitorious.org/qt/qtscript/commit/24d678ce9c3996f46d1069c2b1193e7ec1083fc8 और https://qt.gitorious.org/qt/qtdeclarative/commit/a3f01331263eddbc502fb88734568ac38df5e316 –

+0

चूंकि पैच के साथ गिटोरियस साइट दिनों के लिए ऑफलाइन है (माइग्रेटिंग सामान), क्या कोई मुझे कृपया /src/3rdparty/**webkit**/Source/JavaScriptCore/wtf/HashSet.h के लिए पैच की गई फ़ाइल भेज सकता है, क्योंकि यह बग है अभी भी ** ** में तय नहीं है क्यूटी 4.8.6 (हालांकि /src/3rdparty/**javascriptcore**/JavaScriptCore/wtf/HashSet.h संकलित)। धन्यवाद, हरमन –

0

@ AppDealer के awnser काम करता है, अगर आपको MathExtras.h फ़ाइल के दोनों उदाहरणों पर इसे लागू करना है। (JavaScriptCore में एक और Webkit में एक और है कि आप एक HashSet निर्माण समस्या में पड़ जाएगा।

No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called .\wtf/HashSet.h 

इन दोनों मुद्दों patchthis issue पर पाया जा सकता है के साथ फिक्स कर रहे हैं।

संबंधित मुद्दे