Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. connection not found with mingw and cmake
Forum Updated to NodeBB v4.3 + New Features

connection not found with mingw and cmake

Scheduled Pinned Locked Moved Solved Qt Creator and other tools
5 Posts 2 Posters 711 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
    msauer75
    wrote on last edited by
    #1

    Hi,

    I converted my Qt project from qmake to cmake with out any problems. With linux (xubuntu) I can sucessful compile my programme and it works fine.
    If I switch to windows 10 (Qt 5.15 with mingw 8.1 64bit) I will get a lot of

    QObject::connect: signal not found in lib::datad::EnumeratorDecorator
    QObject::connect: signal not found in lib::datad::EnumeratorDecorator
    QObject::connect: signal not found in lib::datad::EnumeratorDecorator
    QObject::connect: signal not found in lib::datad::EnumeratorDecorator
    QObject::connect: signal not found in lib::datad::KoordinatenDecorator
    

    and my application doesn't work.

    Do you have a solution for this problem?
    Thank you for your help.
    BR
    martin

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

      @msauer75 said in connection not found with mingw and cmake:

      target_compile_definitions(${LIB} PUBLIC ${LIBDEF})

      This is wrong since LIBGC_LIBRARY must only be defined when compiling the library, not when using it. See the cmake documentation --> replace PUBLIC with PRIVATE

      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
      1
      • Christian EhrlicherC Online
        Christian EhrlicherC Online
        Christian Ehrlicher
        Lifetime Qt Champion
        wrote on last edited by
        #2

        This has nothing to do with qmake or cmake. You have to export the classes you use from a library on windows: https://doc.qt.io/qt-5/sharedlibrary.html

        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
        1
        • M Offline
          M Offline
          msauer75
          wrote on last edited by
          #3

          Ok.

          My CMakeLists.txt

          set(LIBDEF "LIBGC_LIBRARY")
          target_compile_definitions(${LIB} PUBLIC ${LIBDEF})
          

          In my libraries I have the following include:

          #ifndef LIBGC_GLOBAL_H
          #define LIBGC_GLOBAL_H
          
          #include <QtCore/qglobal.h>
          
          #if defined(LIBGC_LIBRARY)
          #  define LIBGCSHARED_EXPORT Q_DECL_EXPORT
          #else
          #  define LIBGCSHARED_EXPORT Q_DECL_IMPORT
          #endif
          
          #endif // LIBGC_GLOBAL_H
          

          The class definition:

          class LIBGCSHARED_EXPORT Cache : public QObject
          {
              Q_OBJECT
              Q_PROPERTY(lib::datad::IntDecorator                             *ui_anzgc           READ GetAnz                 CONSTANT)
              Q_PROPERTY(lib::datad::IntDecorator                             *ui_pos             READ GetPos                 CONSTANT)
          
           [...]
          };
          

          This is the same, which I did in the qmake project.

          BR
          martin

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

            @msauer75 said in connection not found with mingw and cmake:

            target_compile_definitions(${LIB} PUBLIC ${LIBDEF})

            This is wrong since LIBGC_LIBRARY must only be defined when compiling the library, not when using it. See the cmake documentation --> replace PUBLIC with PRIVATE

            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
            1
            • M Offline
              M Offline
              msauer75
              wrote on last edited by
              #5

              Ok. That is. Now it works
              Thank you

              BR
              martin

              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