Comments (3)
I'm using VS2005. This solution doesn't work for me. After changing to /MD and
/MDd,
got many other linking errors (from gtest color example):
Error 1 error LNK2005: "private: static void __cdecl
std::ios_base::_Ios_base_dtor(class std::ios_base *)" (?
_Ios_base_dtor@ios_base@std@@CAXPAV12@@Z) already defined in
msvcprtd.lib(MSVCP80D.dll) libcpmtd.lib
Error 2 error LNK2005: "public: static void __cdecl
std::ios_base::_Addstd(class std::ios_base *)"
(?_Addstd@ios_base@std@@SAXPAV12@@Z)
already defined in msvcprtd.lib(MSVCP80D.dll) libcpmtd.lib
Error 3 error LNK2005: "private: static class std::locale::_Locimp * __cdecl
std::locale::_Getgloballocale(void)" (?
_Getgloballocale@locale@std@@CAPAV_Locimp@12@XZ) already defined in
msvcprtd.lib(MSVCP80D.dll) libcpmtd.lib
Error 4 error LNK2005: "private: static class std::locale::_Locimp * __cdecl
std::locale::_Init(void)" (?_Init@locale@std@@CAPAV_Locimp@12@XZ) already
defined in
msvcprtd.lib(MSVCP80D.dll) libcpmtd.lib
Error 5 error LNK2005: "private: static void __cdecl
std::locale::facet::facet_Register(class std::locale::facet *)" (?
facet_Register@facet@locale@std@@CAXPAV123@@Z) already defined in
msvcprtd.lib(MSVCP80D.dll) libcpmtd.lib
Error 6 error LNK2005: "public: static void __cdecl
std::_Locinfo::_Locinfo_ctor(class std::_Locinfo *,char const *)" (?
_Locinfo_ctor@_Locinfo@std@@SAXPAV12@PBD@Z) already defined in
msvcprtd.lib(MSVCP80D.dll) libcpmtd.lib
Error 7 error LNK2005: "public: static void __cdecl
std::_Locinfo::_Locinfo_dtor(class std::_Locinfo *)" (?
_Locinfo_dtor@_Locinfo@std@@SAXPAV12@@Z) already defined in
msvcprtd.lib(MSVCP80D.dll) libcpmtd.lib
Error 8 error LNK2005: "void * __cdecl operator new(unsigned int,struct
std::_DebugHeapTag_t const &,char *,int)"
(??2@YAPAXIABU_DebugHeapTag_t@std@@PADH@Z)
already defined in msvcprtd.lib(MSVCP80D.dll) libcpmtd.lib
Error 9 error LNK2005: "void * __cdecl operator new[](unsigned int,struct
std::_DebugHeapTag_t const &,char *,int)"
(??_U@YAPAXIABU_DebugHeapTag_t@std@@PADH@Z)
already defined in msvcprtd.lib(MSVCP80D.dll) libcpmtd.lib
Error 10 error LNK2005: "struct std::_DebugHeapTag_t const & __cdecl
std::_DebugHeapTag_func(void)"
(?_DebugHeapTag_func@std@@YAABU_DebugHeapTag_t@1@XZ)
already defined in msvcprtd.lib(MSVCP80D.dll) libcpmtd.lib
Error 11 error LNK2005: "public: __thiscall std::_Lockit::_Lockit(int)" (??
0_Lockit@std@@QAE@H@Z) already defined in
msvcprtd.lib(MSVCP80D.dll) libcpmtd.lib
Error 12 error LNK2005: "public: __thiscall std::_Lockit::~_Lockit(void)" (??
1_Lockit@std@@QAE@XZ) already defined in
msvcprtd.lib(MSVCP80D.dll) libcpmtd.lib
Error 13 error LNK2005: __configthreadlocale already defined in
MSVCRTD.lib(MSVCR80D.dll) LIBCMTD.lib
Error 14 error LNK2005: _free already defined in MSVCRTD.lib(MSVCR80D.dll)
LIBCMTD.lib
Error 15 error LNK2005: __CrtSetCheckCount already defined in
MSVCRTD.lib(MSVCR80D.dll) LIBCMTD.lib
Error 16 error LNK2005: "public: __thiscall std::exception::exception(void)"
(??0exception@std@@QAE@XZ) already defined in
MSVCRTD.lib(MSVCR80D.dll) LIBCMTD.lib
Error 17 error LNK2005: "public: __thiscall std::exception::exception(char
const * const &)" (??0exception@std@@QAE@ABQBD@Z) already defined in
MSVCRTD.lib(MSVCR80D.dll) LIBCMTD.lib
Error 18 error LNK2005: "public: __thiscall std::exception::exception(class
std::exception const &)" (??0exception@std@@QAE@ABV01@@Z) already defined in
MSVCRTD.lib(MSVCR80D.dll) LIBCMTD.lib
Error 19 error LNK2005: "public: virtual __thiscall
std::exception::~exception(void)" (??1exception@std@@UAE@XZ) already defined in
MSVCRTD.lib(MSVCR80D.dll) LIBCMTD.lib
Error 20 error LNK2005: "public: virtual char const * __thiscall
std::exception::what(void)const " (?what@exception@std@@UBEPBDXZ) already
defined in
MSVCRTD.lib(MSVCR80D.dll) LIBCMTD.lib
Error 21 error LNK2005: "public: __thiscall std::bad_cast::bad_cast(char const
*)" (??0bad_cast@std@@QAE@PBD@Z) already defined in MSVCRTD.lib(MSVCR80D.dll)
LIBCMTD.lib
Error 22 error LNK2005: "public: __thiscall std::bad_cast::bad_cast(class
std::bad_cast const &)" (??0bad_cast@std@@QAE@ABV01@@Z) already defined in
MSVCRTD.lib(MSVCR80D.dll) LIBCMTD.lib
Error 23 error LNK2005: "public: virtual __thiscall
std::bad_cast::~bad_cast(void)" (??1bad_cast@std@@UAE@XZ) already defined in
MSVCRTD.lib(MSVCR80D.dll) LIBCMTD.lib
Error 24 error LNK2005: _localeconv already defined in
MSVCRTD.lib(MSVCR80D.dll) LIBCMTD.lib
Error 25 error LNK2005: __encode_pointer already defined in
MSVCRTD.lib(MSVCR80D.dll) LIBCMTD.lib
Error 26 error LNK2005: __decode_pointer already defined in
MSVCRTD.lib(MSVCR80D.dll) LIBCMTD.lib
Error 27 error LNK2005: __crt_debugger_hook already defined in
MSVCRTD.lib(MSVCR80D.dll) LIBCMTD.lib
Error 28 error LNK2005: _exit already defined in MSVCRTD.lib(MSVCR80D.dll)
LIBCMTD.lib
Error 29 error LNK2005: __exit already defined in MSVCRTD.lib(MSVCR80D.dll)
LIBCMTD.lib
Error 30 error LNK2005: __cexit already defined in MSVCRTD.lib(MSVCR80D.dll)
LIBCMTD.lib
Error 31 error LNK2005: __amsg_exit already defined in
MSVCRTD.lib(MSVCR80D.dll) LIBCMTD.lib
Error 32 error LNK2005: __initterm_e already defined in
MSVCRTD.lib(MSVCR80D.dll) LIBCMTD.lib
Error 33 error LNK2005: __stricmp already defined in MSVCRTD.lib(MSVCR80D.dll)
LIBCMTD.lib
..................................
..................................
Original comment by [email protected]
on 10 Sep 2008 at 4:19
- Added labels: ****
- Removed labels: ****
from googletest.
I think this is fixed in the svn head. Please wait for the next release of
gtest or
check out the svn head revision directly.
Original comment by [email protected]
on 10 Sep 2008 at 6:18
- Changed state: Fixed
- Added labels: ****
- Removed labels: ****
from googletest.
The issue is still there in the 1.6.0 version.
Steps to reproduce:
1. downloaded the googletest 1.6.0 version
2. converted the project to VS2008 and built it
3. build my test project with /MTd, linking to gtestd.lib and gtest_maind.lib
4. got errors:
Linking...
msvcprtd.lib(MSVCP90D.dll) : error LNK2005: "public: __thiscall
std::basic_stringstream<char,struct std::char_traits<char>,class
std::allocator<char> >::basic_stringstream<char,struct
std::char_traits<char>,class std::allocator<char> >(int)"
(??0?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@H@Z)
already defined in gtestd.lib(gtest-all.obj)
msvcprtd.lib(MSVCP90D.dll) : error LNK2005: "public: void __thiscall
std::basic_stringstream<char,struct std::char_traits<char>,class
std::allocator<char> >::`vbase destructor'(void)"
(??_D?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXXZ)
already defined in gtestd.lib(gtest-all.obj)
msvcprtd.lib(MSVCP90D.dll) : error LNK2005: "public: char const * __thiscall
std::basic_string<char,struct std::char_traits<char>,class std::allocator<char>
>::c_str(void)const "
(?c_str@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEPBDXZ)
already defined in gtestd.lib(gtest-all.obj)
msvcprtd.lib(MSVCP90D.dll) : error LNK2005: "public: __thiscall
std::basic_string<char,struct std::char_traits<char>,class std::allocator<char>
>::~basic_string<char,struct std::char_traits<char>,class std::allocator<char>
>(void)"
(??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ)
already defined in gtestd.lib(gtest-all.obj)
msvcprtd.lib(MSVCP90D.dll) : error LNK2005: "public: class std::locale::facet *
__thiscall std::locale::facet::_Decref(void)"
(?_Decref@facet@locale@std@@QAEPAV123@XZ) already defined in
gtestd.lib(gtest-all.obj)
libcpmtd.lib(ios.obj) : error LNK2005: "private: static void __cdecl
std::ios_base::_Ios_base_dtor(class std::ios_base *)"
(?_Ios_base_dtor@ios_base@std@@CAXPAV12@@Z) already defined in
msvcprtd.lib(MSVCP90D.dll)
libcpmtd.lib(ios.obj) : error LNK2005: "public: static void __cdecl
std::ios_base::_Addstd(class std::ios_base *)"
(?_Addstd@ios_base@std@@SAXPAV12@@Z) already defined in
msvcprtd.lib(MSVCP90D.dll)
libcpmtd.lib(locale0.obj) : error LNK2005: "void __cdecl _AtModuleExit(void
(__cdecl*)(void))" (?_AtModuleExit@@YAXP6AXXZ@Z) already defined in
msvcprtd.lib(locale0_implib.obj)
libcpmtd.lib(locale0.obj) : error LNK2005: __Fac_tidy already defined in
msvcprtd.lib(locale0_implib.obj)
libcpmtd.lib(locale0.obj) : error LNK2005: "private: static void __cdecl
std::locale::facet::facet_Register(class std::locale::facet *)"
(?facet_Register@facet@locale@std@@CAXPAV123@@Z) already defined in
msvcprtd.lib(locale0_implib.obj)
libcpmtd.lib(locale0.obj) : error LNK2005: "private: static class
std::locale::_Locimp * __cdecl std::locale::_Getgloballocale(void)"
(?_Getgloballocale@locale@std@@CAPAV_Locimp@12@XZ) already defined in
msvcprtd.lib(MSVCP90D.dll)
libcpmtd.lib(locale0.obj) : error LNK2005: "private: static class
std::locale::_Locimp * __cdecl std::locale::_Init(void)"
(?_Init@locale@std@@CAPAV_Locimp@12@XZ) already defined in
msvcprtd.lib(MSVCP90D.dll)
libcpmtd.lib(locale0.obj) : error LNK2005: "public: static void __cdecl
std::_Locinfo::_Locinfo_ctor(class std::_Locinfo *,class
std::basic_string<char,struct std::char_traits<char>,class std::allocator<char>
> const &)"
(?_Locinfo_ctor@_Locinfo@std@@SAXPAV12@ABV?$basic_string@DU?$char_traits@D@std@@
V?$allocator@D@2@@2@@Z) already defined in msvcprtd.lib(MSVCP90D.dll)
libcpmtd.lib(locale0.obj) : error LNK2005: "public: static void __cdecl
std::_Locinfo::_Locinfo_dtor(class std::_Locinfo *)"
(?_Locinfo_dtor@_Locinfo@std@@SAXPAV12@@Z) already defined in
msvcprtd.lib(MSVCP90D.dll)
libcpmtd.lib(xlock.obj) : error LNK2005: "public: __thiscall
std::_Lockit::_Lockit(int)" (??0_Lockit@std@@QAE@H@Z) already defined in
msvcprtd.lib(MSVCP90D.dll)
libcpmtd.lib(xlock.obj) : error LNK2005: "public: __thiscall
std::_Lockit::~_Lockit(void)" (??1_Lockit@std@@QAE@XZ) already defined in
msvcprtd.lib(MSVCP90D.dll)
LIBCMTD.lib(_file.obj) : error LNK2005: ___iob_func already defined in
MSVCRTD.lib(MSVCR90D.dll)
LIBCMTD.lib(osfinfo.obj) : error LNK2005: __open_osfhandle already defined in
MSVCRTD.lib(MSVCR90D.dll)
LIBCMTD.lib(dosmap.obj) : error LNK2005: __errno already defined in
MSVCRTD.lib(MSVCR90D.dll)
LIBCMTD.lib(tidtable.obj) : error LNK2005: __encode_pointer already defined in
MSVCRTD.lib(MSVCR90D.dll)
LIBCMTD.lib(tidtable.obj) : error LNK2005: __decode_pointer already defined in
MSVCRTD.lib(MSVCR90D.dll)
LIBCMTD.lib(fflush.obj) : error LNK2005: _fflush already defined in
MSVCRTD.lib(MSVCR90D.dll)
LIBCMTD.lib(lconv.obj) : error LNK2005: _localeconv already defined in
MSVCRTD.lib(MSVCR90D.dll)
LIBCMTD.lib(crt0dat.obj) : error LNK2005: _exit already defined in
MSVCRTD.lib(MSVCR90D.dll)
LIBCMTD.lib(crt0dat.obj) : error LNK2005: __exit already defined in
MSVCRTD.lib(MSVCR90D.dll)
LIBCMTD.lib(invarg.obj) : error LNK2005: __invalid_parameter already defined in
MSVCRTD.lib(MSVCR90D.dll)
LIBCMTD.lib(mlock.obj) : error LNK2005: __lock already defined in
MSVCRTD.lib(MSVCR90D.dll)
LIBCMTD.lib(mlock.obj) : error LNK2005: __unlock already defined in
MSVCRTD.lib(MSVCR90D.dll)
LIBCMTD.lib(dbghook.obj) : error LNK2005: __crt_debugger_hook already defined
in MSVCRTD.lib(MSVCR90D.dll)
LIBCMTD.lib(stricmp.obj) : error LNK2005: __stricmp already defined in
MSVCRTD.lib(MSVCR90D.dll)
LIBCMTD.lib(hooks.obj) : error LNK2005: "void __cdecl terminate(void)"
(?terminate@@YAXXZ) already defined in MSVCRTD.lib(MSVCR90D.dll)
LIBCMTD.lib(sprintf.obj) : error LNK2005: _sprintf_s already defined in
MSVCRTD.lib(MSVCR90D.dll)
LIBCMTD.lib(getenv.obj) : error LNK2005: _getenv already defined in
MSVCRTD.lib(MSVCR90D.dll)
LIBCMTD.lib(strtol.obj) : error LNK2005: _strtol already defined in
MSVCRTD.lib(MSVCR90D.dll)
LIBCMTD.lib(strtoq.obj) : error LNK2005: __strtoui64 already defined in
MSVCRTD.lib(MSVCR90D.dll)
LIBCMTD.lib(dbgrptw.obj) : error LNK2005: __CrtDbgReportW already defined in
MSVCRTD.lib(MSVCR90D.dll)
LIBCMTD.lib(vsnprnc.obj) : error LNK2005: __vsnprintf_s already defined in
MSVCRTD.lib(MSVCR90D.dll)
LIBCMTD.lib(printf.obj) : error LNK2005: _printf already defined in
MSVCRTD.lib(MSVCR90D.dll)
LIBCMTD.lib(vprintf.obj) : error LNK2005: _vprintf already defined in
MSVCRTD.lib(MSVCR90D.dll)
LINK : warning LNK4098: defaultlib 'MSVCRTD' conflicts with use of other libs;
use /NODEFAULTLIB:library
C:\XXXX : fatal error LNK1169: one or more multiply defined symbols found
Error executing link.exe (tool returned code: 1169)
Original comment by [email protected]
on 2 Aug 2011 at 7:54
- Added labels: ****
- Removed labels: ****
from googletest.
Related Issues (20)
- need EXPECT_THAT and matchers from googlemock HOT 2
- need to get rid of the use of UnitTestAccessor in the event API samples before releasing 1.4.0 HOT 1
- ParseGoogleTestFlagsOnlyImpl implementation issue HOT 2
- Assertion messages printed twice on Windows CE HOT 2
- Long assertion messages don't show up on Windows CE HOT 3
- Elapsed time on Windows CE does not work correctly HOT 3
- Patch to fix MinGW compilation HOT 3
- Using RecordProperty without XML output HOT 1
- RecordProperty support for double/bool/char/etc HOT 1
- need to check whether our uses of GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_ are OK HOT 2
- GCC compilation error "error: conversion from `void' to non-scalar type" HOT 4
- Even if all tests using a fixture class are DISABLED_ SetUp() still seems to be run. HOT 7
- Gtests run under Visual Studio but not under Team Build HOT 4
- Build Issues in VS2005 HOT 2
- Ehance upload_gtest.py to support http proxy HOT 1
- Adding Symbian Project Definition File HOT 7
- Extended SCOPED_TRACE HOT 4
- ASSERT_DOUBLE_EQ(0.0, x) fails for 0 < x < std::numeric_limits<double>::epsilon() HOT 1
- ASSERT_STRCASEEQ and ASSERT_STRCASENE macros should compare strings consistently across platforms
- Should report the source file location of the TEST that throws an exception
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from googletest.