Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Qt4/Cygwin link errors building from Hello.cpp
Forum Updated to NodeBB v4.3 + New Features

Qt4/Cygwin link errors building from Hello.cpp

Scheduled Pinned Locked Moved Installation and Deployment
1 Posts 1 Posters 2.2k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    metaed
    wrote on last edited by
    #1

    I am trying for the first time to build a Qt program using Qt4 from the Cygwin distribution. The recipe I'm following is the Hello program on the Wikipedia page for Qt.

    To install Qt, I selected the available Qt4 components in the Cygwin installer. I am appending the output of cygcheck -c which shows the packages that are active in my Cygwin installation. Due to a 6,000 character limit posting here, I am only able to offer filtered output, which is probably less than helpful.

    The build fails in the link stage:

    @
    $ mkdir Hello
    $ cd Hello
    $ cat > Hello.cpp
    #include <QtGui>

    int main(int argc, char *argv[])
    {
    QApplication app(argc, argv);
    QLabel label("Hello, world!");
    label.show();
    return app.exec();
    }
    $ qmake-qt4 -project
    $ qmake-qt4 Hello.pro
    $ make
    g++-4 -o Hello.exe Hello.o -L/usr/lib/qt4/lib -lQtGui -L/usr/lib/qt4/lib -laudio -lXt -lpng -lSM -lICE -lXi -lXrender -lXrandr -lXfixes -lXcursor -lXinerama -lfontconfig -lexpat -lfreetype -lXext -lX11 -lQtCore -lz -lm -lgthread-2.0 -lglib-2.0 -lintl -liconv -ldl -lpthread
    Hello.o:Hello.cpp:(.text+0x21): undefined reference to ___gxx_personality_sj0' Hello.o:Hello.cpp:(.text+0x45): undefined reference to __Unwind_SjLj_Register'
    Hello.o:Hello.cpp:(.text+0x143): undefined reference to __Unwind_SjLj_Unregister' Hello.o:Hello.cpp:(.text+0x1b8): undefined reference to __Unwind_SjLj_Resume'
    collect2: ld returned 1 exit status
    make: *** [Hello.exe] Error 1
    @

    Before I spend a potentially long, long time digging into this, I wondered if this was a well known problem with an easy solution.

    Cheers,

    MetaEd

    @
    $ cygcheck -c | fgrep -i qt
    libQt3Support4 4.5.3-1 OK
    libQtAssistantClient4 4.5.3-1 OK
    libQtAssistantClient4-devel 4.5.3-1 OK
    libQtCore4 4.5.3-1 OK
    libQtCore4-devel 4.5.3-1 OK
    libQtDBus4 4.5.3-1 OK
    libQtDBus4-devel 4.5.3-1 OK
    libQtDesigner4 4.5.3-1 OK
    libQtDesigner4-devel 4.5.3-1 OK
    libQtGui4 4.5.3-1 OK
    libQtGui4-devel 4.5.3-1 OK
    libQtHelp4 4.5.3-1 OK
    libQtHelp4-devel 4.5.3-1 OK
    libQtNetwork4 4.5.3-1 OK
    libQtNetwork4-devel 4.5.3-1 OK
    libQtOpenGL4 4.5.3-1 OK
    libQtOpenGL4-devel 4.5.3-1 OK
    libQtScript4 4.5.3-1 OK
    libQtScript4-devel 4.5.3-1 OK
    libQtScriptTools4 4.5.3-1 OK
    libQtScriptTools4-devel 4.5.3-1 OK
    libQtSql4 4.5.3-1 OK
    libQtSql4-devel 4.5.3-1 OK
    libQtSvg4 4.5.3-1 OK
    libQtSvg4-devel 4.5.3-1 OK
    libQtTest4 4.5.3-1 OK
    libQtTest4-devel 4.5.3-1 OK
    libQtWebKit4 4.5.3-1 OK
    libQtWebKit4-devel 4.5.3-1 OK
    libQtXml4 4.5.3-1 OK
    libQtXml4-devel 4.5.3-1 OK
    libQtXmlPatterns4 4.5.3-1 OK
    libQtXmlPatterns4-devel 4.5.3-1 OK
    pinentry-qt4 0.7.6-3 OK
    qt4-devel-tools 4.5.3-1 OK
    qt4-doc 4.5.3-1 OK
    qt4-qtconfig 4.5.3-1 OK
    qt4-qtdemo 4.5.3-1 OK
    @

    Sometimes they fool you by walking upright.

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved