Building Qt for Visual Studio 2010 - Cannot open the file "qtmaind.lib"

I am trying to run a C ++ Qt application and run it and compile in Visual Studio 2010.

After doing a few searches, I found that there is a Qt Visual Studio add-in, and so I installed it. I already have the MinGW Qt binary installed, and when that didn’t work, I found that you need to compile the source code for Visual Studio 2010 (the VS 2008 binary will lead to deployment problems).

Using this as a guide: How to create Qt for Visual Studio 2010 , I compiled the open source version and added it to the PATH along with the QTDIR env variable. Hoping that I finally worked, I created a “Qt application” using the Create Project Wizard in Visual Studio 2010. After I finished, I tried to create 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 qtmaind.prl, but I don’t know why there is no qtmaind.lib.

I can repeat the QMAKESPEC environment variable to get the output "win32-msvc2010".

I tried several different flag combinations for the configuration step, including the one in the link, and even tried to manually set the platform flag.

If anyone can offer any help, he would appreciate it !: D

+4
source share
4 answers

Just stumbled upon the same problem. I changed the "-release" flag from the related manual to "-debug-and-release", and then he built the qtmaind.lib library (presumably the suffix "d" means debugging).

+6
source

I ran into this problem when starting a project whose settings were hard-coded for a specific computer installation.

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

I could not find this lib file on my machine. I replaced the line as follows: C: \ Qt \ 4.7.3 \ Lib \ Qtmaind.lib

It looks like the library file names are different in the Qt versions. Or perhaps the library files have been renamed.

In addition, “d” means debugging. If you cannot find any lib file installed by default '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. My name was Projects.sln. You can open it in notepad and see if there are win32-debug configurations.

+1
source

This may be a QMAKESPEC problem. Try setting the QMAKESPEC environment QMAKESPEC to

 win32-msvc2010 

and rebuild Qt like this. This should provide you with .lib files in the Qt folder

0
source

in QT 5.3 since vs 2013

in properties -> linker -> input

remove ANY path for qt libraries like qtmaind.lib

it is known bug

-1
source

All Articles