gwaldron/osgearth — Issue #44: VS2010 / 64Bit Build Fix for Style.cpp
Author: remoe
Created: 2011-11-09 11:47:51+00:00
State: open

Hi

I use trunk (11.9.2011) and can't compile Style.cpp with 64bit VC2010:

1> Style.cpp
1>D:\apps\vs2010\VC\include\utility(163): error C2664: 'osg::ref_ptr::ref_ptr(T *)' : cannot convert parameter 1 from 'long' to 'osgEarth::Symbology::ResourceLibrary *'
1> with
1> [
1> T=osgEarth::Symbology::ResourceLibrary
1> ]
1> Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
1> D:\apps\vs2010\VC\include\utility(247) : see reference to function template instantiation 'std::_Pair_base<_Ty1,_Ty2>::_Pair_base(_Other1,_Other2 &&)' being compiled
1> with
1> [
1> _Ty1=osgEarth::URI,
1> _Ty2=osg::ref_ptr,
1> _Ty=long,
1> _Other1=osgEarth::URI &,
1> _Other2=long
1> ]
1> Style.cpp(386) : see reference to function template instantiation 'std::pair<_Ty1,_Ty2>::pair(_Other1,_Other2 &&)' being compiled
1> with
1> [
1> _Ty1=osgEarth::URI,
1> _Ty2=osg::ref_ptr,
1> _Other1=osgEarth::URI &,
1> _Other2=long
1> ]
1>
1>Build FAILED.

Fix at Line 386 from:

_resLibs[name] = ResourceLibraryEntry(uri, 0L);

to

_resLibs[name] = ResourceLibraryEntry(uri, (osgEarth::Symbology::ResourceLibrary*)NULL);

Cheers
Remo