Building Qt for Visual Studio 2010 - cannot open file 'qtmaind.lib'

12,785

Solution 1

Just ran across this same problem. I changed the "-release" flag from the linked guide to "-debug-and-release", and then it built the qtmaind.lib library (presumably, that "d" suffix stands for debug).

Solution 2

I encountered this issue when running a project whose settings were hardcoded for a particular machine setup.

I could see that the vcxproj file had something like: C:\Qt\4.8.1\libqtmaind.lib

I could not find this lib file in my machine. I replaced the line by: C:\Qt\4.7.3\lib\Qtmaind.lib

It looks like the names of library files are different across Qt versions.Or, maybe the library files were renamed.

Also, the 'd' denoted debug. If you cannot find any lib file post-fixed by 'd', it is likely that you did not 'make' a debug version of Qt. You can cross check this by opening the .Sln file created by configure. Mine was named Projects.sln. You can open this in notepad and see if win32-debug configurations are present.

Share:
12,785
Casey Kuball
Author by

Casey Kuball

Most knowledgeable in: Python C++ C

Updated on June 21, 2022

Comments

  • Casey Kuball
    Casey Kuball almost 2 years

    I'm trying to start a C++ Qt application and have it run and compile in Visual Studio 2010.

    Doing some googling, I found that there was a Visual Studio Qt Add-in, and so I installed this. I already had a MinGW Qt binary installed, and when this did not work, I found that you have to compile the source for Visual Studio 2010 (the VS 2008 binary will cause deployment issues).

    Using this as a guide: How to build Qt for Visual Studio 2010, I compiled the open source version, and added it to the PATH, along with a QTDIR env variable. Hoping that I got it finally working, I created a "Qt Application" using the New Project Wizard in Visual Studio 2010. Once I finished, I tried to build the program, only to see the following error:

    1>LINK : fatal error LNK1104: cannot open file 'qtmaind.lib'
    

    I looked in the C:\QT\lib folder, and found that I only have a qtmaind.prl, but no clue as to why there is no qtmaind.lib.

    I am able to echo the QMAKESPEC environmental variable to get a 'win32-msvc2010' output.

    I've tried several different combinations of flags for the configure step, including the one in the link, and even tried manually setting the -platform flag.

    If anyone can offer any help, it would be greatly appreciated! :D

  • Casey Kuball
    Casey Kuball over 12 years
    Still no qtmaind.lib, even after building. I did see this person had the same issue, though with a different version of visual studio, and using the commercial edition (I'm using the Open Source Edition): stackoverflow.com/questions/1044882/… . It seems he solved it by using something other than that value for the QMAKESPEC environmental variable. I'll also mention that I tried "--platform win32-msvc2010" as an extra flag in a separate build, which also did not work.
  • matsjoyce
    matsjoyce over 9 years
    Could you "flesh out" your answer a bit, such as add a link to a bug report?