Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add user32.lib to QtWidget project in QtCreator

I am a complete beginner to Qt. In a test scenario I need to call a user32 function for some reasons. My small application compiles, but does not link due to the missing user32.lib

Fixing this seemed to be straight forward, add library as shown below. But I cannot proceed to the next step as shown in the screenshot. I have tried almost every library type / setting combination, but the library path always appears in red and I cannot continue. I have even copied the lib on a drive root level in order to avoid any spaces in the path. Any hints?

Remarks:

  1. This question ( Linking to user32.lib in QTCreator ) is a follow up situation after the library had been added this way. This is no duplicate.
  2. Environment QtCreator 2.4.1 Win7
  3. Workaround via LIBS += found below, but why is the dialog permitting me to continue?

Add library in QtCreator

like image 894
Horst Walter Avatar asked Jun 13 '12 20:06

Horst Walter


1 Answers

As of question How to add an external .a library in Qt Creator project via GUI? I have found a working solution (added in .pro file):

win32 {
  LIBS += "P:\Microsoft SDKs\Windows\v7.1\Lib\User32.Lib"
}

However, I am still interested what I am doing wrong with the above dialog?

Remark: Seems to be fixed, see mlvljr's comment below

like image 170
Horst Walter Avatar answered Oct 22 '22 11:10

Horst Walter