Qt 4.8, Visual Studio 2013 compiling error

后端 未结 6 1388
忘了有多久
忘了有多久 2021-02-06 02:43

Am folowing this tutorial to compile Qt 4.8 with visual Studio 2013 but after running nmake i get:

C:\\Qt\\4.8.5.src\\src\\3rdparty\\javascriptcore\\JavaScriptCo         


        
相关标签:
6条回答
  • 2021-02-06 03:18

    Your problem is that you do not use Visual Studio 2012 but 2013. VS 2012 is VS11 while VS 2013 is VS12 and your path "C:\Program Files (x86)\Microsoft Visual Studio 12.0" belongs to VS 2013.

    The core problem however is that VS 2013 is C99 compliant which causes problems in the V8 engine and javascriptcore.

    There is currently no solution but manual patching.

    0 讨论(0)
  • 2021-02-06 03:24

    @AppDealer's awnser works, if you have to apply it to both instances of the MathExtras.h file. (one in JavaScriptCore and another in Webkit After that you will run into a HashSet build problem.

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

    Both these issues are fixes with the patch that can be found on this issue.

    0 讨论(0)
  • 2021-02-06 03:34

    Have you run "vcvars32.bat" before compiling? It seems the environment variables of VC++ are not appropriately set.

    See http://msdn.microsoft.com/en-us/library/f2ccy3wt.aspx for informations about the environment of VC++.

    bye

    0 讨论(0)
  • 2021-02-06 03:34

    The two patches proposed above were not enough. In my case, after applying them to Qt 4.8.5 I got another error:

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

    Solution was to grab 3 files from Git Qt4 repository:

    /src/3rdparty/webkit/Source/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 讨论(0)
  • 2021-02-06 03:37

    Use the official patch for VS 2013 compatibility.

    0 讨论(0)
  • 2021-02-06 03:44

    To fix 'round' and 'roundf' errors replace (lines 103 and 110):

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

    with:

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

    To fix 'signbit' error enclose it with following macro (line 128):

    #if _MSC_VER < 1800
    inline bool signbit(double num) { return _copysign(1.0, num) < 0; }
    #endif
    
    0 讨论(0)
提交回复
热议问题