views:

548

answers:

2

I'm trying to recompile application, that compiles fine with warning level 4 in visual studio 2005 and visual studio 2008. Since the errors (look below) are coming from std:tr1, I'm thinking there's some conflict, but not sure how to fix. My first thought was to remove all references to boost, such as but then I get an error that it can't find format method. So here's one of the errors: (not sure what it means) Any ideas, suggestions, solutions? Thanks!

EDIT: Right at the beginning I see a message: Unknown compiler version - please run the configure tests and report the results

EDIT2: Piece of code that I think causes this error: (changed to protect the innocent) EDIT3: I updated the error message, i.e added more..however I get many more error messages such as this one..so there's a bigger problem/issue.

 !m_someMap.insert( std::make_pair( "somestring", SomeClass::isTrue ) ).second
....
.....
 inline bool isTrue ( const IDog & dog ) { return s.IsDogTrue(); }



1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\type_traits(197): error C2752: 'std::tr1::_Remove_reference<_Ty>' : more than one partial specialization matches the template argument list
1>          with
1>          [
1>              _Ty=bool (__cdecl &)(const IDog &)
1>          ]
1>          c:\program files (x86)\microsoft visual studio 10.0\vc\include\xtr1common(356): could be 'std::tr1::_Remove_reference<_Ty&&>'
1>          c:\program files (x86)\microsoft visual studio 10.0\vc\include\xtr1common(350): or       'std::tr1::_Remove_reference<_Ty&>'
1>          c:\program files (x86)\microsoft visual studio 10.0\vc\include\type_traits(962) : see reference to class template instantiation 'std::tr1::remove_reference<_Ty>' being compiled
1>          with
1>          [
1>              _Ty=bool (__cdecl &)(const IDog &)
1>          ]
1>          c:\program files (x86)\microsoft visual studio 10.0\vc\include\utility(26) : see reference to class template instantiation 'std::tr1::decay<_Ty>' being compiled
1>          with
1>          [
1>              _Ty=bool (__cdecl &)(const IDog &)
1>          ]
1>         C:\(PATH)\...(915) : see reference to class template instantiation 'std::tr1::_Unrefwrap<_Type>' being compiled
1>          with
1>          [
1>              _Type=bool (__cdecl &)(const IDog &)
1>          ]
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\type_traits(965): error C2528: 'abstract declarator' : pointer to reference is illegal
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\type_traits(349): error C2528: 'type' : pointer to reference is illegal
1>          c:\program files (x86)\microsoft visual studio 10.0\vc\include\type_traits(967) : see reference to class template instantiation 'std::tr1::add_pointer<_Ty>' being compiled
1>          with
1>          [
1>              _Ty=bool (__cdecl &)(const IDog &)
1>          ]
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\type_traits(197): error C2752: 'std::tr1::_Remove_reference<_Ty>' : more than one partial specialization matches the template argument list
1>          with
1>          [
1>              _Ty=bool (__cdecl &)(const char *,int,const char *,std::string &)
1>          ]
A: 

It sounds like Visual Studio might be doing something you don't know. I think you can use the Microsoft compiler with the code::blocks IDE. You can try each compiler (VS 2005/2008/2010). Also, try a diff from your source code repository to be sure Microsoft didn't "prettify" your code.

Note: You don't have to use Code::Blocks after you figure out the problem. It just might be a good tool for this particular issue.

User1
-1: Does not answer the OP's question. Also, the errors are thrown by the compiler, not the IDE, meaning that the message is not going to change in Code::Blocks. EDIT: And Visual Studio does not "prettify" code. Even if it did, it should still compile.
Billy ONeal
+1: At least he pointed out what may be considered as a source of a problem
chester89
@chester89: Where? The only advice I see there is "Don't use Visual Studio".
Billy ONeal
@Billy: How do you know the IDE didn't change the code before it was compiled to work around some compiler issue? How do you know that VS is calling the compiler with some strange additional options that you don't expect? Another IDE can rule out those issues. Finally, where did I say "Don't use Visual Studio"? Read my post again, I actually stated that he did not have to use code::blocks after the problem was solved. It's just a good troubleshooting tool. Do you work for Microsoft?
User1
A: 

the problem is with visual studio 2010, or I should say that with additional templates that were added to visual studio 2010 tr1, so, std::make_pair, doesn't always work. changed to pair<> and all errors magically went away.

so, if you have template problems in VC2010 and using std:make_pair, change it to pair<> and specify template parameters.

ra170