Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v0.14.3rc1 and v.15.0 compiling error with VS2013 #553

Closed
alphab3ta opened this issue Nov 7, 2016 · 1 comment
Closed

v0.14.3rc1 and v.15.0 compiling error with VS2013 #553

alphab3ta opened this issue Nov 7, 2016 · 1 comment

Comments

@alphab3ta
Copy link

When I compiled v0.14.2 I had no issues after I applied these changes.

But, when I am trying to compile v0.14.3rc1 and v0.15.0. It has the following errors.
" ambiguous call to overloaded function "
https://img1.steemit.com/0x0/http://dirtyimg.com/image/8error.PNG

I believe the errors were introduced in issue #476,
steemit/fc@19d41b8...a1354c5#diff-18f79c66780a65dbb617edf936a5dd38R115
when more variadic template parameters code was added, the vs2013 compiler is confused about some of the call functions.
The definition of reflector \steem\libraries\fc\include\fc\reflect\reflect.hpp maybe the cause.
Because \steem\libraries\fc\include\fc\reflect\variant.hpp line 104

		template<typename T>
		static inline void from_variant(const variant& v, T& o)      
		{
			if_enum<typename fc::reflector<T>::is_enum>::from_variant(v, o);
		}

and \steem\libraries\fc\include\fc\io\raw.hpp line 531

    template<typename Stream, typename T>  
    { try {
      fc::raw::detail::if_reflected< typename fc::reflector<T>::is_defined >::unpack(s,v);
    } FC_RETHROW_EXCEPTIONS( warn, "error unpacking ${type}", ("type",fc::get_typename<T>::name() ) ) }	

They both used reflector to determine typename. and both are on the error log. If I commented out the "unpack" template, the "unpack ambiguous call" errors disappear. If I commented out the "from_variant" template, the "ambiguous call" errors are gone, but it generate error LNK2019:unresolved external symbol errors.


  • The first ambiguous call is from fc/reflect/variant.hpp line 53
         template<typename Member, class Class, Member (Class::*member)>
         void operator()( const char* name )const
         {
            auto itr = vo.find(name);
            if( itr != vo.end() )
               from_variant( itr->value(), val.*member );
         }
  • Here is the logs that is related to from_variant call from the flat_map template.
F:\Git_GUI\steem\libraries\fc\include\fc/container/flat.hpp(118): or       
'void fc::from_variant<std::string,steemit::chain::weight_type,std::less<_Kty>,boost::container::new_allocator<std::pair<Key,T>>>(const fc::variant &,boost::container::flat_map<Key,T,std::less<_Kty>,boost::container::new_allocator<std::pair<Key,T>>> &)'

F:\Git_GUI\steem\libraries\fc\include\fc/variant.hpp(94): or       
'void fc::from_variant<std::string,steemit::chain::weight_type,std::less<_Kty>,boost::container::new_allocator<std::pair<Key,T>>>(const fc::variant &,boost::container::flat_map<Key,T,std::less<_Kty>,boost::container::new_allocator<std::pair<Key,T>>> &)'

 F:\Git_GUI\steem\libraries\fc\include\fc/reflect/variant.hpp(104): or       
'void fc::from_variant<boost::container::flat_map<std::string,steemit::chain::weight_type,std::less<_Kty>,boost::container::new_allocator<std::pair<Key,T>>>>(const fc::variant &,boost::container::flat_map<Key,T,std::less<_Kty>,boost::container::new_allocator<std::pair<Key,T>>> &)'

  • The second ambiguous call is from raw.hpp line 292.
 template<typename T, typename C, T(C::*p)>
        inline void operator()( const char* name )const
        { try {
          fc::raw::unpack( s, c.*p );
        } FC_RETHROW_EXCEPTIONS( warn, "Error unpacking field ${field}", ("field",name) ) }
        private:
          Class&  c;
          Stream& s;
  • And this is the log related to fc::raw::unpack call from the flat_map template.
  F:\Git_GUI\steem\libraries\fc\include\fc/io/raw.hpp(583): or       
'void fc::raw::unpack<boost::container::flat_map<std::string,steemit::chain::weight_type,std::less<_Kty>,boost::container::new_allocator<std::pair<Key,T>>>>(const std::vector<char,std::allocator<char>> &,boost::container::flat_map<Key,T,std::less<_Kty>,boost::container::new_allocator<std::pair<Key,T>>> &)'

F:\Git_GUI\steem\libraries\fc\include\fc/io/raw.hpp(531): or       
'void fc::raw::unpack<Stream,boost::container::flat_map<std::string,steemit::chain::weight_type,std::less<_Kty>,boost::container::new_allocator<std::pair<Key,T>>>>(Stream &,boost::container::flat_map<Key,T,std::less<_Kty>,boost::container::new_allocator<std::pair<Key,T>>> &)'

 F:\Git_GUI\steem\libraries\fc\include\fc/io/raw.hpp(187): or       
'void fc::raw::unpack<Stream,boost::container::flat_map<std::string,steemit::chain::weight_type,std::less<_Kty>,boost::container::new_allocator<std::pair<Key,T>>>>(Stream &,const boost::container::flat_map<Key,T,std::less<_Kty>,boost::container::new_allocator<std::pair<Key,T>>> &)'

 F:\Git_GUI\steem\libraries\fc\include\fc/container/flat.hpp(44): or       
'void fc::raw::unpack<Stream,std::string,steemit::chain::weight_type,std::less<_Kty>,boost::container::new_allocator<std::pair<Key,T>>>(Stream &,boost::container::flat_map<Key,T,std::less<_Kty>,boost::container::new_allocator<std::pair<Key,T>>> &)'

 F:\Git_GUI\steem\libraries\fc\include\fc/container/flat_fwd.hpp(20): or       
'void fc::raw::unpack<Stream,std::string,steemit::chain::weight_type,std::less<_Kty>,boost::container::new_allocator<std::pair<Key,T>>>(Stream &,boost::container::flat_map<Key,T,std::less<_Kty>,boost::container::new_allocator<std::pair<Key,T>>> &)'

I hope someone is able to figure out the actual cause of these errors and correct them.

Thanks for reading.

@alphab3ta alphab3ta changed the title v0.14.3rc1 and v.15.0 compiling error with 2013 v0.14.3rc1 and v.15.0 compiling error with VS2013 Nov 7, 2016
@alphab3ta
Copy link
Author

In order for it to compile, I have to revert some of the codes on commit steemit/fc@e7d0d26

see detail

On1x pushed a commit to VIZ-Blockchain/viz-cpp-node that referenced this issue May 28, 2018
…-bug-fix

Fixed bug: Witness price feed never expire
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant