Monday, September 3, 2012

Setting Up Google test framework in Visual Studio

1. Install Visual Studio.
2. Download Google test framework. http://code.google.com/p/googletest/downloads/list
3. Unzip downloaded file.
4. Go to gtest->MSVC and run gtest.sln and gtest-md.sln and make build of both in both debug and release mode.
5. For DEBUG mode
    a. Open a project or create a new project and then go to properties->c/c++->general
    b. In additional include Libraries give the path of fused-src folder
         For example if you have unzipped your gtest in F drive then F:\gtest\fused-src
    c. Now go to linker->general and in additional include Libraries give the path of Debug folder in       MSVC like F:\gtest\msvc\gtest\debug
    d. Now in linker->input in Additional dependencies put gtestd.lib; gtest_maind.lib
6. Now do the similar steps for Release mode.
one more thing you have to do is go to properties->C/C++->code generation and in Run time library for debug put Multi-Threaded Debug(/MTd) and for release mode put Multi-threaded(/MT)
If this material is relevant to you then don't forget to comment.....:-)
For any problem you can reach to bhupi.biet@gmail.com
Thanks