Important: Please read the Qt Code of Conduct -

Problem with installing qt-4.6.2 on ubuntu 14.04

  • Hi guys
    I wanted to install qt-everywhere-opensource-src-4.6.2 on Ubuntu 14.04. I went through its help. After extracting I ran "./configure" command in terminal then I ran "make" command and after 1 hour it showed some errors. Here are last lines of the report :

    ../3rdparty/javascriptcore/JavaScriptCore/wtf/RefPtr.h: In instantiation of ‘QTWTF::RefPtr<T>::~RefPtr() [with T = QTJSC::Label]’:
    ../3rdparty/javascriptcore/JavaScriptCore/bytecompiler/LabelScope.h:49:46: required from here
    ../3rdparty/javascriptcore/JavaScriptCore/wtf/RefPtr.h:51:55: error: ‘derefIfNotNull’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
    ~RefPtr() { T* ptr = m_ptr; derefIfNotNull(ptr); }
    In file included from ../3rdparty/javascriptcore/JavaScriptCore/jit/ExecutableAllocator.h:31:0,
    from ../3rdparty/javascriptcore/JavaScriptCore/runtime/JSGlobalData.h:33,
    from ../3rdparty/javascriptcore/JavaScriptCore/interpreter/CallFrame.h:26,
    from ../3rdparty/javascriptcore/JavaScriptCore/runtime/ClassInfo.h:26,
    from ../3rdparty/javascriptcore/JavaScriptCore/runtime/JSObject.h:27,
    from ../3rdparty/javascriptcore/JavaScriptCore/runtime/InternalFunction.h:27,
    from ../3rdparty/javascriptcore/JavaScriptCore/runtime/JSFunction.h:27,
    from ../3rdparty/javascriptcore/JavaScriptCore/runtime/Executable.h:29,
    from ../3rdparty/javascriptcore/JavaScriptCore/bytecode/EvalCodeCache.h:32,
    from ../3rdparty/javascriptcore/JavaScriptCore/bytecode/CodeBlock.h:33,
    from ../3rdparty/javascriptcore/JavaScriptCore/bytecode/CodeBlock.cpp:31:
    ../3rdparty/javascriptcore/JavaScriptCore/wtf/PassRefPtr.h:39:10: note: ‘template<class T> void QTWTF::derefIfNotNull(T*)’ declared here, later in the translation unit
    void derefIfNotNull(T* ptr)
    make[1]: *** [obj/release/CodeBlock.o] Error 1
    make[1]: Leaving directory `/usr/local/qt-everywhere-opensource-src-4.6.2/src/script'
    make: *** [sub-script-make_default-ordered] Error 2

    I couldn't figure it out and I'm not a pro in Linux and Ubuntu area.
    Could you help me with this? I have to use this version since I want to use it on FriendlyARM mini 2440. I wish there was a way I could get this version of qt through repositories since compiling Qt takes a lot of time (can say an hour!)

  • Type ./configure -help to get a list of all available options.

    Maybe you need to avoid dependencies using some argument when you run ./configure.

    You should also check the requirements:

  • Thank you very much
    It has a lot of switch when you run ./configure -help and I kind of have no idea which one needs changing!
    Plus I checked requirements in that link and my system currently has all of them installed.
    I ran make command and got those exact errors again.
    I don't know what to do ...

  • Hi
    I managed to run "configure" and "make" and "make install" commands successfully. You were right. All I did was using some arguments in ./configure command. I ran this command :
    ./configure -nomake doc -nomake examples -nomake demos -fast -no-javascript-jit -no-script -no-scripttools
    I dont know which argument was making problems and I'm not sure if I used the right arguments or not but all that matters to me is that I didn't get any errors !
    By default after running make install command all files go to /usr/local/Trolltech/Qt-4.6.2/
    Now the problem is that I don't know how to use generated files. In bin folder I have following files :
    Which one is Qt ?!
    Am I missing something ?

  • Yes, the installation goes there by default.

    But it seems there are less binaries than the usual ones.

    For example, the assistant. Anyway, the important application is qmake to compile Qt applications.

    Do you have the Tools directory?

    Could you try the next configuration:

    ./configure -no-javascript-jit -no-script -no-scripttools

  • No I don't have the Tools directory in /usr/local/Trolltech/Qt-4.6.2/
    I ran your configuration (./configure -no-javascript-jit -no-script -no-scripttools) but It ended up with couple of errors as you can see :
    codemodel.h:99:50: note: declarations in dependent base ‘QMultiHash<QByteArray, CodeModel::Type*>’ are not found by unqualified lookup
    codemodel.h:99:50: note: use ‘this->insert’ instead
    make[3]: *** [.obj/release-shared/projectporter.o] Error 1
    make[3]: Leaving directory /usr/local/qt-everywhere-opensource-src-4.6.2/tools/porting/src' make[2]: *** [sub-src-make_default] Error 2 make[2]: Leaving directory/usr/local/qt-everywhere-opensource-src-4.6.2/tools/porting'
    make[1]: *** [sub-porting-make_default-ordered] Error 2
    make[1]: Leaving directory `/usr/local/qt-everywhere-opensource-src-4.6.2/tools'
    make: *** [sub-tools-make_default-ordered] Error 2

    Why would you suggest this? Is it important to have examples and demos compiled?

    The only differences with previous configuration is "-nomake doc -nomake examples -nomake demos -fast" arguments. Probably making one of these is causing problems which is kind of expected especially about examples considering there are lots of them and one of them could cause this.

    Now what is it so important about Tools directory ?
    Plus what should I do now? Can I continue with previous configuration which led to no errors or it wasn't good enough? (considering no Tools directory and less binary files)

    Sorry that I asked a lot of questions! :-)

  • Well, demos are important if you need get example code.

    I have Qt Creator in Tools and for me it is an important application to develop in Qt.

    Did you try to install Qt using apt-get?

    You could get Qt using the next command:

    sudo apt-get install qt4-dev-tools libqt4-dev libqt4-core libqt4-gui

    Edit: did you install libx11-dev, right?

  • Thank you
    Yes I have tried to install Qt Creator using Ubuntu Software Center but I don't get to choose Qt 4.6.2 version and all it has is the last Qt 5.3 (well actually qtcreator 3.0.1) and I don't know how to configure this version to use my cross compilation tools (arm-linux-gcc 4.4.3) as a compiler.
    You should know that I want to use arm-linux-gcc 4.4.3 to compile applications in Qt and I don't want to develop softwares for PC or Ubuntu and so on.
    I will try that apt-get you mentioned and I'll get back to you.
    Thank you anyway.

    Edit: Yes I already have the newest version of libx11-dev

  • Dude
    I installed Qt using "sudo apt-get install qt4-dev-tools libqt4-dev libqt4-core libqt4-gui"
    It has installed Qt Designer 4.8.6 on my system and I don't know what to do with it since it's just a UI designing environment. How am I supposed to configure it for Embedded Linux?

    I want to do something like this :
    which is why I went through that whole trouble to get Qt4.6.2 working.

  • Lifetime Qt Champion


    Then don't bother with 4.6.2 if you have a recent linux distribution on your board. Just follow this "guide": to cross-compile Qt.

Log in to reply