I followed these steps and had linker errors.
msvcprt.lib(MSVCP90.dll) : error LNK2005: "public: class
std::locale::facet * __thiscall std::locale::facet::_Decref(void)" (?
_Decref@facet@locale@std@@QAEPAV123@XZ) already defined in
gtest.lib(gtest.obj)
1>libcpmt.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
msvcprt.lib(MSVCP90.dll)
40 errors noting various already defined messages.
Any ideas?
On Nov 4, 8:09 am, Vlad Losev <
vl...@google.com> wrote:
> Hi Sandeep,
>
> To use Google Test with Visual Studio, you need to do this:
>
> 1. Open the msvc/gtest.sln solution. Agree to upgrade it if asked to.
> 2. Create a console application project for your tests.
> 3. Add gtest_main as a dependency for you project. The exact sequence for
> this varies with Visual Studio version. In VS 2005, right-click on you
> project, select Add Reference, then choose gtest_main in Projects tab.
> 4. Add Google Test's include directory (<the directory where you have
> unpacked Google Test>/include) to your include path of your project.
> 5. #include <gtest/gtest.h> into your test files.
>
> After this you can write tests as explained in the Getting
> Started<
http://code.google.com/p/googletest/wiki/GoogleTestPrimer>wiki
> page.
>
> Hope this helps,
> Vlad.
>