Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

The order of the include files make a difference.

Yesterday I was facing some problems to use Google C++ Testing Framework (version 1.4.0).

I got a bunch of error messages from Visual Studio 2005 that you can see below.

Error    1    error C2766: explicit specialization; 'std::numeric_limits<:_bool>' has already been defined    c:\arquivos de programas\microsoft visual studio 8\vc\include\limits    482    
Error    2    error C2766: explicit specialization; 'std::iterator_traits<:_bool>' has already been defined    c:\arquivos de programas\microsoft visual studio 8\vc\include\xutility    678   
Error    3    error C2766: explicit specialization; 'std::_Ptr_cat_helper<:_bool>' has already been defined    c:\arquivos de programas\microsoft visual studio 8\vc\include\xutility    1143   
Error    4    error C2766: explicit specialization; 'std::_Ptr_cat_helper' has already been defined    c:\arquivos de programas\microsoft visual studio 8\vc\include\xutility    1149   
*,std::_bool*>

To make a long story short: the order of the include files made a difference. I put line
#include <gtest/gtest.h>
before all other include files and my problems vanished!


This post first appeared on Marcio Andrey Oliveira, please read the originial post: here

Share the post

The order of the include files make a difference.

×

Subscribe to Marcio Andrey Oliveira

Get updates delivered right to your inbox!

Thank you for your subscription

×