qttest problem: unresolved external symbol

Alles rund um die Programmierung mit Qt
Antworten
adonay
Beiträge: 2
Registriert: 11. April 2007 03:52

qttest problem: unresolved external symbol

Beitrag von adonay »

war heute positiv überrascht zu bemerken dass qt auch eine testlib zur verfügung stellt nur krieg ich sie irgendwie nicht zu laufen, QVERIFY und QCOMPARE haben bei mir probleme. ich habe versucht das testbeispiel von QT zu kompilieren (einmal mit nmake (msvc 2005) und mit mingw32) und es bringt immer Fehlermeldungen:

bei compare:
main.obj : error LNK2019: unresolved external symbol "bool __cdecl QTest::compare_helper(bool,char const *,char *,char *,char const *,char const *,char const *,int)" (?compare_helper@QTest@@YA_N_NPBDPAD2111H@Z) referenced in function "bool __cdecl QTest::qCompare<class QString>(class QString const &,class QString const &,char const *,char const *,char const *,int)" (??$qCompare@VQString@@@QTest@@YA_NABVQString@@0PBD11H@Z)

main.obj : error LNK2019: unresolved external symbol "bool __cdecl QTest::compare_helper(bool,char const *,char const *,int)" (?compare_helper@QTest@@YA_N_NPBD1H@Z) referenced in function "bool __cdecl QTest::qCompare<class QString>(class QString const &,class QString const &,char const *,char const *,char const *,int)" (??$qCompare@VQString@@@QTest@@YA_NABVQString@@0PBD11H@Z)
bzw bei qverify:
main.obj : error LNK2019: unresolved external symbol "bool __cdecl QTest::qVerify(bool,char const *,char const *,char const *,int)" (?qVerify@QTest@@YA_N_NPBD11H@Z) referenced in function "private: void __thiscall TestQString::toUpper(void)" (?toUpper@TestQString@@AAEXXZ)
hier der verwendete code:

Code: Alles auswählen

/****************************************************************************
**
** Copyright (C) 2005-2006 Trolltech ASA. All rights reserved.
**
** This file is part of the documentation of the Qt Toolkit.
**
** This file may be used under the terms of the GNU General Public
** License version 2.0 as published by the Free Software Foundation
** and appearing in the file LICENSE.GPL included in the packaging of
** this file.  Please review the following information to ensure GNU
** General Public Licensing requirements will be met:
** http://www.trolltech.com/products/qt/opensource.html
**
** If you are unsure which license is appropriate for your use, please
** review the following information:
** http://www.trolltech.com/products/qt/licensing.html or contact the
** sales department at sales@trolltech.com.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
****************************************************************************/

#include <QtTest/QtTest>

class TestQString: public QObject
{
	Q_OBJECT
		private slots:
			void toUpper();
};

void TestQString::toUpper()
{
	QString str = "Hello";
	QVERIFY(str.toUpper() == QString("HELLO"));
}
Christian81
Beiträge: 7319
Registriert: 26. August 2004 14:11
Wohnort: Bremen
Kontaktdaten:

Beitrag von Christian81 »

Und wie sieht deine pro.-Datei aus? Linkst du auch gegen qttest?
MfG Christian

'Funktioniert nicht' ist keine Fehlerbeschreibung
adonay
Beiträge: 2
Registriert: 11. April 2007 03:52

Beitrag von adonay »

jo mach ich natürlich.. habs jetzt unter ubuntu zum laufen bekommen, is also nicht sooooo schlimm, aber n bischen ärgerlich is es schon
Antworten