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

Link error when compiling Qt 5.1.0 project in Visual Studio 2010



  • Hi,

    A while ago i upgraded from Qt 4.x to 5.1.0. I then got a new computer (Windows 7, 64 bit) on which i installed a clean 5.1.0. But i have never been able to successfully compile my project with 5.1.0. Now i've come back to the project to try again, and it all seems to be compiling ok, but when it gets to linking it says it cannot find "qtmaind.lib":

    @2>------ Rebuild All started: Project: Window Detective, Configuration: Debug Win32 ------
    2>Build started 2/01/2014 1:05:13 PM.
    2>_PrepareForClean:
    2> Deleting file "Debug\obj\Window Detective.lastbuildstate".
    2>InitializeBuildStatus:
    2> Touching "Debug\obj\Window Detective.unsuccessfulbuild".
    2>CustomBuild:
    2> Moc'ing ...
    ...
    2> Rcc'ing qt_resources.qrc...
    2>ClCompile:
    2> Window.cpp
    ...
    2> Generating Code...
    2>LINK : fatal error LNK1104: cannot open file 'qtmaind.lib'
    2>
    2>Build FAILED.
    2>
    2>Time Elapsed 00:07:50.17
    ========== Rebuild All: 1 succeeded, 1 failed, 0 skipped ==========@
    I have installed Qt to "C:\dev\Qt". I have the Qt Visual Studio addon, which i think should set the QtDir variable itself, and the project's library directories is set to "$(QtDir)\lib;$(LibraryPath)". I've also added "qtmaind.lib" to the list of additional dependencies.

    Below is the linker command line:
    @/OUT:"C:\dev\projects\Window Detective\src..\Window Detective.exe" /VERBOSE /NOLOGO "Psapi.lib" "qtmaind.lib" "Qt5Cored.lib" "Qt5Guid.lib" "Qt5Widgetsd.lib" "Qt5Xmld.lib" "kernel32.lib" "user32.lib" "gdi32.lib" "winspool.lib" "comdlg32.lib" "advapi32.lib" "shell32.lib" "ole32.lib" "oleaut32.lib" "uuid.lib" "odbc32.lib" "odbccp32.lib" "C:\dev\projects\Window Detective\src\hook\Debug\WD_Hook.lib" /MANIFEST /ManifestFile:"Debug\obj\Window Detective.exe.intermediate.manifest" /ALLOWISOLATION /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DEBUG /PDB:"C:\dev\projects\Window Detective\src\Debug\Window Detective.pdb" /SUBSYSTEM:WINDOWS /PGD:"C:\dev\projects\Window Detective\Window Detective.pgd" /TLBID:1 /DYNAMICBASE /NXCOMPAT /MACHINE:X86 /ERRORREPORT:QUEUE@
    As you can see, the library is mentioned there, and it definitely exists on disk, so i cannot see why the linker cannot find it.



  • After reading some similar posts, i thought i might need to build Qt. I'm looking at "Installing Qt for Windows":http://qt-project.org/doc/qt-5.1/qtdoc/install-win.html, but i'm not quite sure what options i want and where to install it to.
    I already have Qt "installed" at C:\dev\Qt, where i see the following directory structure:
    C:\dev\Qt
    ----5.1.0
    --------msvc2010_opengl
    ------------bin
    ------------doc
    ------------examples
    ------------imports
    ------------include
    ------------lib
    ------------mkspecs
    ------------phrasebooks
    ------------plugins
    ------------qml
    ------------translations
    --------src
    ------------qtactiveqt
    ------------qtbase
    ------------qtdeclarative
    ------------qtdoc
    ------------qtgraphicaleffects
    ------------qtimageformats
    ------------...
    ----Licenses
    ----Tools
    ----vcredist
    ----VSAddin

    So if i ran "configure.exe", would i need to specify "C:\dev\Qt\5.1.0\msvc2010_opengl" as the location, or just "C:\dev\Qt\5.1.0" or what?
    I thought i installed the pre-build package, so i don't even know if i need to run configure.



  • hello? anyone?


Log in to reply