Boost::lexical_cast error when usin Qtcreator with MSVC2010 compiler, but no error when using VisualStudio for the same code
Hi,
I’m right now porting an console app i wrote using VS2010exp into Qt creator (widget based project).
I use boost::lexical_cast extensively in the code. In Vs it compiles and runs fine. The same code in Qt results in an error (without indicating a special line of code):
- *c:\Program\boost\boost_1_47\boost\lexical_cast.hpp:1116: error: C2535: 'bool boost::detail::lexical_stream_limited_src<CharT,Base,Traits>::operator >>(unsigned short &)' : member function already defined or declared
- with
- [
- CharT=char_type,
- Base=base,
- Traits=traits
- ]
- c:\Program\boost\boost_1_47\boost\lexical_cast.hpp:993: see declaration of 'boost::detail::lexical_stream_limited_src<CharT,Base,Traits>::operator >>'
- with
- [
- CharT=char_type,
- Base=base,
- Traits=traits
- ]
- c:\Program\boost\boost_1_47\boost\lexical_cast.hpp:1524: see reference to class template instantiation 'boost::detail::lexical_stream_limited_src<CharT,Base,Traits>' being compiled
- with
- [
- CharT=char_type,
- Base=base,
- Traits=traits
- ]
- c:\Program\boost\boost_1_47\boost\lexical_cast.hpp:1653: see reference to function template instantiation 'Target boost::detail::lexical_cast<Target,src,false,char_type>(const std::basic_string<_Elem,_Traits,_Ax> &,CharT *,size_t)' being compiled
- with
- [
- Target=float,
- _Elem=wchar_t,
- _Traits=std::char_traits<wchar_t>,
- _Ax=std::allocator<wchar_t>,
- CharT=char_type
- ]
- c:\Program\boost\boost_1_47\boost\lexical_cast.hpp:1641: while compiling class template member function 'float boost::detail::lexical_cast_do_cast<Target,Source>::lexical_cast_impl(const Source &)'
- with
- [
- Target=float,
- Source=src
- ]
- c:\Program\boost\boost_1_47\boost\lexical_cast.hpp:1813: see reference to class template instantiation 'boost::detail::lexical_cast_do_cast<Target,Source>' being compiled
- with
- [
- Target=float,
- Source=src
- ]
- c:\Program\boost\boost_1_47\boost\lexical_cast.hpp:1813: see reference to class template instantiation 'boost::detail::lexical_cast_do_cast<Target,Source>' being compiled
- with
- [
- Target=float,
- Source=src
- ]*
I have no clue what could cause this. Has anyone a hint for me? Thanks
[edit] code tags added, koahnig
2 replies
You must log in to post a reply. Not a member yet? Register here!


