Test built with QTestLib complains about missing Qt5Core.dll
-
Hello,
Im new to testing using Qt, therefore i wanted to built a very simple QString test like "here":http://qt-project.org/doc/qt-4.8/qtestlib-tutorial1.html .
Therefore i added a Test_Simple.cpp in a directory MyProject/tests/unit/Test_Simple.cpp with the following content:
@
#include <QtTest/QtTest>class Test_Simple : public QObject
{
Q_OBJECT
public slots:
void test();
};void Test_Simple::test() {
QString str = "hallo";
QVERIFY(str.toUpper() == "HALLO");
}QTEST_MAIN(Test_Simple)
#include "Test_Simple.moc"
@
Then i run (from command line)
@
C:\Qt\5.2.0\mingw48_32\bin\qmake -project "Qt +=testlib"
C:\Qt\5.2.0\mingw48_32\bin\qmake
C:\Qt\Tools\mingw48_32\bin\mingw32_make.exe
@Everything builds fine and it creates a unit.exe in a release directory, but when i try to execute it says "Program could not be started, because Qt5Core.dll is missing.
Do i have to copy the Qt Dlls in a system directory in order to execute the app or can i manually tell him where to search?Of Course everything works if I copy the DLLs into the directory, but that is not very convenient...
Thank you!
Kind Regards!
-
[quote author="dualfaces" date="1387544925"]
Do i have to copy the Qt Dlls in a system directory in order to execute the app or can i manually tell him where to search?
[/quote]
Either way copy the necessary DLLs along with your exe or let it find it by itself by inserting the path containing the DLLs in the PATH environment variable.