Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Installation Help - Compile errors



  • Hi everyone,
    I would like to ask for your help with my install and setup. I have ran into an issue that I can't seem to get past. I have installed the following packages on my Win8 PC.
    qt-windows-opensource-5.0.0-msvc2010_32-x86-offline
    mingw-get-inst-20120426

    I set the path in the Environment for minGW and Qt/bin.

    In Qt - Tools - Options - Build & Run Compilers tab. Auto-detected shows my minGW installation.

    Under the Qt Versions tab; I see a red exclamation mark and 'No compiler can produce code for this Qt version. Please define one or more compilers'. If I click on the 'Details' button twice next to 'Qt version 5.0.0 for Desktop' ( this seems to be a bug here ). This will expose a second 'Details' button that was not there previously. On that list; QML Dump, QML Debugging Library, QML Obsrver, GDB Helper and Compiler are listed. For Compiler I am not able to change it's selection and it remains blank.

    For the Kits tab; Auto-detected shows Desktop Qt 5.0.0 MSVC2010 32bit. Compiler is blank and gray'd out. Here if I create a new 'Kit' the default Auto-detected kit will then change compiler to 'minGW'.

    When I create an empty gui application and compile it. Qt returns 80+ undefined references (code and output below). I'm not sure If I'm dealing with a Win8 issue or I simply mucked it up and installed/setup something wrong. Your help here is greatly appreciated.

    Here is the what i'm compiling and it's output.

    @
    #include "mainwindow.h"
    #include <QApplication>

    int main(int argc, char *argv[])
    {
    QApplication a(argc, argv);
    MainWindow w;
    w.show();

    return a.exec&#40;&#41;;
    

    }
    @

    @
    #include "mainwindow.h"
    #include "ui_mainwindow.h"

    MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
    {
    ui->setupUi(this);
    }

    MainWindow::~MainWindow()
    {
    delete ui;
    }
    @



  • Here is the output from a compile;

    11:52:02: Running steps for project untitled2...
    11:52:02: Starting: "C:\Qt\Qt5.0.0\5.0.0\msvc2010\bin\qmake.exe" C:\Code\QT\untitled2\untitled2.pro -r -spec win32-g++ "CONFIG+=debug" "CONFIG+=declarative_debug" "CONFIG+=qml_debug"
    11:52:02: The process "C:\Qt\Qt5.0.0\5.0.0\msvc2010\bin\qmake.exe" exited normally.
    11:52:02: Starting: "C:\MinGW\bin\mingw32-make.exe"
    C:/MinGW/bin/mingw32-make -f Makefile.Debug
    mingw32-make[1]: Entering directory C:/Code/QT/untitled2-build-Desktop_Qt_5_0_0_MSVC2010_32bit_SDK-Debug' C:\Qt\Qt5.0.0\5.0.0\msvc2010\bin\uic.exe ..\untitled2\mainwindow.ui -o ui_mainwindow.h g++ -c -pipe -fno-keep-inline-dllexport -g -frtti -Wall -Wextra -fexceptions -mthreads -DUNICODE -DQT_QML_DEBUG -DQT_DECLARATIVE_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_OPENGL_ES_2 -DQT_OPENGL_ES_2_ANGLE -DQT_NEEDS_QMAIN -I..\untitled2 -I"..\..\..\Qt\Qt5.0.0\5.0.0\msvc2010\include" -I"..\..\..\Qt\Qt5.0.0\5.0.0\msvc2010\include\QtWidgets" -I"..\..\..\Qt\Qt5.0.0\5.0.0\msvc2010\include\QtGui" -I"..\..\..\Qt\Qt5.0.0\5.0.0\msvc2010\include\QtCore" -I"debug" -I"." -I"." -I"..\..\..\Qt\Qt5.0.0\5.0.0\msvc2010\mkspecs\win32-g++" -o debug\main.o ..\untitled2\main.cpp g++ -c -pipe -fno-keep-inline-dllexport -g -frtti -Wall -Wextra -fexceptions -mthreads -DUNICODE -DQT_QML_DEBUG -DQT_DECLARATIVE_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_OPENGL_ES_2 -DQT_OPENGL_ES_2_ANGLE -DQT_NEEDS_QMAIN -I..\untitled2 -I"..\..\..\Qt\Qt5.0.0\5.0.0\msvc2010\include" -I"..\..\..\Qt\Qt5.0.0\5.0.0\msvc2010\include\QtWidgets" -I"..\..\..\Qt\Qt5.0.0\5.0.0\msvc2010\include\QtGui" -I"..\..\..\Qt\Qt5.0.0\5.0.0\msvc2010\include\QtCore" -I"debug" -I"." -I"." -I"..\..\..\Qt\Qt5.0.0\5.0.0\msvc2010\mkspecs\win32-g++" -o debug\mainwindow.o ..\untitled2\mainwindow.cpp C:\Qt\Qt5.0.0\5.0.0\msvc2010\bin\moc.exe -DUNICODE -DQT_QML_DEBUG -DQT_DECLARATIVE_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_OPENGL_ES_2 -DQT_OPENGL_ES_2_ANGLE -DQT_NEEDS_QMAIN -I..\untitled2 -I"..\..\..\Qt\Qt5.0.0\5.0.0\msvc2010\include" -I"..\..\..\Qt\Qt5.0.0\5.0.0\msvc2010\include\QtWidgets" -I"..\..\..\Qt\Qt5.0.0\5.0.0\msvc2010\include\QtGui" -I"..\..\..\Qt\Qt5.0.0\5.0.0\msvc2010\include\QtCore" -I"debug" -I"." -I"." -I"..\..\..\Qt\Qt5.0.0\5.0.0\msvc2010\mkspecs\win32-g++" -D__GNUC__ -DWIN32 ..\untitled2\mainwindow.h -o debug\moc_mainwindow.cpp g++ -c -pipe -fno-keep-inline-dllexport -g -frtti -Wall -Wextra -fexceptions -mthreads -DUNICODE -DQT_QML_DEBUG -DQT_DECLARATIVE_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_OPENGL_ES_2 -DQT_OPENGL_ES_2_ANGLE -DQT_NEEDS_QMAIN -I..\untitled2 -I"..\..\..\Qt\Qt5.0.0\5.0.0\msvc2010\include" -I"..\..\..\Qt\Qt5.0.0\5.0.0\msvc2010\include\QtWidgets" -I"..\..\..\Qt\Qt5.0.0\5.0.0\msvc2010\include\QtGui" -I"..\..\..\Qt\Qt5.0.0\5.0.0\msvc2010\include\QtCore" -I"debug" -I"." -I"." -I"..\..\..\Qt\Qt5.0.0\5.0.0\msvc2010\mkspecs\win32-g++" -o debug\moc_mainwindow.o debug\moc_mainwindow.cpp g++ -Wl,-subsystem,windows -mthreads -o debug\untitled2.exe debug/main.o debug/mainwindow.o debug/moc_mainwindow.o -lmingw32 -lqtmaind -LC:\Qt\Qt5.0.0\5.0.0\msvc2010\lib -lQt5Widgetsd -lQt5Guid -lQt5Cored -llibEGLd -llibGLESv2d -lgdi32 -luser32 Warning: .drectve/DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"uuid.lib" /FAILIFMISMATCH:"_MSC_VER=1600" /FAILIFMISMATCH:"_ITERATOR_DEBUG_LEVEL=2" /DEFAULTLIB:"msvcprtd" /DEFAULTLIB:"MSVCRTD" /DEFAULTLIB:"OLDNAMES" ' unrecognized
    debug/main.o: In function `Z5qMainiPPc':



  • C:\Code\QT\untitled2-build-Desktop_Qt_5_0_0_MSVC2010_32bit_SDK-Debug/../untitled2/main.cpp:6: undefined reference to _imp___ZN12QApplicationC1ERiPPci' C:\Code\QT\untitled2-build-Desktop_Qt_5_0_0_MSVC2010_32bit_SDK-Debug/../untitled2/main.cpp:8: undefined reference to_imp___ZN7QWidget4showEv'
    C:\Code\QT\untitled2-build-Desktop_Qt_5_0_0_MSVC2010_32bit_SDK-Debug/../untitled2/main.cpp:10: undefined reference to _imp___ZN12QApplication4execEv' C:\Code\QT\untitled2-build-Desktop_Qt_5_0_0_MSVC2010_32bit_SDK-Debug/../untitled2/main.cpp:6: undefined reference to_imp___ZN12QApplicationD1Ev'
    C:\Code\QT\untitled2-build-Desktop_Qt_5_0_0_MSVC2010_32bit_SDK-Debug/../untitled2/main.cpp:6: undefined reference to _imp___ZN12QApplicationD1Ev' debug/mainwindow.o: In functionMainWindow':
    C:\Code\QT\untitled2-build-Desktop_Qt_5_0_0_MSVC2010_32bit_SDK-Debug/../untitled2/mainwindow.cpp:6: undefined reference to _imp___ZN11QMainWindowC2EP7QWidget6QFlagsIN2Qt10WindowTypeEE' C:\Code\QT\untitled2-build-Desktop_Qt_5_0_0_MSVC2010_32bit_SDK-Debug/../untitled2/mainwindow.cpp:6: undefined reference to_imp___ZN11QMainWindowD2Ev'
    debug/mainwindow.o: In function ~MainWindow': C:\Code\QT\untitled2-build-Desktop_Qt_5_0_0_MSVC2010_32bit_SDK-Debug/../untitled2/mainwindow.cpp:11: undefined reference to_imp___ZN11QMainWindowD2Ev'
    debug/mainwindow.o: In function ZN7QString8fromUtf8EPKci': C:\Code\QT\untitled2-build-Desktop_Qt_5_0_0_MSVC2010_32bit_SDK-Debug/../../../Qt/Qt5.0.0/5.0.0/msvc2010/include/QtCore/qstring.h:478: undefined reference to_imp___ZN7QString15fromUtf8_helperEPKci'
    debug/mainwindow.o: In function ZN7QWidget6resizeEii': C:\Code\QT\untitled2-build-Desktop_Qt_5_0_0_MSVC2010_32bit_SDK-Debug/../../../Qt/Qt5.0.0/5.0.0/msvc2010/include/QtWidgets/qwidget.h:820: undefined reference to_imp___ZN7QWidget6resizeERK5QSize'
    debug/mainwindow.o: In function `ZN13Ui_MainWindow7setupUiEP11QMainWindow':

    C:\Code\QT\untitled2-build-Desktop_Qt_5_0_0_MSVC2010_32bit_SDK-Debug/./ui_mainwindow.h:48: undefined reference to _imp___ZN10QStatusBarC1EP7QWidget' C:\Code\QT\untitled2-build-Desktop_Qt_5_0_0_MSVC2010_32bit_SDK-Debug/./ui_mainwindow.h:49: undefined reference to_imp___ZN7QObject13setObjectNameERK7QString'
    C:\Code\QT\untitled2-build-Desktop_Qt_5_0_0_MSVC2010_32bit_SDK-Debug/./ui_mainwindow.h:50: undefined reference to _imp___ZN11QMainWindow12setStatusBarEP10QStatusBar' C:\Code\QT\untitled2-build-Desktop_Qt_5_0_0_MSVC2010_32bit_SDK-Debug/./ui_mainwindow.h:54: undefined reference to_imp___ZN11QMetaObject18connectSlotsByNameEP7QObject'
    debug/mainwindow.o: In function ZN13Ui_MainWindow13retranslateUiEP11QMainWindow': C:\Code\QT\untitled2-build-Desktop_Qt_5_0_0_MSVC2010_32bit_SDK-Debug/./ui_mainwindow.h:59: undefined reference to_imp___ZN16QCoreApplication9translateEPKcS1_S1_i'
    C:\Code\QT\untitled2-build-Desktop_Qt_5_0_0_MSVC2010_32bit_SDK-Debug/./ui_mainwindow.h:59: undefined reference to _imp___ZN7QWidget14setWindowTitleERK7QString' debug/mainwindow.o: In functionZN15QTypedArrayDataItE10deallocateEP10QArrayData':
    C:\Code\QT\untitled2-build-Desktop_Qt_5_0_0_MSVC2010_32bit_SDK-Debug/../../../Qt/Qt5.0.0/5.0.0/msvc2010/include/QtCore/qarraydata.h:232: undefined reference to _imp___ZN10QArrayData10deallocateEPS_jj' debug/moc_mainwindow.o: In functionZNK10MainWindow10metaObjectEv':
    C:\Code\QT\untitled2-build-Desktop_Qt_5_0_0_MSVC2010_32bit_SDK-Debug/debug/moc_mainwindow.cpp:71: undefined reference to _imp___ZNK11QObjectData17dynamicMetaObjectEv' debug/moc_mainwindow.o: In functionZN10MainWindow11qt_metacastEPKc':
    C:\Code\QT\untitled2-build-Desktop_Qt_5_0_0_MSVC2010_32bit_SDK-Debug/debug/moc_mainwindow.cpp:79: undefined reference to _imp___ZN11QMainWindow11qt_metacastEPKc' debug/moc_mainwindow.o: In functionZN10MainWindow11qt_metacallEN11QMetaObject4CallEiPPv':
    C:\Code\QT\untitled2-build-Desktop_Qt_5_0_0_MSVC2010_32bit_SDK-Debug/debug/moc_mainwindow.cpp:84: undefined reference to _imp___ZN11QMainWindow11qt_metacallEN11QMetaObject4CallEiPPv' debug/moc_mainwindow.o: In function_static_initialization_and_destruction_0':
    C:\Code\QT\untitled2-build-Desktop_Qt_5_0_0_MSVC2010_32bit_SDK-Debug/debug/moc_mainwindow.cpp:66: undefined reference to _imp___ZN11QMainWindow16staticMetaObjectE' debug/moc_mainwindow.o: In functionZNK14QScopedPointerI11QObjectData21QScopedPointerDeleterIS0_EEptEv':
    C:\Code\QT\untitled2-build-Desktop_Qt_5_0_0_MSVC2010_32bit_SDK-Debug/../../../Qt/Qt5.0.0/5.0.0/msvc2010/include/QtCore/qscopedpointer.h:111: undefined reference to `_imp___Z9qt_assertPKcS0_i'
    collect2: ld returned 1 exit status
    11:52:05: The process "C:\MinGW\bin\mingw32-make.exe" exited with code 2.
    Error while building/deploying project untitled2 (kit: Desktop Qt 5.0.0 MSVC2010 32bit (SDK))
    When executing step 'Make'



  • The problem is mingw version I have installed. I have the latest version installed and it seems 4.4 is needed. Unfortunately I'm not able to find it. Anyone have a link that works? There seems to be alot of work needed to make this IDE work. What have steps have you guys taken to get this working???


  • Moderators

    Mingw is not compatible with MSVC2010, so creator will complain loudly when you try to build code with mingw and then try to link with a msvc 2010 library.

    Either build Qt 5 with mingw yourself or install MSVC2010 and work with the library you have installed already.



  • Tobias, Yes lessen learned on that. I was hopping that I could 'add' a new compiler but....

    I have now installed the correct version of Qt and everything works great. I will add the quest taken trying to find minGW4.4 was long one. I'm surprised Qt-project doesn't host it. I would of compiled it using minGW4.7 but I wasn't sure if it would of worked.

    Thank you for your reply.


Log in to reply