9

Am folowing to tutorial skompilować Qt 4.8 z Visual Studio 2013, ale po uruchomieniu nUpewnij uzyskać:Qt 4.8, Visual Studio 2013 kompilacji błąd

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' 

dzięki za pomoc

Odpowiedz

17

Aby rozwiązać 'okrągłe' i błędy 'roundf' replace (linie 103 i 110):

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

z:

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

Aby rozwiązać 'signbit' błąd ująć ją następujące makro (linia 128):

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

Jeszcze lepiej, użyj oficjalny [poprawka] (https://qt.gitorious.org/qt/qtscript/commit/24d678ce9c3996f46d1069c2b1193e7ec1083fc8). – JPaget

+0

Przetestowałem obie poprawki od JPaget i Zdenik i nie działają one w Qt 4.8.6. To jedyna działająca odpowiedź. – Nil

+0

Na podstawie rozszerzonej biblioteki C99 w VS2013 - patrz artykuł [Obsługa biblioteki C99 w programie Visual Studio 2013] (https://blogs.msdn.microsoft.com/vcblog/2013/07/19/c99-library-support-in-visual -studio-2013 /) dołącza starą implementację z kodem: '#if _MSC_VER <1800 ... # endif' – N0dGrand87

2

Twoim problemem jest to, że użytkownik nie korzysta z programu Visual Studio 2012, ale 2013. VS 2012 jest VS11 podczas VS 2013 jest VS12 i ścieżka "C: \ Program Files (x86) \ Microsoft Visual Studio 12.0" należy do VS 2013.

Podstawowym problemem jest jednak to, że VS 2013 jest zgodny z C99, co powoduje problemy w silniku V8 i javascriptcore.

Obecnie nie ma rozwiązania, ale ręczne poprawki.

7

Użyj oficjalna patch dla VS 2013 kompatybilności.

+2

Pełna poprawka to [tutaj] (https://qt.gitorious.org/qt/qtdeclarative/commit/a3f01331263eddbc502fb88734568ac38df5e316) – Zdenik

2

Dwie opisane powyżej łaty nie wystarczą. W moim przypadku, po zastosowaniu ich do Qt 4.8.5 Mam inny błąd:

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 &)'                                         

Roztwór chwycić 3 pliki z repozytorium Git Qt4:

/src/3rdParty/WebKit/Źródło/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

dla jasności, ja ponownie połączyć proponowane poprawki w komentarzach pytanie: https://qt.gitorious.org/qt/qtscript/commit/24d678ce9c3996f46d1069c2b1193e7ec1083fc8 i https://qt.gitorious.org/qt/qtdeclarative/commit/a3f01331263eddbc502fb88734568ac38df5e316 –

+0

Skoro gludiańska strona z łatkami jest w trybie offline przez kilka dni (migracja), czy ktoś może przesłać mi poprawiony plik /src/3rdparty/**webkit**/Source/JavaScriptCore/wtf/HashSet.h, ponieważ ten błąd jest wciąż ** nie ** naprawione qt 4.8.6 (allthough /src/3rdparty/**javascriptcore**/JavaScriptCore/wtf/HashSet.h kompiluje). Thanksalot, Hermann –

0

@ Awaria AppDealer działa, jeśli musisz zastosować go do obu instancji pliku MathExtras.h. (Jeden w JavaScriptCore a drugi w Webkit Po że trafisz na problem HashSet kompilacji.

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

Obie te kwestie są poprawki z patch, które można znaleźć na this issue.

Powiązane problemy