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. Qt template specialization error and linking issues
Qt 6.11 is out! See what's new in the release blog

Qt template specialization error and linking issues

Scheduled Pinned Locked Moved Qt Creator and other tools
17 Posts 3 Posters 8.6k 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.
  • A Offline
    A Offline
    andreyc
    wrote on last edited by
    #4

    Nothing suspicious is here.
    You did re-generate ui_blackmainwindow.h with Qt5.2.1, right?
    Could you show please part of ui_blackmainwindow.h that is related to QUuid.

    1 Reply Last reply
    0
    • A Offline
      A Offline
      apreddy
      wrote on last edited by
      #5

      yeah i did regenerate the ui_blackmainwindow.h
      I cleaned the project and then ran qmake and then built the project
      @#ifndef UI_BLACKMAINWINDOW_H
      #define UI_BLACKMAINWINDOW_H

      #include <QtCore/QVariant>
      #include <QtWidgets/QAction>
      #include <QtWidgets/QApplication>
      #include <QtWidgets/QButtonGroup>
      #include <QtWidgets/QDockWidget>
      #include <QtWidgets/QFrame>
      #include <QtWidgets/QHBoxLayout>
      #include <QtWidgets/QHeaderView>
      #include <QtWidgets/QMainWindow>
      #include <QtWidgets/QMenuBar>
      #include <QtWidgets/QPushButton>
      #include <QtWidgets/QSpacerItem>
      #include <QtWidgets/QStackedWidget>
      #include <QtWidgets/QVBoxLayout>
      #include <QtWidgets/QWidget>
      #include "blackframewidget.h"
      #include "blackinfowidget.h"
      #include "blacksettingswidget.h"
      #include "blackshotsettingswidget.h"
      #include "blackshotwidget.h"
      #include "blacksourcewidget.h"
      #include "blackxmlsettingswidget.h"
      #include "blackxmlwidget.h"
      @

      actually the quuid stuff resides in another source file which is then added to the header here is an instance.
      @void blackSettingsWidget::saveSettings()
      {
      QUuid blackFrameId;
      QString blackFrameName = blackFrameProfileNameLineEdit->text();
      int blackFrameIndex = blackFrameProfileComboBox->findText(blackFrameName);

      if (blackFrameIndex == -1)
      {
          blackFrameId = QUuid::createUuid();
          blackFrameProfileComboBox->addItem(blackFrameName, blackFrameId.toString());
      }
      else
      {
          blackFrameId = QUuid(blackFrameProfileComboBox->itemData(blackFrameIndex).toString());
      }
      
      //TO DO
      verifyBlackFrameSettings();
      
      saveBlackFrameSettings(blackFrameId, blackFrameName);
      blackFrameProfileComboBox->setCurrentIndex(blackFrameProfileComboBox->findText(blackFrameName));
      
      setupBlackFrameSettings(blackFrameId);
      
      returnBlackSettingsToNormal();
      
      emit reloadBlackFrameProfilesSignal();
      

      }

      void blackSettingsWidget::saveBlackFrameSettings(QUuid id, QString name)
      {
      blackFrameParameters* parametersB= new blackFrameParameters();
      blackFrameSettings* blackFrame = new blackFrameSettings(parametersB);

      blackFrame->setId(id);
      blackFrame->setName(name);
      blackFrame->setDetectBlackOption(automaticallyDetectBlackFramesCheckBox->checkState());
      blackFrame->setDetectBlackLevel(detectBlackLevelLineEdit->text().toUInt());
      blackFrame->setDetectBlackFrameMinimum(detectBlackMimimumFramesLineEdit->text().toUInt());
      blackFrame->setDetectBlackMethod(detectBlackMethodComboBox->currentIndex());
      
      int setB = dataBasePointer->setSettingInDataBase(parametersB, dataBase::BLACKFRAME);
      if (setB)
      {
          QMessageBox::critical(this, tr("Error"), tr("Data Base Error.\n\n%1").arg(dataBasePointer->warningErrorMessage));
      
          return;
      }
      

      }@

      1 Reply Last reply
      0
      • A Offline
        A Offline
        andreyc
        wrote on last edited by
        #6

        You do not use extern "C" anywhere, right?

        I created a small project with QUuid and I was not able to reproduce the problem.
        I build it in Qt 4.8.5, 5.2.1, and 5.3.0

        I guess you will need to comment out the suspicious lines one by one and try to find what particular line cause this error.

        1 Reply Last reply
        0
        • A Offline
          A Offline
          apreddy
          wrote on last edited by
          #7

          i tried doing that .. but unfortunately i had like a lot of errors. that too in the in the qt header files ...so i suspect what i am doing is wrong.. another thing to mention here is that all my source files when i individually compile compile well but when i compile the entire project that's when i get into trouble.

          1 Reply Last reply
          0
          • hskoglundH Offline
            hskoglundH Offline
            hskoglund
            wrote on last edited by
            #8

            Hmm just a guess, mabe you quuid stuff needs a qglobal.h, perhaps try
            #include <qglobal.h>
            just before
            #include <ui_blackmainwindow.h>
            in your blackmainwindow.h (or the .h file where the quuid stuff goes)

            1 Reply Last reply
            0
            • A Offline
              A Offline
              apreddy
              wrote on last edited by
              #9

              Hi hskoglund,

              I tried including q global but that has not improved the situation.

              1 Reply Last reply
              0
              • A Offline
                A Offline
                apreddy
                wrote on last edited by
                #10

                Hi There,

                Dose anyone have any more suggestions??

                1 Reply Last reply
                0
                • A Offline
                  A Offline
                  andreyc
                  wrote on last edited by
                  #11

                  Have you tried to build the project on other OS (Linux, MacOS X) ?

                  1 Reply Last reply
                  0
                  • A Offline
                    A Offline
                    apreddy
                    wrote on last edited by
                    #12

                    I tried building it in Mac OS X and it works fine, and i have not tried bulding it in linux yet.

                    1 Reply Last reply
                    0
                    • A Offline
                      A Offline
                      andreyc
                      wrote on last edited by
                      #13

                      Do you use correct compiler to build on windows?
                      Check in the settings what compiler version is selected to Qt 5.

                      1 Reply Last reply
                      0
                      • A Offline
                        A Offline
                        apreddy
                        wrote on last edited by
                        #14

                        I a using MinGW4.8 32 bit compile which came along the qt .

                        1 Reply Last reply
                        0
                        • A Offline
                          A Offline
                          andreyc
                          wrote on last edited by
                          #15

                          You don't have other versions of Qt and compilers, right?

                          1 Reply Last reply
                          0
                          • A Offline
                            A Offline
                            apreddy
                            wrote on last edited by
                            #16

                            nope i uninstalled the previous versons which i had previously installed..

                            1 Reply Last reply
                            0
                            • A Offline
                              A Offline
                              andreyc
                              wrote on last edited by
                              #17

                              What if

                              create a simple Qt project

                              in the header of MainWindow #include <QUuid>

                              add QUuid variable to MainWindow

                              try to compile

                              Does it generate the error?

                              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