Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3440792
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T08:28:29+00:00 2026-05-18T08:28:29+00:00

Has anyone successfully built gmock and gtest in Visual Studio 2010? I’ve tried with

  • 0

Has anyone successfully built gmock and gtest in Visual Studio 2010? I’ve tried with version 1.5.0, but I only get incomprehensible compilation errors.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T08:28:29+00:00Added an answer on May 18, 2026 at 8:28 am

    I found this thread in google groups about issues found when building gmock-1.5.0 under VS2010. Following the thread, I’ve created a short readme file, which worked for me, so here it is:

    • Download gmock 1.5.0 from Google Mock.
    • Extract to library folder on the machine (e.g. C:\Libs\gmock-1.5.0). From now on, this folder will be reffered as ‘GMOCK_ROOT’.
    • Open VS2010, and load the solution: GMOCK_ROOT\msvc\gmock.sln. Let VS convert it from VS2008 to VS2010. Important! DO NOT double-click the solution file under GMOCK_ROOT\msvc. This resulted in a bad conversion.
    • Perform the following changes to sources according to the thread:

      • in project gmock –> Private Header Files –> gmock-internal-utils.h:

        • lines 201, 202: comment out the ‘Helper’ functions:

        char Helper(To);

        static char (&Helper(...))[2]; // NOLINT

        • lines 210-219: replace the entire #ifdef..#endif section with:

        static const bool value = std::is_convertible<From, To>::value;

      • in project gmock_test –> Source Files –> gmock-printers_test.cc, line 848:
        perform an explicit casting of the NULL argument to void*, otherwise VS will automatically regard it is a null int. The resulting line should look like this:

        t10(false, 'a', 3, 4, 5, 1.5F, -2.5, str, static_cast<void*>(NULL), "10");

        1. Build the solution. This should result in 4 warnings, which, as described below, are (probably) OK.

    Hope this helps,

    Boaz


    VS2010 compiler warnings from step 5 (see remarks at the end):

    Warning 1 warning C4996:
    ‘std::_Copy_impl’: Function call with
    parameters that may be unsafe – this
    call relies on the caller to check
    that the passed values are correct. To
    disable this warning, use
    -D_SCL_SECURE_NO_WARNINGS. See documentation on how to use Visual C++
    ‘Checked Iterators’ C:\Program Files
    (x86)\Microsoft Visual Studio
    10.0\VC\include\xutility 2227 1

    Warning 2 warning C4996:
    ‘std::_Copy_impl’: Function call with
    parameters that may be unsafe – this
    call relies on the caller to check
    that the passed values are correct. To
    disable this warning, use
    -D_SCL_SECURE_NO_WARNINGS. See documentation on how to use Visual C++
    ‘Checked Iterators’ C:\Program Files
    (x86)\Microsoft Visual Studio
    10.0\VC\include\xutility 2227 1

    Warning 4 warning C4413:
    ‘std::tr1::_Cons_node<_Car,_Cdr>::_Value’
    : reference member is initialized to a
    temporary that doesn’t persist after
    the constructor exits C:\Program Files
    (x86)\Microsoft Visual Studio
    10.0\VC\include\tuple 137 1

    Warning 3 warning C4373:
    ‘testing::gmock_generated_function_mockers_test::MockFoo::TakesConst’:
    virtual function overrides
    ‘testing::gmock_generated_function_mockers_test::FooInterface::TakesConst’,
    previous versions of the compiler did
    not override when parameters only
    differed by const/volatile
    qualifiers C:\Libs\gmock-1.5.0\test\gmock-generated-function-mockers_test.cc 133 1

    Remarks regarding warnings:

    1. Warnings 1,2 are about Copy() in xutility being deprecated due to safty. As the mock library is not a part of the production release, this is OK by me.
    2. Warning 4 is OK according to the thread.
    3. Warning 3: not sure, but all seems to work well.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Has anyone successfully built an Adobe Air application with Maven? If so, what are
Has anyone successfully implemented a Java based solution that uses Microsoft SQL Server 2005
Has anyone successfully talked profibus from a .NET application? If you did, what device/card
Has anyone successfully installed VS 2008 Team Developer edition on the Windows 7 beta
Has anyone been able to successfully unit test methods that are, by necessity, coupled
Has anyone tried installing SQL Server 2008 Developer on a machine that already has
Has anyone looked at Yahoo's ASTRA ? It's fairly nifty, but I had some
Has anyone been able to get an NHibernate-based project up and running on a
Has anyone of you successfully added a lexer to scintilla? I have been following
Has anyone been able to succesfully use the IE CSS hack #IEroot? I stumbled

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.