Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Problem Compiling Widget application, Linux

Problem Compiling Widget application, Linux

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 638 Views
  • 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
    maxwell31
    wrote on last edited by maxwell31
    #1

    Hi,

    I have problems linking a widgets application. The error I get looks like this:

    CMakeFiles/test/src/moc_TestClass.cpp.o:(.data.rel.ro._ZTV28TestClass[_ZTV28TestClass]+0x218): undefined reference to `non-virtual thunk to QWidget::redirected(QPoint*) const'
    CMakeFiles/test/src/moc_TestClass.cpp.o:(.data.rel.ro._ZTV28TestClass[_ZTV28TestClass]+0x220): undefined reference to `non-virtual thunk to QWidget::sharedPainter() const'
    CMakeFiles/test/src/moc_TestClass.cpp.o:(.data.rel.ro._ZTI28TestClass[_ZTI28TestClass]+0x10): undefined reference to `typeinfo for QDialog'
    libs/libmylib.a(mylib.cpp.o): In function `mylib_init':
    mylib.cpp:(.text+0x4b): undefined reference to `QApplication::QApplication(int&, char**, int)'
    collect2: error: ld returned 1 exit status
    

    I have no idea what is going on. In target_link_libraries I have the packages:

    target_link_libraries(  ${PROJECT_NAME}
      ${ADDITIONAL_LIBRARIES}
      ${QWT_LIBRARY}
      Qt5::Core
      Qt5::Widgets
      Qt5::Svg
    

    what is going wrong?

    1 Reply Last reply
    0
    • Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @maxwell31 said in Problem Compiling Widget application, Linux:

      QApplication::QApplication(int&, char**, int)

      This is a Qt4 ctor: https://doc.qt.io/archives/qt-4.8/qapplication.html#QApplication-3

      Looks like you're picking up the Qt4 include files.

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      1 Reply Last reply
      3

      • Login

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