iiHeppa
unread,Oct 20, 2008, 12:46:13 PM10/20/08Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Google C++ Testing Framework
Hi, I'm a beginner in C++ and Visual Studio.
I have a problem wirh a simple test file:
#include <gtest/gtest.h>
TEST(Test, One) {
EXPECT_EQ(2, 1+1);
}
int main(int argc, char **argv) {
testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
I get the following error: I tried to link with the lib files in msvc/
debug I build with Visual studio
(sorry for the german text, but I think the problem is clear)
------ Erstellen gestartet: Projekt: googleTest, Konfiguration: Debug
Win32 ------
Kompilieren...
googleTest.cc
Verknüpfen...
googleTest.obj : error LNK2019: Verweis auf nicht aufgelöstes externes
Symbol ""public: void __thiscall
testing::internal::AssertHelper::operator=(class testing::Message
const &)const " (??
4AssertHelper@internal@testing@@QBEXABVMessage@2@@Z)" in Funktion
""private: virtual void __thiscall Test_One_Test::TestBody(void)" (?
TestBody@Test_One_Test@@EAEXXZ)".
googleTest.obj : error LNK2019: Verweis auf nicht aufgelöstes externes
Symbol ""public: __thiscall
testing::internal::AssertHelper::AssertHelper(enum
testing::TestPartResultType,char const *,int,char const *)" (??
0AssertHelper@internal@testing@@QAE@W4TestPartResultType@2@PBDH1@Z)"
in Funktion ""private: virtual void __thiscall
Test_One_Test::TestBody(void)" (?TestBody@Test_One_Test@@EAEXXZ)".
googleTest.obj : error LNK2019: Verweis auf nicht aufgelöstes externes
Symbol ""public: int __thiscall testing::UnitTest::Run(void)" (?
Run@UnitTest@testing@@QAEHXZ)" in Funktion "_main".
googleTest.obj : error LNK2019: Verweis auf nicht aufgelöstes externes
Symbol ""public: static class testing::UnitTest * __cdecl
testing::UnitTest::GetInstance(void)" (?
GetInstance@UnitTest@testing@@SAPAV12@XZ)" in Funktion "_main".
googleTest.obj : error LNK2019: Verweis auf nicht aufgelöstes externes
Symbol ""void __cdecl testing::InitGoogleTest(int *,char * *)" (?
InitGoogleTest@testing@@YAXPAHPAPAD@Z)" in Funktion "_main".
googleTest.obj : error LNK2019: Verweis auf nicht aufgelöstes externes
Symbol ""class testing::AssertionResult __cdecl
testing::internal::EqFailure(char const *,char const *,class
testing::internal::String const &,class testing::internal::String
const &,bool)" (?EqFailure@internal@testing@@YA?
AVAssertionResult@2@PBD0ABVString@12@1_N@Z)" in Funktion ""class
testing::AssertionResult __cdecl
testing::internal::CmpHelperEQ<int,int>(char const *,char const *,int
const &,int const &)" (??$CmpHelperEQ@HH@internal@testing@@YA?
AVAssertionResult@1@PBD0ABH1@Z)".
googleTest.obj : error LNK2019: Verweis auf nicht aufgelöstes externes
Symbol ""class testing::AssertionResult __cdecl
testing::AssertionSuccess(void)" (?AssertionSuccess@testing@@YA?
AVAssertionResult@1@XZ)" in Funktion ""class testing::AssertionResult
__cdecl testing::internal::CmpHelperEQ<int,int>(char const *,char
const *,int const &,int const &)" (??
$CmpHelperEQ@HH@internal@testing@@YA?AVAssertionResult@1@PBD0ABH1@Z)".
googleTest.obj : error LNK2019: Verweis auf nicht aufgelöstes externes
Symbol ""class testing::internal::String __cdecl
testing::internal::StrStreamToString(class
std::basic_stringstream<char,struct std::char_traits<char>,class
std::allocator<char> > *)" (?StrStreamToString@internal@testing@@YA?
AVString@12@PAV?$basic_stringstream@DU?$char_traits@D@std@@V?
$allocator@D@2@@std@@@Z)" in Funktion ""public: class
testing::internal::String __thiscall
testing::Message::GetString(void)const " (?
GetString@Message@testing@@QBE?AVString@internal@2@XZ)".
googleTest.obj : error LNK2019: Verweis auf nicht aufgelöstes externes
Symbol ""class testing::TestInfo * __cdecl
testing::internal::MakeAndRegisterTestInfo(char const *,char const
*,char const *,char const *,void *,void (__cdecl*)(void),void
(__cdecl*)(void),class testing::internal::TestFactoryBase *)" (?
MakeAndRegisterTestInfo@internal@testing@@YAPAVTestInfo@2@PBD000PAXP6AXXZ2PAVTestFactoryBase@12@@Z)"
in Funktion ""void __cdecl `dynamic initializer for 'private: static
class testing::TestInfo * Test_One_Test::test_info_''(void)" (??__E?
test_info_@Test_One_Test@@0QAVTestInfo@testing@@A@@YAXXZ)".
googleTest.obj : error LNK2019: Verweis auf nicht aufgelöstes externes
Symbol ""protected: __thiscall testing::Test::Test(void)" (??
0Test@testing@@IAE@XZ)" in Funktion ""public: __thiscall
Test_One_Test::Test_One_Test(void)" (??0Test_One_Test@@QAE@XZ)".
googleTest.obj : error LNK2001: Nicht aufgelöstes externes Symbol
""protected: virtual void __thiscall testing::Test::SetUp(void)" (?
SetUp@Test@testing@@MAEXXZ)".
googleTest.obj : error LNK2001: Nicht aufgelöstes externes Symbol
""protected: virtual void __thiscall testing::Test::TearDown(void)" (?
TearDown@Test@testing@@MAEXXZ)".
googleTest.obj : error LNK2019: Verweis auf nicht aufgelöstes externes
Symbol ""public: virtual __thiscall testing::Test::~Test(void)" (??
1Test@testing@@UAE@XZ)" in Funktion ""public: virtual __thiscall
Test_One_Test::~Test_One_Test(void)" (??1Test_One_Test@@UAE@XZ)".
C:\Dokumente und Einstellungen\Matthias Heppner\Eigene Dateien\Visual
Studio 2005\Projects\googleTest\Debug\googleTest.exe : fatal error
LNK1120: 13 nicht aufgelöste externe Verweise.
Das Buildprotokoll wurde unter "file://c:\Dokumente und Einstellungen
\Matthias Heppner\Eigene Dateien\Visual Studio 2005\Projects\googleTest
\googleTest\Debug\BuildLog.htm" gespeichert.
googleTest - 14 Fehler, 0 Warnung(en)