[Interest] Qt5.5, VS2013 chain, compile warnings and linking errors

Jason Kretzer Jason at gocodigo.com
Thu Sep 17 23:59:57 CEST 2015


I did a complete uninstall and reinstall (Virtual Machine so it is easy) and started with a clean Win8.1.  I first installed all windows updates.  I then installed VS2013 followed by SP5.  Next, I installed the Qt 5.5.0 32bit for VS2013.

I opened the project again -- with empty Release/debug build folders.  From the.pro, I removed the INCLUDEPATH and LIBS entries:

INCLUDEPATH += "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Include"
LIBS += -L"C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Lib" -ladvapi32 -luser32

I then manually ran CLEAN, QMAKE, Rebuild.

I still receive the exact same link errors:

------------------
main.obj:-1: error: LNK2019: unresolved external symbol __imp__SystemParametersInfoW at 16 referenced in function "void __cdecl suppressAnimations(void)" (?suppressAnimations@@YAXXZ)

backgroundtaskmanager.obj:-1: error: LNK2019: unresolved external symbol __imp__SendMessageW at 16 referenced in function "private: int __thiscall BackgroundTaskManager::changeMonitorState(bool)" (?changeMonitorState at BackgroundTaskManager@@AAEH_N at Z)
------------------

I have read in a number of different forums that what you say -- VS2013 should find this without my entries in the .pro -- but I am not certain HOW.  

Above is my exact configuration at this point.  

Thoughts?

-Jason

-----Original Message-----
From: Sze Howe Koh [mailto:szehowe.koh at gmail.com] 
Sent: Tuesday, September 15, 2015 7:56 PM
To: Jason Kretzer
Cc: Koehne Kai; Gunnar Roth; interest at qt-project.org
Subject: Re: [Interest] Qt5.5, VS2013 chain, compile warnings and linking errors

On 15 September 2015 at 20:32, Jason Kretzer <Jason at gocodigo.com> wrote:
>
>
> -----Original Message-----
> From: Koehne Kai [mailto:Kai.Koehne at theqtcompany.com]
> Sent: Tuesday, September 15, 2015 4:36 AM
> To: Gunnar Roth; Jason Kretzer
> Cc: interest at qt-project.org
> Subject: RE: [Interest] Qt5.5, VS2013 chain, compile warnings and 
> linking errors
>
>
>> -----Original Message-----
>> [mailto:interest-bounces+kai.koehne=theqtcompany.com at qt-project.org]
>> On Behalf Of Gunnar Roth
>> Subject: Re: [Interest] Qt5.5, VS2013 chain, compile warnings and 
>> linking errors
>>
>> I hardy believe Windows v7.1A sdk is going to work with VS2013.
>
> If you want to target XP with MSVC 2013 you need to use the headers/libs from Windows v7.1A. So yes, this is a supported setup.
>
> Regards
>
> Kai
>
>
> If I wanted to target windows 8.1, where would they be located?  I have installed the Windows 8 SDK and the Windows 10 SDK, but neither provided the winuser.h or the user32.lib files -- that I could tell.

If you want to target Windows 8.1, then you only need MSVC 2013. You do not need the Windows v7.1 SDK.

The fact that you need to manually add INCLUDEPATH and LIBS means that something has gone wrong with your setup. You should not need these.

I recommend you:
1. Uninstall your copy of the Windows SDK.
2. Remove INCLUDEPATH and LIBS from your .pro file; let Qt Creator find the correct libraries automatically.
3. Clean your project.
4. Run qmake manually.
5. Build your project.


To hunt for clues, look for error messages and warnings in the following places:
* Qt Creator -> Tools -> Options -> Build & Run -> Kits
* Qt Creator -> Tools -> Options -> Build & Run -> Compilers


If you still have no luck, uninstall and reinstall MSVC 2013. Also, make sure your copy of MSVC 2013 is fully updated. (The current release is Update 5, although I have been using Visual Studio Express
2013 Update 3 for many months now with no problems). Then, repeat steps #3 - #5.


Regards,
Sze-Howe


More information about the Interest mailing list