QT5 (VisualStudio2012 addin) won't link

  • Hi,

    i just startert working with Qt5 for some university worksheets, and im even stuck before i really started.

    I use VisualStudio2012 Ultimate (latest version update1) with the lates version of the QT addin.

    My Code Compiles fine, but uppon linking i get tons of errors. The first one:
    error LNK2038: Konflikt ermittelt für "_MSC_VER": Der Wert "1600" stimmt nicht mit dem Wert "1700" in bmi.obj überein.@
    (Translated: Conflict detected for....: The Value"1600" is not the same as the Value "1700" in bmi.obj ) (i'm writing a bmi calc so bmi.hpp and bmi.cpp contain my main class)

    After that i get

    @error LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""__declspec(dllimport) public: __thiscall QWidget::QWidget(class QWidget *,class QFlags<enum Qt::WindowType>)" (_imp??0QWidget@@QAE@PAV0@V?$QFlags@W4WindowType@Qt@@@@@Z)" in Funktion ""public: __thiscall BMI::BMI(void)" (??0BMI@@QAE@XZ)".

    error LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""__declspec(dllimport) public: virtual __thiscall QWidget::~QWidget(void)" (_imp??1QWidget@@UAE@XZ)" in Funktion "__unwindfunclet$??0BMI@@QAE@XZ$0".

    (Both are the same error message, which translates to: "Reference to unresolved extern symbol", there are way more of those errors, pasting them all would be quite pointless i think)

    and after that lots and lots of:

    @error LNK2001: Nicht aufgelöstes externes Symbol ""protected: virtual void __thiscall QWidget::actionEvent(class QActionEvent *)" (?actionEvent@QWidget@@MAEXPAVQActionEvent@@@Z)".

    error LNK2001: Nicht aufgelöstes externes Symbol ""protected: virtual void __thiscall QAbstractSlider::changeEvent(class QEvent *)" (?changeEvent@QAbstractSlider@@MAEXPAVQEvent@@@Z)".

    which translates to: Unresolved extern symbol

    if you need the code just say it, but i think i did somethign wrong on setting everything up and not with the code itself.

  • Are you linking to the QtWidgets Library?

  • i left all settings unchanged. But that was it for most of the errors(checked the boxes under "Qt project Settings. Thougth that would all be done automatically).

    Only error left is the first one :/

    and that's a fatal one, so no final building :/

  • Do you have vs2010 and vs2012 installed?

    In Project Properties, select General Tab, and check to see what "Platform Toolset" is set to.

  • nope, just vs2012.

    platfoorm toolset for the project says Visual Studio 2012 (v110), and i have only one other option (v110_xp)

  • Well the variable _MSC_VER holds the compilers version number. 1600 is for vs2010 and 1700 is for vs2012.

    "MSDN _MSC_VER definition":http://msdn.microsoft.com/en-us/library/b0084kay.aspx

    "This might help some...":http://stackoverflow.com/questions/4061929/help-with-linker-error-lnk2038

    Also, the install for the Qt libraries is compiled for 2010 not 2012.

  • So, did you rebuild the Qt using 2012?

  • so basically there is an addin for vs2012 but vs2012 itself is not supported -.-

    i guess the easiest solution would be installing vs2010? is the express version enough as it should bring everything compilerrelated with it?

    e: nope, and i have no idea how i would do that. i think i remember seeing a tutorial for that yesterday (even though i can't find it now) but i think there where quite some needed tools and i really don't wanna mess up my whole system with compilers and stuff for one use...

  • You can download the source and build qt with vs2012. Vs2012 is supported, you just have to build it yourself.

  • well, i will see if i can do that.

  • If this is a one time use, might just be easier to use Qt creator instead.

  • qt creator does not want my vs2012 compiler as well.. i tried mingw, didn't work out as well. (no compiler found, even if the correct kit is selected).

    guess i would have to use 4.8 with minggw for that. but i try compiling it, i guess i migth be using qt even after those university exercises^^ always wanted to get into gui programming and not only cmd programms...

  • so, i build qt5 (i think succesfully as i had no errors)
    but again, another linker error that says:

    "Qt5Guid5.lib cannot ne opened". and well in the path where it trys to open this file it doesn't exist. There is one Qt5Gui.lib and a Qt5Guid.lib bot no Qt5Guid5.lib...

    the path is: C:\qt-source\qt5\qtbase\lib\Qt5Guid5.lib and the q path is set to the qtbase folder.

    e: found the bug report... i guess i can just change that in the linker settings.

    e2: yep, working as it should :)

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.