Compilation on Ubuntu 14.04 failed

installation
linux
#1

Thanks for this new version.

I failed to compile it on ubuntu 14.04. The problem is related with QT (couldbe the libraries). I am not sure which one is missing based on the configure log file. Any idea on this issue? Thank you very much.

error_message

_mrtrix3$ ./configure _

MRtrix build type requested: release

Detecting OS: linux
Checking for C++11 compliant compiler [g++]: 4.8 - tested ok
Detecting pointer size: 64 bit
Detecting byte order: little-endian
Checking for variable-length array support: yes
Checking for non-POD variable-length array support: yes
Checking for zlib compression library: 1.2.8
checking for Eigen 3 library: 3.2.0
Checking shared library generation: yes
Checking for Qt moc: moc (version 5.2.1)
Checking for Qt qmake: qmake (version 5.2.1)
Checking for Qt rcc: rcc (version 5.2.1)
_Checking for Qt: _
ERROR: error linking Qt application!

Are all necessary (static or shared) Qt libraries installed?

Here is the last part of configure log.

log_file

executing “moc qt.h -o qt_moc.cpp”…

executing “g++ -c -std=c++11 -pthread -fPIC -march=native -DMRTRIX_WORD64 -isystem /usr/include/eigen3 -m64 -pipe -O2 -std=c++0x -Wall -W -D_REENTRANT -fPIE -DQT_NO_DEBUG -DQT_SVG_LIB -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -isystem /usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g+±64 -isystem /usr/include/qt5 -isystem /usr/include/qt5/QtSvg -isystem /usr/include/qt5/QtOpenGL -isystem /usr/include/qt5/QtWidgets -isystem /usr/include/qt5/QtGui -isystem /usr/include/qt5/QtCore qt.cpp -o qt.o”…

executing “g++ -c -std=c++11 -pthread -fPIC -march=native -DMRTRIX_WORD64 -isystem /usr/include/eigen3 -m64 -pipe -O2 -std=c++0x -Wall -W -D_REENTRANT -fPIE -DQT_NO_DEBUG -DQT_SVG_LIB -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -isystem /usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g+±64 -isystem /usr/include/qt5 -isystem /usr/include/qt5/QtSvg -isystem /usr/include/qt5/QtOpenGL -isystem /usr/include/qt5/QtWidgets -isystem /usr/include/qt5/QtGui -isystem /usr/include/qt5/QtCore qt_moc.cpp -o qt_moc.o”…

executing “g++ -pthread -lz qt_moc.o qt.o -o qt -m64 -Wl,-O1 -L/usr/X11R6/lib64 -lQt5Svg -L/usr/lib/x86_64-linux-gnu -lQt5OpenGL -lQt5Widgets -lQt5Gui -lQt5Core -lGL -lpthread”…

ERROR: error linking Qt application!

Are all necessary (static or shared) Qt libraries installed?

#2

It’s indeed tricky to figure out which library might be missing… It might be worth modifying configure to capture the output of these commands - not sure why we’re not seeing it to be honest, might look into it when I have a minute. In the meantime, maybe someone with a working 14.04 system can post the list of Qt- related packages they have installed in their system? Something like a dpkg -l | grep qt ought to do the trick?

#3

On my Ubuntu 14.04 LTS VM:

My Ubuntu Qt packages
daan@daan-VirtualBox:~$ dpkg -l | grep qt
ii  appmenu-qt                                            0.2.7+14.04.20140305-0ubuntu1                       amd64        application menu for Qt
ii  appmenu-qt5                                           0.3.0+14.04.20140415-0ubuntu1                       amd64        application menu for Qt5
ii  libaccounts-qt5-1                                     1.11+14.04.20140410.1-0ubuntu1                      amd64        QT library for single sign on
ii  libdbusmenu-qt2:amd64                                 0.9.3+14.04.20140314-0ubuntu1                       amd64        Qt implementation of the DBusMenu protocol
ii  libdbusmenu-qt5:amd64                                 0.9.3+14.04.20140314-0ubuntu1                       amd64        Qt5 implementation of the DBusMenu protocol
ii  libgsettings-qt1:amd64                                0.1+14.04.20140408-0ubuntu1                         amd64        Library to access GSettings from Qt
ii  liboxideqt-qmlplugin:amd64                            1.0.5-0ubuntu0.14.04.1                              amd64        Web browser engine library for Qt (QML plugin)
ii  liboxideqtcore0:amd64                                 1.0.5-0ubuntu0.14.04.1                              amd64        Web browser engine library for Qt (core)
ii  libqt4-dbus:amd64                                     4:4.8.5+git192-g085f851+dfsg-2ubuntu4.1             amd64        Qt 4 D-Bus module
ii  libqt4-declarative:amd64                              4:4.8.5+git192-g085f851+dfsg-2ubuntu4.1             amd64        Qt 4 Declarative module
ii  libqt4-designer:amd64                                 4:4.8.5+git192-g085f851+dfsg-2ubuntu4.1             amd64        Qt 4 designer module
ii  libqt4-dev                                            4:4.8.5+git192-g085f851+dfsg-2ubuntu4.1             amd64        Qt 4 development files
ii  libqt4-dev-bin                                        4:4.8.5+git192-g085f851+dfsg-2ubuntu4.1             amd64        Qt 4 development programs
ii  libqt4-help:amd64                                     4:4.8.5+git192-g085f851+dfsg-2ubuntu4.1             amd64        Qt 4 help module
ii  libqt4-network:amd64                                  4:4.8.5+git192-g085f851+dfsg-2ubuntu4.1             amd64        Qt 4 network module
ii  libqt4-opengl:amd64                                   4:4.8.5+git192-g085f851+dfsg-2ubuntu4.1             amd64        Qt 4 OpenGL module
ii  libqt4-opengl-dev                                     4:4.8.5+git192-g085f851+dfsg-2ubuntu4.1             amd64        Qt 4 OpenGL library development files
ii  libqt4-qt3support:amd64                               4:4.8.5+git192-g085f851+dfsg-2ubuntu4.1             amd64        Qt 3 compatibility library for Qt 4
ii  libqt4-script:amd64                                   4:4.8.5+git192-g085f851+dfsg-2ubuntu4.1             amd64        Qt 4 script module
ii  libqt4-scripttools:amd64                              4:4.8.5+git192-g085f851+dfsg-2ubuntu4.1             amd64        Qt 4 script tools module
ii  libqt4-sql:amd64                                      4:4.8.5+git192-g085f851+dfsg-2ubuntu4.1             amd64        Qt 4 SQL module
ii  libqt4-sql-sqlite:amd64                               4:4.8.5+git192-g085f851+dfsg-2ubuntu4.1             amd64        Qt 4 SQLite 3 database driver
ii  libqt4-svg:amd64                                      4:4.8.5+git192-g085f851+dfsg-2ubuntu4.1             amd64        Qt 4 SVG module
ii  libqt4-test:amd64                                     4:4.8.5+git192-g085f851+dfsg-2ubuntu4.1             amd64        Qt 4 test module
ii  libqt4-xml:amd64                                      4:4.8.5+git192-g085f851+dfsg-2ubuntu4.1             amd64        Qt 4 XML module
ii  libqt4-xmlpatterns:amd64                              4:4.8.5+git192-g085f851+dfsg-2ubuntu4.1             amd64        Qt 4 XML patterns module
ii  libqt5core5a:amd64                                    5.2.1+dfsg-1ubuntu14.2                              amd64        Qt 5 core module
ii  libqt5dbus5:amd64                                     5.2.1+dfsg-1ubuntu14.2                              amd64        Qt 5 D-Bus module
ii  libqt5feedback5:amd64                                 5.0~git20130529-0ubuntu3                            amd64        Qt Feedback module
ii  libqt5gui5:amd64                                      5.2.1+dfsg-1ubuntu14.2                              amd64        Qt 5 GUI module
ii  libqt5multimedia5:amd64                               5.2.1-0ubuntu5                                      amd64        Qt 5 Multimedia module
ii  libqt5network5:amd64                                  5.2.1+dfsg-1ubuntu14.2                              amd64        Qt 5 network module
ii  libqt5opengl5:amd64                                   5.2.1+dfsg-1ubuntu14.2                              amd64        Qt 5 OpenGL module
ii  libqt5organizer5:amd64                                5.0~git20140203~e0c5eebe-0ubuntu2                   amd64        Qt PIM module, Organizer library
ii  libqt5positioning5:amd64                              5.2.1-1ubuntu2                                      amd64        Qt Positioning module
ii  libqt5printsupport5:amd64                             5.2.1+dfsg-1ubuntu14.2                              amd64        Qt 5 print support module
ii  libqt5qml-graphicaleffects:amd64                      5.2.1-1                                             amd64        Qt 5 Graphical Effects module
ii  libqt5qml5:amd64                                      5.2.1-3ubuntu15.1                                   amd64        Qt 5 QML module
ii  libqt5quick5:amd64                                    5.2.1-3ubuntu15.1                                   amd64        Qt 5 Quick library
ii  libqt5sensors5:amd64                                  5.2.1+dfsg-2ubuntu2                                 amd64        Qt Sensors module
ii  libqt5sql5:amd64                                      5.2.1+dfsg-1ubuntu14.2                              amd64        Qt 5 SQL module
ii  libqt5sql5-sqlite:amd64                               5.2.1+dfsg-1ubuntu14.2                              amd64        Qt 5 SQLite 3 database driver
ii  libqt5svg5:amd64                                      5.2.1-1                                             amd64        Qt 5 SVG module
ii  libqt5test5:amd64                                     5.2.1+dfsg-1ubuntu14.2                              amd64        Qt 5 test module
ii  libqt5webkit5:amd64                                   5.1.1-1ubuntu8                                      amd64        Web content engine library for Qt
ii  libqt5webkit5-qmlwebkitplugin:amd64                   5.1.1-1ubuntu8                                      amd64        Qt WebKit QML plugin
ii  libqt5widgets5:amd64                                  5.2.1+dfsg-1ubuntu14.2                              amd64        Qt 5 widgets module
ii  libqt5xml5:amd64                                      5.2.1+dfsg-1ubuntu14.2                              amd64        Qt 5 XML module
ii  libqtassistantclient4:amd64                           4.6.3-6                                             amd64        Qt Assistant client library (runtime)
ii  libqtcore4:amd64                                      4:4.8.5+git192-g085f851+dfsg-2ubuntu4.1             amd64        Qt 4 core module
ii  libqtdbus4:amd64                                      4:4.8.5+git192-g085f851+dfsg-2ubuntu4.1             amd64        Qt 4 D-Bus module library
ii  libqtgui4:amd64                                       4:4.8.5+git192-g085f851+dfsg-2ubuntu4.1             amd64        Qt 4 GUI module
ii  libqtwebkit-dev                                       2.3.2-0ubuntu7                                      amd64        Web content engine library for Qt - development files
ii  libqtwebkit4:amd64                                    2.3.2-0ubuntu7                                      amd64        Web content engine library for Qt
ii  libsignon-qt5-1                                       8.56+14.04.20140307-0ubuntu2                        amd64        Single Sign On framework
ii  libunity-action-qt1:amd64                             1.1.0+14.04.20140304-0ubuntu1                       amd64        Unity Action Qt API
ii  oxideqt-codecs-extra:amd64                            1.0.5-0ubuntu0.14.04.1                              amd64        Web browser engine library for Qt (codecs)
ii  python-qt4                                            4.10.4+dfsg-1ubuntu1                                amd64        Python bindings for Qt4
ii  python-qt4-dbus                                       4.10.4+dfsg-1ubuntu1                                amd64        D-Bus Support for PyQt4
ii  qt-at-spi:amd64                                       0.3.1-4fakesync1                                    amd64        at-spi accessibility plugin for Qt
ii  qt4-linguist-tools                                    4:4.8.5+git192-g085f851+dfsg-2ubuntu4.1             amd64        Qt 4 Linguist tools
ii  qt4-qmake                                             4:4.8.5+git192-g085f851+dfsg-2ubuntu4.1             amd64        Qt 4 qmake Makefile generator tool
ii  qtchooser                                             39-g4717841-3                                       amd64        Wrapper to select between Qt development binary versions
ii  qtcore4-l10n                                          4:4.8.5+git192-g085f851+dfsg-2ubuntu4               all          Qt 4 core module translations
ii  qtdeclarative5-accounts-plugin                        0.4+14.04.20140317-0ubuntu1                         amd64        Expose the Online Accounts API to QML applications
ii  qtdeclarative5-dialogs-plugin:amd64                   5.2.1-3ubuntu15.1                                   amd64        Qt 5 Dialogs QML plugin
ii  qtdeclarative5-localstorage-plugin:amd64              5.2.1-3ubuntu15.1                                   amd64        Qt 5 localstorage QML plugin
ii  qtdeclarative5-privatewidgets-plugin:amd64            5.2.1-3ubuntu15.1                                   amd64        Qt 5 Private Widgets QML plugin
ii  qtdeclarative5-qtfeedback-plugin:amd64                5.0~git20130529-0ubuntu3                            amd64        Qt Feedback module - QML plugin
ii  qtdeclarative5-qtquick2-plugin:amd64                  5.2.1-3ubuntu15.1                                   amd64        Qt 5 Qt Quick 2 QML plugin
ii  qtdeclarative5-ubuntu-ui-extras-browser-plugin:amd64  0.23+14.04.20140428-0ubuntu1                        amd64        Ubuntu web browser QML plugin
ii  qtdeclarative5-ubuntu-ui-extras-browser-plugin-assets 0.23+14.04.20140428-0ubuntu1                        all          Ubuntu web browser QML plugin assets
ii  qtdeclarative5-ubuntu-ui-toolkit-plugin:amd64         0.1.46+14.04.20140408.1-0ubuntu1                    amd64        Qt Components for Ubuntu - QML plugin
ii  qtdeclarative5-unity-action-plugin:amd64              1.1.0+14.04.20140304-0ubuntu1                       amd64        Unity Action QML Components
ii  qtdeclarative5-window-plugin:amd64                    5.2.1-3ubuntu15.1                                   amd64        Qt 5 window QML plugin
ii  sni-qt:amd64                                          0.2.6-0ubuntu1                                      amd64        indicator support for Qt
ii  ubuntu-sso-client-qt                                  13.10-0ubuntu6                                      all          Ubuntu Single Sign-On client - Qt frontend

I’m still on Qt 4.8.6 though. I notice Meng’s configure has Qt 5.2.1.

Meng, did you have Qt installed before? If somehow part of the Qt5 libraries are missing, can you try sudo apt-get install qtbase5-dev?

#4

Thanky ou all for your comments.

@dchristiaens, I have qtbase5-dev installed in my system already.

I found a post in previous MRtrix3 discussion forum, ERROR: error linking Qt application!. There, the solution is to install qt-sdk. But it did not fix the configure issue in my case.

Then, I downloaded the QT from official website, qt-unified-linux-x64-2.0.3-online.run. And the default qt was upgraded to 5.2.1 after installation in system.

#5

So I assume this means you got things working in the end?

Otherwise, if you look closely at the thread you linked to, you’ll note that the qt-sdk solution wasn’t really what fixed it. We eventually narrowed it down to a missing libqt4-opengl-dev package. The chances are you were missing the equivalent Qt5 version, presumably libqt5-opengl-dev.

On that note, the Linux install instructions currently list libqt4-opengl-dev as the only target for apt-get for Ubuntu and derivatives. Maybe we should update that to suggest libqt5-opengl-dev for 14.04 and later…?

#6

Sorry, correct package name for Qt5 on 14.04 is actually libqt5opengl5-dev

#7

Thank you very much for your reply. You are right. The qt-sdk does not fix this issue, as well as libqt5opengl5-dev. I am trying to deploy it in another PC with Ubuntu 14.04. If it works, I may get more details on the dependences via ‘dpkg -l | grep qt’ .

#8

OK, in which case you might have one of the other issues mentioned in that post.

  • First thing to do is verify that qtchooser is pointing to the right version of Qt - you may also need to set the QT_SELECT variable. I remember trying to figure this out on someone’s system a few months ago, it was admittedly pretty confusing…

  • Post the full configure.log here. The chances are we’ll be able to spot inconsistencies earlier on in the configure process, which might shed some light on the problem.

#9

Hi. The problem has been fixed by installing the recommendation debs , described in wiki, with a clean system.

#10

Good to hear, thanks for reporting back!

#11

Dear Experts,
I encountered the same, I believe, error. The only difference is that I am using Debian 8 (Jessie) OS.

I did follow installation steps listed in MRtrix docs for Linux (Ubuntu). During compilation I received error message similar to the one received by Meng.

Error Message returned by running ./configure
`MRtrix build type requested: release

Detecting OS: linux
Checking for C++11 compliant compiler [g++]: 4.9.2 - tested ok
Detecting pointer size: 64 bit
Detecting byte order: little-endian
Checking for variable-length array support: yes
Checking for non-POD variable-length array support: yes
Checking for zlib compression library: 1.2.8
Checking for Eigen 3 library: 3.2.2
Checking shared library generation: yes
Checking for Qt moc: moc (version 4.8.6)
Checking for Qt qmake: qmake (version 4.8.6)
Checking for Qt rcc: rcc (version 4.8.6)
Checking for Qt: 
ERROR: error linking Qt application!

  See the file 'configure.log' for details. If this doesn't help and you need
  further assistance, please post on the MRtrix3 community forum
  (http://community.mrtrix.org/), and make sure to include the full contents of
  the 'configure.log' file.`

Here one can find configure.log file content

configure.log content
REPORT: 
MRtrix build type requested:

REPORT: release

REPORT: 

REPORT: Detecting OS: linux

REPORT: Checking for C++11 compliant compiler [g++]:
EXEC <<
CMD: g++ -dumpversion
EXIT: 0
STDOUT:
4.9.2
>>


REPORT: 4.9.2

COMPILE /tmp/tmpWWnIIa.cpp:
---

struct Base {
    Base (int);
};
struct Derived : Base {
    using Base::Base;
};

int main() {
  Derived D (int); // check for contructor inheritance
  return (0);
}

---
EXEC <<
CMD: g++ -c -std=c++11 -pthread -fPIC -march=native /tmp/tmpWWnIIa.cpp -o /tmp/tmpWWnIIa.o
EXIT: 0
>>

EXEC <<
CMD: g++ /tmp/tmpWWnIIa.o -pthread -o a.out
EXIT: 0
>>

EXEC <<
CMD: ./a.out
EXIT: 0
>>


REPORT:  - tested ok

REPORT: Detecting pointer size:

COMPILE /tmp/tmpUcCEFs.cpp:
---

#include <iostream>
int main() {
  std::cout << sizeof(void*);
  return (0);
}

---
EXEC <<
CMD: g++ -c -std=c++11 -pthread -fPIC -march=native /tmp/tmpUcCEFs.cpp -o /tmp/tmpUcCEFs.o
EXIT: 0
>>

EXEC <<
CMD: g++ /tmp/tmpUcCEFs.o -pthread -o a.out
EXIT: 0
>>

EXEC <<
CMD: ./a.out
EXIT: 0
STDOUT:
8
>>


REPORT: 64 bit

REPORT: Detecting byte order:

REPORT: little-endian

REPORT: Checking for variable-length array support:

COMPILE /tmp/tmp9Lulne.cpp:
---


int main(int argc, char* argv[]) {
  int x[argc];
  return 0;
}

---
EXEC <<
CMD: g++ -c -std=c++11 -pthread -fPIC -march=native -DMRTRIX_WORD64 /tmp/tmp9Lulne.cpp -o /tmp/tmp9Lulne.o
EXIT: 0
>>

EXEC <<
CMD: g++ /tmp/tmp9Lulne.o -pthread -o a.out
EXIT: 0
>>

EXEC <<
CMD: ./a.out
EXIT: 0
>>


REPORT: yes

REPORT: Checking for non-POD variable-length array support:

COMPILE /tmp/tmpbRyoo3.cpp:
---

#include <string>

class X {
  int x;
  double y;
  std::string s;
};

int main(int argc, char* argv[]) {
  X x[argc];
  return 0;
}

---
EXEC <<
CMD: g++ -c -std=c++11 -pthread -fPIC -march=native -DMRTRIX_WORD64 /tmp/tmpbRyoo3.cpp -o /tmp/tmpbRyoo3.o
EXIT: 0
>>

EXEC <<
CMD: g++ /tmp/tmpbRyoo3.o -pthread -o a.out
EXIT: 0
>>

EXEC <<
CMD: ./a.out
EXIT: 0
>>


REPORT: yes

REPORT: Checking for zlib compression library:

COMPILE /tmp/tmpAmoyO4.cpp:
---

#include <iostream>
#include <zlib.h>

int main() {
  std::cout << zlibVersion();
  return (0);
}

---
EXEC <<
CMD: g++ -c -std=c++11 -pthread -fPIC -march=native -DMRTRIX_WORD64 /tmp/tmpAmoyO4.cpp -o /tmp/tmpAmoyO4.o
EXIT: 0
>>

EXEC <<
CMD: g++ /tmp/tmpAmoyO4.o -pthread -lz -o a.out
EXIT: 0
>>

EXEC <<
CMD: ./a.out
EXIT: 0
STDOUT:
1.2.8
>>


REPORT: 1.2.8

REPORT: Checking for Eigen 3 library:
EXEC <<
CMD: pkg-config --cflags eigen3
EXIT: 0
STDOUT:
-I/usr/include/eigen3
>>


COMPILE /tmp/tmp1yLlF1.cpp:
---

#include <Eigen/Core>
#include <iostream>

int main (int argc, char* argv[]) {
  std::cout << EIGEN_WORLD_VERSION << "." << EIGEN_MAJOR_VERSION << "." << EIGEN_MINOR_VERSION << "\n";
  return 0;
}

---
EXEC <<
CMD: g++ -c -std=c++11 -pthread -fPIC -march=native -DMRTRIX_WORD64 -isystem /usr/include/eigen3 /tmp/tmp1yLlF1.cpp -o /tmp/tmp1yLlF1.o
EXIT: 0
>>

EXEC <<
CMD: g++ /tmp/tmp1yLlF1.o -pthread -lz -o a.out
EXIT: 0
>>

EXEC <<
CMD: ./a.out
EXIT: 0
STDOUT:
3.2.2
>>


REPORT: 3.2.2

REPORT: Checking shared library generation:
EXEC <<
CMD: g++ -c -std=c++11 -pthread -fPIC -march=native -DMRTRIX_WORD64 -isystem /usr/include/eigen3 /tmp/tmpItflYI.cpp -o /tmp/tmpItflYI.o
EXIT: 0
>>

EXEC <<
CMD: g++ /tmp/tmpItflYI.o -pthread -shared -pthread -lz -o libtest.so
EXIT: 0
>>


REPORT: yes

REPORT: Checking for Qt moc:
EXEC <<
CMD: moc -v
EXIT: 1
STDERR:
Qt Meta Object Compiler version 63 (Qt 4.8.6)
>>


REPORT: moc (version 4.8.6)

REPORT: Checking for Qt qmake:
EXEC <<
CMD: qmake -v
EXIT: 0
STDOUT:
QMake version 2.01a
Using Qt version 4.8.6 in /usr/lib/x86_64-linux-gnu
>>


REPORT: qmake (version 4.8.6)

REPORT: Checking for Qt rcc:
EXEC <<
CMD: rcc -v
EXIT: 1
STDERR:
Qt Resource Compiler version 4.8.6
>>


REPORT: rcc (version 4.8.6)

REPORT: Checking for Qt:

source file "qt.h":
---
#include <QObject>

class Foo: public QObject {
  Q_OBJECT;
  public:
    Foo();
    ~Foo();
  public slots:
    void setValue(int value);
  signals:
    void valueChanged (int newValue);
  private:
    int value_;
};
---

source file "qt.cpp":
---
#include <iostream>
#include "qt.h"

Foo::Foo() : value_ (42) { connect (this, SIGNAL(valueChanged(int)), this, SLOT(setValue(int))); }

Foo::~Foo() { std::cout << qVersion() << "\n"; }

void Foo::setValue (int value) { value_ = value; }

int main() { Foo f; }
---

project file "qt.pro":
---
CONFIG += c++11
QT += core gui opengl svg
HEADERS += qt.h
SOURCES += qt.cpp
---
EXEC <<
CMD: qmake
EXIT: 0
>>

EXEC <<
CMD: moc qt.h -o qt_moc.cpp
EXIT: 0
>>

EXEC <<
CMD: g++ -c -std=c++11 -pthread -fPIC -march=native -DMRTRIX_WORD64 -isystem /usr/include/eigen3 -m64 -pipe -O2 -Wall -W -D_REENTRANT -DQT_WEBKIT -DQT_NO_DEBUG -DQT_SVG_LIB -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -isystem /usr/share/qt4/mkspecs/linux-g++-64 -isystem /usr/include/qt4/QtCore -isystem /usr/include/qt4/QtGui -isystem /usr/include/qt4/QtOpenGL -isystem /usr/include/qt4/QtSvg -isystem /usr/include/qt4 -isystem /usr/X11R6/include qt.cpp -o qt.o
EXIT: 0
>>

EXEC <<
CMD: g++ -c -std=c++11 -pthread -fPIC -march=native -DMRTRIX_WORD64 -isystem /usr/include/eigen3 -m64 -pipe -O2 -Wall -W -D_REENTRANT -DQT_WEBKIT -DQT_NO_DEBUG -DQT_SVG_LIB -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -isystem /usr/share/qt4/mkspecs/linux-g++-64 -isystem /usr/include/qt4/QtCore -isystem /usr/include/qt4/QtGui -isystem /usr/include/qt4/QtOpenGL -isystem /usr/include/qt4/QtSvg -isystem /usr/include/qt4 -isystem /usr/X11R6/include qt_moc.cpp -o qt_moc.o
EXIT: 0
>>

EXEC <<
CMD: g++ -pthread -lz qt_moc.o qt.o -o qt -m64 -Wl,-O1 -L/usr/lib/x86_64-linux-gnu -L/usr/X11R6/lib64 -lQtSvg -lQtOpenGL -lQtGui -lQtCore -lGL -lpthread
EXIT: 1
STDERR:
/usr/bin/ld: cannot find -lGL
collect2: error: ld returned 1 exit status
>>


ERROR: error linking Qt application!

  See the file 'configure.log' for details. If this doesn't help and you need
  further assistance, please post on the MRtrix3 community forum
  (http://community.mrtrix.org/), and make sure to include the full contents of
  the 'configure.log' file.

I double checked that I have all of the explicitly mentioned modules - this is, quoting docs
’You will need to get those that provide these Qt modules: Core, GUI, OpenGL, SVG, and the qmake, rcc & moc executables (note these will probably be included in one of the other packages).’

Here is the list of Qt-related packages (version 4.8.6.) I have installed on my PC

My Debian Qt packages
ii  libqt4-core                           4:4.8.6+git64-g5dc8b2b+dfsg-3+deb8u1 amd64        transitional package for Qt 4 core non-GUI runtime libraries
ii  libqt4-dbus:amd64                     4:4.8.6+git64-g5dc8b2b+dfsg-3+deb8u1 amd64        Qt 4 D-Bus module
ii  libqt4-declarative:amd64              4:4.8.6+git64-g5dc8b2b+dfsg-3+deb8u1 amd64        Qt 4 Declarative module
ii  libqt4-designer:amd64                 4:4.8.6+git64-g5dc8b2b+dfsg-3+deb8u1 amd64        Qt 4 designer module
ii  libqt4-dev                            4:4.8.6+git64-g5dc8b2b+dfsg-3+deb8u1 amd64        Qt 4 development files
ii  libqt4-dev-bin                        4:4.8.6+git64-g5dc8b2b+dfsg-3+deb8u1 amd64        Qt 4 development programs
ii  libqt4-gui                            4:4.8.6+git64-g5dc8b2b+dfsg-3+deb8u1 amd64        transitional package for Qt 4 GUI runtime libraries
ii  libqt4-help:amd64                     4:4.8.6+git64-g5dc8b2b+dfsg-3+deb8u1 amd64        Qt 4 help module
ii  libqt4-network:amd64                  4:4.8.6+git64-g5dc8b2b+dfsg-3+deb8u1 amd64        Qt 4 network module
ii  libqt4-opengl:amd64                   4:4.8.6+git64-g5dc8b2b+dfsg-3+deb8u1 amd64        Qt 4 OpenGL module
ii  libqt4-opengl-dev                     4:4.8.6+git64-g5dc8b2b+dfsg-3+deb8u1 amd64        Qt 4 OpenGL library development files
ii  libqt4-qt3support:amd64               4:4.8.6+git64-g5dc8b2b+dfsg-3+deb8u1 amd64        Qt 3 compatibility library for Qt 4
ii  libqt4-script:amd64                   4:4.8.6+git64-g5dc8b2b+dfsg-3+deb8u1 amd64        Qt 4 script module
ii  libqt4-scripttools:amd64              4:4.8.6+git64-g5dc8b2b+dfsg-3+deb8u1 amd64        Qt 4 script tools module
ii  libqt4-sql:amd64                      4:4.8.6+git64-g5dc8b2b+dfsg-3+deb8u1 amd64        Qt 4 SQL module
ii  libqt4-sql-mysql:amd64                4:4.8.6+git64-g5dc8b2b+dfsg-3+deb8u1 amd64        Qt 4 MySQL database driver
ii  libqt4-svg:amd64                      4:4.8.6+git64-g5dc8b2b+dfsg-3+deb8u1 amd64        Qt 4 SVG module
ii  libqt4-test:amd64                     4:4.8.6+git64-g5dc8b2b+dfsg-3+deb8u1 amd64        Qt 4 test module
ii  libqt4-xml:amd64                      4:4.8.6+git64-g5dc8b2b+dfsg-3+deb8u1 amd64        Qt 4 XML module
ii  libqt4-xmlpatterns:amd64              4:4.8.6+git64-g5dc8b2b+dfsg-3+deb8u1 amd64        Qt 4 XML patterns module
ii  libqtcore4:amd64                      4:4.8.6+git64-g5dc8b2b+dfsg-3+deb8u1 amd64        Qt 4 core module
ii  libqtdbus4:amd64                      4:4.8.6+git64-g5dc8b2b+dfsg-3+deb8u1 amd64        Qt 4 D-Bus module library
ii  libqtgui4:amd64                       4:4.8.6+git64-g5dc8b2b+dfsg-3+deb8u1 amd64        Qt 4 GUI module
ii  libqtwebkit-dev                       2.3.4.dfsg-3                         amd64        Web content engine library for Qt - development files
ii  libqtwebkit4:amd64                    2.3.4.dfsg-3                         amd64        Web content engine library for Qt
ii  libqwt5-qt4                           5.2.3-1                              amd64        Qt4 widgets library for technical applications (runtime)
ii  libvtk5.8-qt4                         5.8.0-17.5                           amd64        Visualization Toolkit - A high level 3D visualization library - Qt runtime
ii  qt-assistant-compat                   4.6.3-6                              amd64        Qt Assistant compatibility binary (legacy)
ii  qt-at-spi:amd64                       0.3.1-5                              amd64        at-spi accessibility plugin for Qt
ii  qt4-linguist-tools                    4:4.8.6+git64-g5dc8b2b+dfsg-3+deb8u1 amd64        Qt 4 Linguist tools
ii  qt4-qmake                             4:4.8.6+git64-g5dc8b2b+dfsg-3+deb8u1 amd64        Qt 4 qmake Makefile generator tool
ii  qtchooser                             47-gd2b7997-2                        amd64        Wrapper to select between Qt development binary versions
ii  qtcore4-l10n                          4:4.8.6+git64-g5dc8b2b+dfsg-3+deb8u1 all          Qt 4 core module translations

I tried comparing this list with the one posted by dchristiaens, but I did not reach any conclusions.

#12

The relevant error message from your configure.log is this:

This indicates that the OpenGL development package is probably missing (there may be other reasons too, but assuming Debian’s package management is sound, this is the most likely reason). The missing package should provide a file called libGL.so (although it’s typically a symbolic link to the fully versioned file). However, I would have expected this to have been included as a dependency for the libqt4-opengl-dev package, it’s strange that it wasn’t handled properly. Unfortunately, fixing this will depend on exactly what graphics hardware you have (nvidia, AMD/ATI, Intel), and which drivers you’re using for it. If you search for packages named XXX-libgl-dev or XXX-libgl-devel, you may find one that matches your hardware, and that installing it sorts this out. The open source MESA drivers are probably the first sane bet, the relevant package would probably be called mesa-libgl-dev or similar. Or you may need to download the manufacturer’s drivers and install them, depending on exactly what graphics card you have, and whether Debian provides sufficiently up to date drivers to support OpenGL 3.3…

Sorry, there’s no magic bullet for this one, unfortunately… It’s inherently very hardware-dependent, and handled differently in different Linux distributions. Feel free to post back with more information if you struggle with this, we’ll do what we can to help…

#13

Thank You very much for detailed response and providing explanation as well as showing possible solutions. The post of Yours was of great help, the problem is now solved.

Should one be interested in what actually happened: during installation of drivers for my hardware I did use the ones downloaded directly from manufacturer’s website. This approach, however successful, is not fully supported by Debian, for which it is advised to use Debian’s repository. I assume this is why the libqt4-opengl-dev package wasn’t handled properly. Uninstalling manufacturer’s drivers and installing them from official repository did the trick and solved the problem.

I am sorry that I did bother with this kind of specific to single user problem. I was however pretty puzzled and pointing me in a direction of OpenGL/hardware/drivers surely saved me a lot of nerves and time. Thank You once more!

1 Like
Configure error linking qt Ubuntu 16.04