Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-107050

problem linking with g++-12

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.3.1
    • Build tools: moc
    • None
    • macOS

    Description

      Hi,
      I'm switching my code from qt5 to qt6.
      Right now it works on linux, cross compile for windows but not on my mac...

      I've created a simple exemple here:
      https://github.com/iltommi/MRE
      the problem seems to come from a public slot returning a QList<double>

      class my_app : public QApplication {
          Q_OBJECT
      public:
          my_app( int &argc, char **argv ): QApplication(argc, argv) {};
      
      public slots:
          QVector<double> my_slot() {
      		return QVector<double>();
          };
      };
      

      I use qt from homebrew and g++12 also from homebrew.

      I get this error at linking time (after demanglig):

      Undefined symbols for architecture x86_64:
        "QMetaType::registerConverterFunction(std::function<bool (void const*, void*)> const&, QMetaType, QMetaType)", referenced from:
            bool QMetaType::registerConverterImpl<QList<double>, QIterable<QMetaSequence> >(std::function<bool (void const*, void*)>, QMetaType, QMetaType) in mocs_compilation.cpp.o
        "QMetaType::registerMutableViewFunction(std::function<bool (void*, void*)> const&, QMetaType, QMetaType)", referenced from:
            bool QMetaType::registerMutableViewImpl<QList<double>, QIterable<QMetaSequence> >(std::function<bool (void*, void*)>, QMetaType, QMetaType) in mocs_compilation.cpp.o
      ld: symbol(s) not found for architecture x86_64
      

      I've set up cirrus-ci build here: https://cirrus-ci.com/build/5261966146011136
      The error happens with both intel and M1

      Attachments

        Activity

          People

            fabiankosmale Fabian Kosmale
            tommaso tommaso
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: