4

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>          ]
14
  • 3
    All the errors are being thrown from template instantiations. We need to see the code that's calling Boost in order to diagnose this. Commented Apr 22, 2010 at 14:30
  • I think I might have to build boost with visual studio 10, let me try that..
    – ra170
    Commented Apr 22, 2010 at 14:35
  • 2
    @ra170: No, the errors are being thrown during compilation. A lack of build would be a link time error. Commented Apr 22, 2010 at 14:37
  • @ra170: I have reconstructed your error message -- wordwrap that was installed because you used quote instead of code destroyed it to begin with -- and now it's clear the error message isn't complete either. We need the whole error message. Commented Apr 22, 2010 at 14:39
  • This says std::tr1::_Remove_reference<_Ty&&>. That's an rvalue reference. These are new in VS 2010. I'd very much doubt that they have the std lib wrong, as Billy said, so the errors are meaningless unless you provide the code that causes them.
    – sbi
    Commented Apr 22, 2010 at 14:41

2 Answers 2

8

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.

0
-5

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.

4
  • 2
    -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. Commented Apr 22, 2010 at 15:03
  • 1
    +1: At least he pointed out what may be considered as a source of a problem
    – chester89
    Commented Apr 22, 2010 at 15:09
  • @chester89: Where? The only advice I see there is "Don't use Visual Studio". Commented Apr 22, 2010 at 15:14
  • @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
    Commented Apr 22, 2010 at 21:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.