Problem installing Qt4 on Ubuntu

  • Hi all,

    I'm trying to install Qt4 on my Ubuntu 17.04 32-bit, but I'm stuck. When I try to compile it I get the following two errors several times:

    ~$ make -j8 && make install


    error: cannot bind bitfield ‘existingTransition->QTJSC::Structure::m_attributesInPrevious’ to ‘unsigned int&’
    add(StructureTransitionTableHash::Key(RefPtrUString::Rep(existingTransition->m_nameInPrevious.get()), existingTransition->m_attributesInPrevious), existingTransition, existingTransition->m_specificValueInPrevious);


    error: call of overloaded ‘swap(std::pair<std::pair<QTWTF::RefPtrQTJSC::UStringImpl, unsigned int>, std::pair<QTJSC::Structure*, QTJSC::Structure*> >&, std::pair<std::pair<QTWTF::RefPtrQTJSC::UStringImpl, unsigned int>, std::pair<QTJSC::Structure*, QTJSC::Structure*> >&)’ is ambiguous
    template<typename T> struct Mover<T, true> { static void move(T& from, T& to) { swap(from, to); } };

    and in the end I get this:

    Makefile:3610: recipe for target 'obj/release/JSObjectRef.o' failed
    make[1]: *** [obj/release/JSObjectRef.o] Error 1
    make[1]: Leaving directory '/home/lucio/qt/qt-everywhere-opensource-src-4.8.6/src/script'
    Makefile:565: recipe for target 'sub-script-make_default-ordered' failed
    make: *** [sub-script-make_default-ordered] Error 2

    I get practically the same errors with both Qt 4.8.6 and Qt 4.8.7 (I necessarily need Qt4 and not Qt5 since the first is the one recommended to work with Geant4, which is what I need).

    My compiler is:

    ~$ gcc -v

    Using built-in specs.
    Target: i686-linux-gnu
    Configured with: ../src/configure -v --with-pkgversion='Ubuntu 6.3.0-12ubuntu2' --with-bugurl=file:///usr/share/doc/gcc-6/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-6 --program-prefix=i686-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-6-i386/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-6-i386 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-6-i386 --with-arch-directory=i386 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --with-target-system-zlib --enable-objc-gc=auto --enable-targets=all --enable-multiarch --disable-werror --with-arch-32=i686 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=i686-linux-gnu --host=i686-linux-gnu --target=i686-linux-gnu
    Thread model: posix
    gcc version 6.3.0 20170406 (Ubuntu 6.3.0-12ubuntu2)

    Thanks in advance for any help!

  • Lifetime Qt Champion

    Hi and welcome to devnet,

    Before digging into that problem, why not use the development packages of the Qt 4 version provided by your distribution ?

  • Hi, and thanks for your reply;

    I was actually missing a couple of the packages found here, so I installed them. The same problem keeps appearing though.

    I'm sorry if I misunderstood what you said, I'm rather new to Linux and have very little experience :)

  • Lifetime Qt Champion

    What I was suggesting is to use your distribution provided Qt rather than build it yourself.

    Any particular reason to build Qt yourself ?

  • The reason is I'm following a guide given to me by the PhD student working with me, and I didn't consider other ways to do it; I don't know if there's any particular reason why he told me to build Qt4 myself, but I would like to diverge from the guide the least possible (installing Qt4 is just but a small part of what I have to do and it is preparatory to some of the subsequent steps).

    Anyway, may I ask you a real quick "how to" of the method you suggested? I'd really appreciated that.

  • Lifetime Qt Champion

    apt-get install libqt4-dev

    And it should already be the latest from the Qt 4 series. So unless your student had a need for a special configuration option, you should be good to go with your distribution's provided Qt.

  • Alright, so i found out that the guide I am following has been written some time ago for yum-based machines, that's why apt-get use wasn't mentioned.
    Now all works fine! Thank you very much!

  • Lifetime Qt Champion

    You're welcome !

    Since you have it working now, please mark the thread as solved using the "Topic Tools" button so that other forum users may know a solution has been found :)

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.