compile error in FeatureSourceIndexNode.cpp...

classic Classic list List threaded Threaded
2 messages Options
2LR 2LR
Reply | Threaded
Open this post in threaded view
|

compile error in FeatureSourceIndexNode.cpp...

I'm trying to build osgEarth 2.7.0 in x64 on Windows using VS 2017. I've built all the correct 3rdParty dependencies. Everything compiles fine but I'm getting the following errors for the file "FeatureSourceIndexNode.cpp" when I build the osgEarthFeatures library...

1>------ Build started: Project: osgEarthFeatures, Configuration: Release x64 ------
1>AltitudeFilter.cpp
1>FeatureModelGraph.cpp
1>c:\osgearth-2.7\src\osgearthfeatures\featuremodelgraph.cpp(442): warning C4018: '<': signed/unsigned mismatch
1>c:\osgearth-2.7\src\osgearthfeatures\featuremodelgraph.cpp(575): warning C4018: '<': signed/unsigned mismatch
1>c:\osgearth-2.7\src\osgearthfeatures\featuremodelgraph.cpp(578): warning C4018: '<': signed/unsigned mismatch
1>FeatureSourceIndexNode.cpp
1>c:\program files (x86)\microsoft visual studio\2017\professional\vc\tools\msvc\14.16.27023\include\xmemory0(881): error C2440: 'initializing': cannot convert from 'std::pair<const _Kty,_Ty>' to '_Objty'
1>        with
1>        [
1>            _Kty=osgEarth::Features::FeatureID,
1>            _Ty=osg::ref_ptr<osgEarth::Features::RefIDPair>
1>        ]
1>        and
1>        [
1>            _Objty=unsigned long
1>        ]
1>c:\program files (x86)\microsoft visual studio\2017\professional\vc\tools\msvc\14.16.27023\include\xmemory0(881): note: No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
1>c:\program files (x86)\microsoft visual studio\2017\professional\vc\tools\msvc\14.16.27023\include\xtree(984): note: see reference to function template instantiation 'void std::_Default_allocator_traits<_Alloc>::construct<_Ty,std::pair<const _Kty,osg::ref_ptr<osgEarth::Features::RefIDPair>>&>(_Alloc &,_Objty *const ,std::pair<const _Kty,osg::ref_ptr<osgEarth::Features::RefIDPair>> &)' being compiled
1>        with
1>        [
1>            _Alloc=std::allocator<std::_Tree_node<unsigned long,std::_Default_allocator_traits<std::allocator<osgEarth::Features::FeatureID>>::void_pointer>>,
1>            _Ty=unsigned long,
1>            _Kty=osgEarth::Features::FeatureID,
1>            _Objty=unsigned long
1>        ]
1>c:\program files (x86)\microsoft visual studio\2017\professional\vc\tools\msvc\14.16.27023\include\xtree(983): note: see reference to function template instantiation 'void std::_Default_allocator_traits<_Alloc>::construct<_Ty,std::pair<const _Kty,osg::ref_ptr<osgEarth::Features::RefIDPair>>&>(_Alloc &,_Objty *const ,std::pair<const _Kty,osg::ref_ptr<osgEarth::Features::RefIDPair>> &)' being compiled
1>        with
1>        [
1>            _Alloc=std::allocator<std::_Tree_node<unsigned long,std::_Default_allocator_traits<std::allocator<osgEarth::Features::FeatureID>>::void_pointer>>,
1>            _Ty=unsigned long,
1>            _Kty=osgEarth::Features::FeatureID,
1>            _Objty=unsigned long
1>        ]
1>c:\program files (x86)\microsoft visual studio\2017\professional\vc\tools\msvc\14.16.27023\include\xtree(1162): note: see reference to function template instantiation 'std::_Tree_node<_Ty,std::_Default_allocator_traits<_Alloc>::void_pointer> *std::_Tree_comp_alloc<_Traits>::_Buynode<std::pair<const _Kty,osg::ref_ptr<osgEarth::Features::RefIDPair>>&>(std::pair<const _Kty,osg::ref_ptr<osgEarth::Features::RefIDPair>> &)' being compiled
1>        with
1>        [
1>            _Ty=unsigned long,
1>            _Alloc=std::allocator<osgEarth::Features::FeatureID>,
1>            _Traits=std::_Tset_traits<osgEarth::Features::FeatureID,std::less<osgEarth::Features::FeatureID>,std::allocator<osgEarth::Features::FeatureID>,false>,
1>            _Kty=osgEarth::Features::FeatureID
1>        ]
1>c:\program files (x86)\microsoft visual studio\2017\professional\vc\tools\msvc\14.16.27023\include\xtree(1162): note: see reference to function template instantiation 'std::_Tree_node<_Ty,std::_Default_allocator_traits<_Alloc>::void_pointer> *std::_Tree_comp_alloc<_Traits>::_Buynode<std::pair<const _Kty,osg::ref_ptr<osgEarth::Features::RefIDPair>>&>(std::pair<const _Kty,osg::ref_ptr<osgEarth::Features::RefIDPair>> &)' being compiled
1>        with
1>        [
1>            _Ty=unsigned long,
1>            _Alloc=std::allocator<osgEarth::Features::FeatureID>,
1>            _Traits=std::_Tset_traits<osgEarth::Features::FeatureID,std::less<osgEarth::Features::FeatureID>,std::allocator<osgEarth::Features::FeatureID>,false>,
1>            _Kty=osgEarth::Features::FeatureID
1>        ]
1>c:\program files (x86)\microsoft visual studio\2017\professional\vc\tools\msvc\14.16.27023\include\xtree(1345): note: see reference to function template instantiation 'std::_Tree_const_iterator<std::_Tree_val<std::_Tree_simple_types<_Ty>>> std::_Tree<std::_Tset_traits<_Kty,_Pr,_Alloc,false>>::emplace_hint<std::pair<const _Kty,osg::ref_ptr<osgEarth::Features::RefIDPair>>&>(std::_Tree_const_iterator<std::_Tree_val<std::_Tree_simple_types<_Ty>>>,std::pair<const _Kty,osg::ref_ptr<osgEarth::Features::RefIDPair>> &)' being compiled
1>        with
1>        [
1>            _Ty=unsigned long,
1>            _Kty=osgEarth::Features::FeatureID,
1>            _Pr=std::less<osgEarth::Features::FeatureID>,
1>            _Alloc=std::allocator<osgEarth::Features::FeatureID>
1>        ]
1>c:\program files (x86)\microsoft visual studio\2017\professional\vc\tools\msvc\14.16.27023\include\xtree(1345): note: see reference to function template instantiation 'std::_Tree_const_iterator<std::_Tree_val<std::_Tree_simple_types<_Ty>>> std::_Tree<std::_Tset_traits<_Kty,_Pr,_Alloc,false>>::emplace_hint<std::pair<const _Kty,osg::ref_ptr<osgEarth::Features::RefIDPair>>&>(std::_Tree_const_iterator<std::_Tree_val<std::_Tree_simple_types<_Ty>>>,std::pair<const _Kty,osg::ref_ptr<osgEarth::Features::RefIDPair>> &)' being compiled
1>        with
1>        [
1>            _Ty=unsigned long,
1>            _Kty=osgEarth::Features::FeatureID,
1>            _Pr=std::less<osgEarth::Features::FeatureID>,
1>            _Alloc=std::allocator<osgEarth::Features::FeatureID>
1>        ]
1>c:\osgearth-2.7\src\osgearthfeatures\featuresourceindexnode.cpp(92): note: see reference to function template instantiation 'void std::_Tree<std::_Tset_traits<_Kty,_Pr,_Alloc,false>>::insert<`anonymous-namespace'::KeyIter<osgEarth::Features::FeatureSourceIndexNode::FIDMap>>(_Iter,_Iter)' being compiled
1>        with
1>        [
1>            _Kty=osgEarth::Features::FeatureID,
1>            _Pr=std::less<osgEarth::Features::FeatureID>,
1>            _Alloc=std::allocator<osgEarth::Features::FeatureID>,
1>            _Iter=`anonymous-namespace'::KeyIter<osgEarth::Features::FeatureSourceIndexNode::FIDMap>
1>        ]
1>c:\osgearth-2.7\src\osgearthfeatures\featuresourceindexnode.cpp(92): note: see reference to function template instantiation 'void std::_Tree<std::_Tset_traits<_Kty,_Pr,_Alloc,false>>::insert<`anonymous-namespace'::KeyIter<osgEarth::Features::FeatureSourceIndexNode::FIDMap>>(_Iter,_Iter)' being compiled
1>        with
1>        [
1>            _Kty=osgEarth::Features::FeatureID,
1>            _Pr=std::less<osgEarth::Features::FeatureID>,
1>            _Alloc=std::allocator<osgEarth::Features::FeatureID>,
1>            _Iter=`anonymous-namespace'::KeyIter<osgEarth::Features::FeatureSourceIndexNode::FIDMap>
1>        ]
1>Generating Code...
1>Done building project "osgEarthFeatures.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Can anyone tell me why I'm getting these errors?

Thank you.

Shayne
2LR 2LR
Reply | Threaded
Open this post in threaded view
|

Re: compile error in FeatureSourceIndexNode.cpp...

Update: Using this fix https://github.com/gwaldron/osgearth/issues/1187, I was able to fix the compile errors. osgEarth 2.7.0 now builds with VS 2017 15.8+.

It appears that the old code compiled with earlier versions of Visual Studio including VS 2017 15.3 up to 15.8. Anything later than this would need the fix using the link above...

Shayne