View Full Version : Compilation Error LNK2019 on QTest::qSleep

31st January 2013, 14:58
Hello, I overwrite an Qt 4.8.4 example in MSVC2010, and add <QtTest/QTest> to invoke QTest::qSleep()
The necessary lib and dll are also added in MSVC project, it works fine.

However, LNK2019 of QTest::qSleep() happens in Qt Creator.
Even I modify pro file
Qt += core gui test

LNK2019 still happens. Can you help to solve the problem ? thanks.

1st February 2013, 01:39
Are you using the Qt add-in for Visual Studio? If you used it to convert the .pro file into a .vcproj file, then if you modify the .pro file, you need to create the .vcproj file again.

1st February 2013, 03:40
I don't know Qt add-in for Visual Studio before. I will try it. Thanks

But my problem is that in VS QTest::sleap() is ok, however in Qt creator LNK2019 happens.

Added after 1 27 minutes:

Thank d_stranz. Qt add-in is useful.
I should not modify pro or vcproj manually without Qt add-in.

1st February 2013, 04:21
The Qt add-in is very useful. You can import .pro files and create .vcproj files; you can also export .vcproj files and create .pro files so you can use both VS and Qt Creator if you want. The Qt add-in also has some very nice "wizards" to create new projects and classes.