7 Jan 2010 marcioandreyoliveira   » (Journeyer)

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!

Syndicated 2010-01-06 23:40:00 from Marcio Andrey Oliveira

Latest blog entries     Older blog entries

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!