Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Attempting to deal with QTBUG-41361



  • Here is a link to the bug I believe I am dealing with:

    I believe this because during the installation of qt-everywhere-opensource-src-4.8.6 I received a few errors during the make process. Specifically, near the end:

    In file included from ../3rdparty/javascriptcore/JavaScriptCore/wtf/FastAllocBase.h:84,
                     from ../3rdparty/javascriptcore/JavaScriptCore/wtf/Vector.h:24,
                     from ../3rdparty/javascriptcore/JavaScriptCore/pcre/pcre_exec.cpp:50:
    ../3rdparty/javascriptcore/JavaScriptCore/wtf/TypeTraits.h:173:69: error: ‘std::tr1’ has not been declared
         template<typename T> struct HasTrivialConstructor : public std::tr1::has_trivial_constructor<T> { };
                                                                         ^~~
    ../3rdparty/javascriptcore/JavaScriptCore/wtf/TypeTraits.h:173:74: error: expected ‘{’ before ‘has_trivial_constructor’
         template<typename T> struct HasTrivialConstructor : public std::tr1::has_trivial_constructor<T> { };
                                                                              ^~~~~~~~~~~~~~~~~~~~~~~
    ../3rdparty/javascriptcore/JavaScriptCore/wtf/TypeTraits.h:174:68: error: ‘std::tr1’ has not been declared
         template<typename T> struct HasTrivialDestructor : public std::tr1::has_trivial_destructor<T> { };
                                                                        ^~~
    ../3rdparty/javascriptcore/JavaScriptCore/wtf/TypeTraits.h:174:73: error: expected ‘{’ before ‘has_trivial_destructor’
         template<typename T> struct HasTrivialDestructor : public std::tr1::has_trivial_destructor<T> { };
                                                                             ^~~~~~~~~~~~~~~~~~~~~~
    
    

    Then at the very end of the make process I received:

    Makefile:1624: recipe for target 'obj/release/pcre_exec.o' failed
    make[1]: *** [obj/release/pcre_exec.o] Error 1
    make[1]: Leaving directory '/tmp/qt-everywhere-opensource-src-4.8.6/src/script'
    Makefile:525: recipe for target 'sub-script-make_default-ordered' failed
    make: *** [sub-script-make_default-ordered] Error 2
    

    I believe the reported bug was for DOS but I am working with Ubuntu 16.04 so I changed: mkspecs\win32-g++\qmake.conf too mkspecs\linux-g++-64\qmake.conf and implemented the proposed solution adding ```
    QMAKE_CXXFLAGS = $$QMAKE_CFLAGS -std=gnu++98

    
    So I am wondering if my best bet is to downgrade from gcc 8.x to 4.7 or is there a different way of going about getting around these errors?

  • Moderators

    Hi @RobM, std::tr1 is the "preview version" of C++11. After C++11 was released in 2011, compilers stopped supporting std::tr1 by default.

    Anyway, since you are building Qt yourself on a modern system with GCC 8, may I ask why you want to install Qt 4.8.6? Qt 4 reached end-of-life in December 2015, and is strongly discouraged for new projects. We are currently at Qt 5.11.1: https://www.qt.io/download



  • @JKSH Yes, I am working with one of our legacy builds. There are some open PR's that I would like to address. However, I have been running into complications with the build process. I do not believe that the GUI would work without considerable alteration to the code with the newest version of Qt. I was hoping to find a way to get everything working without having to temporarily downgrade my version of gcc to 4.7. At this point it seems that downgrading might be my only option.

    Should I attempt to run gcc4.7 side by side with 8.1? I am not sure if downgrading gcc is really an option. Online you find mixed reviews. Some people saying its a terrible idea others saying its a snap.



  • This post is deleted!

  • Lifetime Qt Champion

    What distribution are you running ?

    AFAIK, most of them still ships Qt 4 and likely Qt 4.8.7 which is the latest version available for the Qt 4 series.


  • Moderators

    @RobM said in Attempting to deal with QTBUG-41361:

    Should I attempt to run gcc4.7 side by side with 8.1?

    I haven't tried this before so I can't say, sorry.

    @SGaist said in Attempting to deal with QTBUG-41361:

    AFAIK, most of them still ships Qt 4 and likely Qt 4.8.7 which is the latest version available for the Qt 4 series.

    +1 this would be best, if available.

    Otherwise, how did you go with -std=gnu++98? If it works, you can use it.


Log in to reply