AnsweredAssumed Answered

QT static library link error .(FDPIC ELF)

Question asked by qian on Dec 30, 2011
Latest reply on Dec 30, 2011 by qian

hi

 

uclinux: blackfin-linux-dist-2010R1-RC5
tools:blackfin-toolchain-2010R1-R4

 

qt Library is statically compiled.

-------------------------------------------------------------------------------

Configuration Options:

./configure -confirm-license \
-opensource -verbose \
-prefix /mnt/qt-static-fdpic/usr \
-plugindir /mnt/qt-static-fdpic/usr/lib/qt   \
-datadir /mnt/qt-static-fdpic/usr/share/qt \
-translationdir /mnt/qt-static-fdpic/usr/share/qt/translations \
-sysconfdir /mnt/qt-static-fdpic/etc \
-examplesdir /mnt/qt-static-fdpic/usr/qt/examples \
-demosdir mnt/qt-static-fdpic/usr/qt/demos \
-embedded bfin \
-xplatform qws/linux-bfin-fdpic-g++ \
-little-endian \
-force-pkg-config \
-static \
-depths 8,16,24,32 \
............ \
-no-mouse-tslib \
-no-mouse-pc \
-no-largefile \
-qconfig azure

-------------------------------------------------------------------------------

 

Compile, and generate  static library files .

 

 

Then I  add the following message to .basrc :

 

----------------------
#blackfin QT4.5.1 -static fdpic elf
export PATH=$PATH:/mnt/qt-static-fdpic/usr/bin
export LD_LIBRARY_PATH=/mnt/qt-static-fdpic/usr/lib
export QTDIR=/mnt/qt-static-fdpic/qt-embedded-linux-opensource-src-4.5.1-blackfin
export QMAKESPEC=/mnt/qt-static-fdpic/qt-embedded-linux-opensource-src-4.5.1-blackfin/mkspecs/qws/linux-bfin-fdpic-g++

----------------------

 

 

I tested a simple QT application.

 

#include <QApplication>
#include <QPushButton>
#include <QProcess>
#include <QDebug>
int main(int argc, char *argv[])
{
    QApplication app(argc, argv);
    QPushButton hello("Hello world!");
    hello.show();

    return app.exec();
}


$:qmake -project
$:qmake
$:make

 

 

The following error message :


bfin-linux-uclibc-g++ -c -pipe -DQT_LINUX_NOMMU -Os -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_NETWORK_LIB -

DQT_CORE_LIB -I/mn
t/qt-static-fdpic/qt-embedded-linux-opensource-src-4.5.1-blackfin/mkspecs/qws/linux-bfin-fdpic-g++ -I. -I/mnt/qt-static-fdpic/usr/include
/QtCore -I/mnt/qt-static-fdpic/usr/include/QtNetwork -I/mnt/qt-static-fdpic/usr/include/QtGui -I/mnt/qt-static-fdpic/usr/include -I. -I.
-I. -I. -o hello.o hello.cpp
bfin-linux-uclibc-g++ -Wl,-O1 -o hello hello.o    -L/mnt/qt-static-fdpic/usr/lib -lQtGui -lQtNetwork -lQtCore -lpthread
/mnt/qt-static-fdpic/usr/lib/libQtCore.a(qlibrary_unix.o):在函数‘qdlerror()’中:
plugin/qlibrary_unix.cpp:(.text+0xc):对‘_dlerror’Undefined reference to
/mnt/qt-static-fdpic/usr/lib/libQtCore.a(qlibrary_unix.o):在函数‘QLibraryPrivate::resolve_sys(char const*)’中:
plugin/qlibrary_unix.cpp:(.text+0x160):对‘_dlsym’Undefined reference to
/mnt/qt-static-fdpic/usr/lib/libQtCore.a(qlibrary_unix.o):在函数‘QLibraryPrivate::unload_sys()’中:
plugin/qlibrary_unix.cpp:(.text+0x2ee):对‘_dlclose’Undefined reference to
/mnt/qt-static-fdpic/usr/lib/libQtCore.a(qlibrary_unix.o):在函数‘QLibraryPrivate::load_sys()’中:
plugin/qlibrary_unix.cpp:(.text+0x810):对‘_dlopen’未定义的引用
collect2: ld 返回 1
make: *** [hello] Error 1

 

thank you.

Outcomes