RHEL5: undefined references

edited November 2013 in KLayout Support
I get many undefined references at link time when building on
Red Hat Enterprise Linux Client release 5.6 (Tikanga)
$ gcc --version
gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-50)

I added in some necessary libraries, e.g.
-lSM -lpng12 -lmng -ltiff -lfontconfig -lgthread-2.0 -lglib-2.0 -lXrender -lXext -lX11
which got rid of all but the issues show below. Any ideas on what is still missing and why I have to add these libraries but they are not part of the standard configuration?

./build.sh: line 66: ruby1.9: command not found
./build.sh: line 67: ruby1.8: command not found
/custom/tools/lang/release5/Qt-4.7.2/lib/libQtGui.a(qgtkstyle.o): In function `QGtkStyle::drawPrimitive(QStyle::PrimitiveElement, QStyleOption const*, QPainter*, QWidget const*) const':
qgtkstyle.cpp:(.text+0x3426): undefined reference to `g_type_check_instance_cast'
qgtkstyle.cpp:(.text+0x343a): undefined reference to `g_object_set_data'
/custom/tools/lang/release5/Qt-4.7.2/lib/libQtGui.a(qgtkstyle.o): In function `QGtkStyle::styleHint(QStyle::StyleHint, QStyleOption const*, QWidget const*, QStyleHintReturn*) const':
qgtkstyle.cpp:(.text+0x523d): undefined reference to `g_object_get'
qgtkstyle.cpp:(.text+0x52d1): undefined reference to `g_object_get'
qgtkstyle.cpp:(.text+0x53bd): undefined reference to `g_object_get'
qgtkstyle.cpp:(.text+0x54c3): undefined reference to `g_object_get'
/custom/tools/lang/release5/Qt-4.7.2/lib/libQtGui.a(qgtkstyle.o): In function `QGtkStyle::pixelMetric(QStyle::PixelMetric, QStyleOption const*, QWidget const*) const':
qgtkstyle.cpp:(.text+0x5a3e): undefined reference to `g_object_get'
/custom/tools/lang/release5/Qt-4.7.2/lib/libQtGui.a(qgtkstyle_p.o):qgtkstyle_p.cpp:(.text+0x23a): more undefined references to `g_object_get' follow
/custom/tools/lang/release5/Qt-4.7.2/lib/libQtGui.a(qgtkstyle_p.o): In function `QGtkStylePrivate::setupGtkWidget(_GtkWidget*)':
qgtkstyle_p.cpp:(.text+0x7aa): undefined reference to `g_type_check_instance_is_a'
/custom/tools/lang/release5/Qt-4.7.2/lib/libQtGui.a(qgtkstyle_p.o): In function `QGtkStylePrivate::addWidgetToMap(_GtkWidget*)':
qgtkstyle_p.cpp:(.text+0x984): undefined reference to `g_type_check_instance_is_a'
/custom/tools/lang/release5/Qt-4.7.2/lib/libQtGui.a(qgtkstyle_p.o): In function `QGtkStylePrivate::addAllSubWidgets(_GtkWidget*, void*)':
qgtkstyle_p.cpp:(.text+0xb69): undefined reference to `g_type_check_instance_is_a'
/custom/tools/lang/release5/Qt-4.7.2/lib/libQtGui.a(qgtkstyle_p.o): In function `QGtkStylePrivate::getGConfBool(QString const&, bool)':
qgtkstyle_p.cpp:(.text+0x2227): undefined reference to `g_type_init'
qgtkstyle_p.cpp:(.text+0x2275): undefined reference to `g_object_unref'
/custom/tools/lang/release5/Qt-4.7.2/lib/libQtGui.a(qgtkstyle_p.o): In function `QGtkStylePrivate::getGConfString(QString const&, QString const&)':
qgtkstyle_p.cpp:(.text+0x2311): undefined reference to `g_type_init'
qgtkstyle_p.cpp:(.text+0x2367): undefined reference to `g_object_unref'
/custom/tools/lang/release5/Qt-4.7.2/lib/libQtGui.a(qgtkstyle_p.o): In function `QGtkStylePrivate::initGtkWidgets() const':
qgtkstyle_p.cpp:(.text+0x372b): undefined reference to `g_signal_connect_data'
qgtkstyle_p.cpp:(.text+0x38c9): undefined reference to `g_signal_connect_data'
/custom/tools/lang/release5/Qt-4.7.2/lib/libQtGui.a(qgtkstyle_p.o): In function `QGtkStylePrivate::setupGtkFileChooser(_GtkWidget*, QWidget*, QString const&, QString const&, QString*, QFlags<QFileDialog::Option>, bool, QMap<_GtkFileFilter*, QString>*)':
qgtkstyle_p.cpp:(.text+0x3c7c): undefined reference to `g_object_set'
qgtkstyle_p.cpp:(.text+0x3c96): undefined reference to `g_object_set'
/custom/tools/lang/release5/Qt-4.7.2/lib/libQtGui.a(qgtkstyle_p.o): In function `QGtkStylePrivate::openFilenames(QWidget*, QString const&, QString const&, QString const&, QString*, QFlags<QFileDialog::Option>)':
qgtkstyle_p.cpp:(.text+0x5350): undefined reference to `g_object_set'
collect2: ld returned 1 exit status
gmake[1]: *** [klayout] Error 1
gmake: *** [all] Error 1

Comments

  • edited November -1

    Hi Norman,

    it looks like you are using some custom built Qt package. It's not usual to link against static libraries. Typically you use .so libs which resolve their dependencies by itself.

    If you build Qt the standard way, it will be installed in /usr/lib or similar as shared objects and those problems will not appear. Specifically if you are using some Linux distribution which comes with all the required packages.

    Matthias

Sign In or Register to comment.