abc123
unread,Jan 30, 2012, 9:09:43 PM1/30/12Sign 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, sdf...@gmail.com
Hello,
I get the unresolved external symbol errors shown below when I try to
build a simple C++ project with one Google Test statement:
EXPECT_EQ(1, 1); The machine has Windows Vista Home Premium SP2 64
bit and Microsoft Visual Studio 2010 Premium. The build environment is
latest version of Eclipse C++ Development Tools (CDT) installed within
latest version of Eclipse Java IDE (Indigo). I also tried building a
similar project directly in Microsoft Visual Studio 2010 Premium with
similar results.
Google Test 1.6.0 was built using Microsoft Visual Studio 2010 Premium
(gtest Debug, gtest Release, gtest-md Debug, gtest-md Release) at C:
\gtest-1.6.0.
In Eclipse, toolchain (compiler) is Microsoft Visual C++. C++
Compiler (cl) Code Generation Run-time Library is Multi-Threaded DLL
Debug (/MDd). C++ Compiler (cl) Preprocessor Include Path (/I) is "C:
\gtest-1.6.0\include", C:\gtest-1.6.0\include\gtest" and C:
\gtest-1.6.0\include\gtest\internal". C++ Compiler (cl) Miscellaneous
is set to -DGTEST_LINKED_AS_SHARED_LIBRARY=1. Linker (link) Libraries
set to "C:\gtest-1.6.0\msvc\gtest-md\Debug\gtestd.lib" and "C:
\gtest-1.6.0\msvc\gtest-md\Debug\gtest_main-mdd.lib".
I have read the Google Test README, Google Test 1.6.0 Primer and the
unresolved external symbol posts in this group.
Eclipse build errors:
**** Build of configuration Debug for project HelloWorldSF110MS ****
**** Internal Builder is used for build ****
cl /c /EHs /MDd /Zi /IC:\gtest-1.6.0\include /IC:\gtest-1.6.0\include
\gtest /IC:\gtest-1.6.0\include\gtest\internal /nologo -
DGTEST_LINKED_AS_SHARED_LIBRARY=1 /Fosrc\HelloWorldSF110MS.obj ..\src
\HelloWorldSF110MS.cpp
HelloWorldSF110MS.cpp
link /debug /nologo /OUT:HelloWorldSF110MS.exe src
\HelloWorldSF110MS.obj C:\gtest-1.6.0\msvc\gtest-md\Debug\gtestd.lib C:
\gtest-1.6.0\msvc\gtest-md\Debug\gtest_main-mdd.lib
HelloWorldSF110MS.obj : error LNK2019: unresolved external symbol
"__declspec(dllimport) public: __thiscall
testing::AssertionResult::~AssertionResult(void)" (__imp_??
1AssertionResult@testing@@QAE@XZ) referenced in function _main
HelloWorldSF110MS.obj : error LNK2019: unresolved external symbol
"__declspec(dllimport) public: __thiscall
testing::Message::~Message(void)" (__imp_??1Message@testing@@QAE@XZ)
referenced in function _main
HelloWorldSF110MS.obj : error LNK2019: unresolved external symbol
"__declspec(dllimport) public: __thiscall
testing::internal::AssertHelper::~AssertHelper(void)" (__imp_??
1AssertHelper@internal@testing@@QAE@XZ) referenced in function _main
HelloWorldSF110MS.obj : error LNK2019: unresolved external symbol
"__declspec(dllimport) public: void __thiscall
testing::internal::AssertHelper::operator=(class testing::Message
const &)const " (__imp_??
4AssertHelper@internal@testing@@QBEXABVMessage@2@@Z) referenced in
function _main
HelloWorldSF110MS.obj : error LNK2019: unresolved external symbol
"__declspec(dllimport) public: __thiscall
testing::internal::AssertHelper::AssertHelper(enum
testing::TestPartResult::Type,char const *,int,char const *)" (__imp_??
0AssertHelper@internal@testing@@QAE@W4Type@TestPartResult@2@PBDH1@Z)
referenced in function _main
HelloWorldSF110MS.obj : error LNK2019: unresolved external symbol
"__declspec(dllimport) public: char const * __thiscall
testing::AssertionResult::failure_message(void)const " (__imp_?
failure_message@AssertionResult@testing@@QBEPBDXZ) referenced in
function _main
HelloWorldSF110MS.obj : error LNK2019: unresolved external symbol
"__declspec(dllimport) public: __thiscall
testing::Message::Message(void)" (__imp_??0Message@testing@@QAE@XZ)
referenced in function _main
HelloWorldSF110MS.obj : error LNK2019: unresolved external symbol
"__declspec(dllimport) public: __thiscall
testing::AssertionResult::operator bool(void)const " (__imp_??
BAssertionResult@testing@@QBE_NXZ) referenced in function _main
HelloWorldSF110MS.obj : error LNK2019: unresolved external symbol
"__declspec(dllimport) public: __thiscall
testing::internal::String::~String(void)" (__imp_??
1String@internal@testing@@QAE@XZ) referenced in function "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)
HelloWorldSF110MS.obj : error LNK2019: unresolved external symbol
"__declspec(dllimport) class testing::AssertionResult __cdecl
testing::internal::EqFailure(char const *,char const *,class
testing::internal::String const &,class testing::internal::String
const &,bool)" (__imp_?EqFailure@internal@testing@@YA?
AVAssertionResult@2@PBD0ABVString@12@1_N@Z) referenced in function
"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)
HelloWorldSF110MS.obj : error LNK2019: unresolved external symbol
"__declspec(dllimport) class testing::AssertionResult __cdecl
testing::AssertionSuccess(void)" (__imp_?AssertionSuccess@testing@@YA?
AVAssertionResult@1@XZ) referenced in function "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)
HelloWorldSF110MS.obj : error LNK2019: unresolved external symbol
"__declspec(dllimport) public: __thiscall
testing::internal::String::String(class std::basic_string<char,struct
std::char_traits<char>,class std::allocator<char> > const &)" (__imp_??
0String@internal@testing@@QAE@ABV?$basic_string@DU?
$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) referenced in function
"class testing::internal::String __cdecl
testing::internal::FormatForComparisonFailureMessage<int,int>(int
const &,int const &)" (??
$FormatForComparisonFailureMessage@HH@internal@testing@@YA?
AVString@01@ABH0@Z)
HelloWorldSF110MS.exe : fatal error LNK1120: 12 unresolved externals
Build error occurred, build is stopped
Thanks, Steve