Building osgEarth with ECW support correctly

classic Classic list List threaded Threaded
4 messages Options
troyle troyle
Reply | Threaded
Open this post in threaded view
|

Building osgEarth with ECW support correctly

Hello,

I am trying to build OSGEarth with ECW image support.
I have been finding small tips around the internet on top of the "How to build OSGEarth" instructions and I believe I am somewhat close to a working solution, save some linker errors.
Here is what I've done so far:
(Built GDAL 3.0.4:)
- downloaded the ECW libs from ERDAS website and installed
- installed proj from OSGeo
- built the sqlite3 package
- downloaded the 3rd party libs from OSG for the rest
- Built GDAL with Win64=1 in args and with the native x64 compiler

(Built OSG 3.6.5)
- used CMake to link in all the libs (CURL, my built GDAL, TIFF)
- used VS2017 to build the 64 bit version where I get all successful builds except 1 of the examples... error LNK2019: unresolved external symbol graphicswindow_Win32 referenced in function "void __cdecl `dynamic initializer for 'graphicswindowproxy_Win32''(void)" (??__Egraphicswindowproxy_Win32@@YAXXZ) for the example_osgslice.vcxproj
- build both debug and release and then run install on both

(Try to build OSGEarth)
- use CMake to link in all the libs (CURL, my built GDAL, my build OSG from the install directory, my SQLITE3 lib)
- Then I try to build osgEarth and I get the following linker errors...
1>Geocoder.obj : error LNK2019: unresolved external symbol OGRGeocodeCreateSession referenced in function "private: void __cdecl `anonymous namespace'::OGRGeocodeImplementation::reset(void)" (?reset@OGRGeocodeImplementation@?A0xd82272fa@@AEAAXXZ)
1>Geocoder.obj : error LNK2019: unresolved external symbol OGRGeocodeDestroySession referenced in function "public: virtual __cdecl `anonymous namespace'::OGRGeocodeImplementation::~OGRGeocodeImplementation(void)" (??1OGRGeocodeImplementation@?A0xd82272fa@@UEAA@XZ)
1>Geocoder.obj : error LNK2019: unresolved external symbol OGRGeocode referenced in function "public: virtual class osgEarth::Status __cdecl `anonymous namespace'::OGRGeocodeImplementation::search(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class osg::ref_ptr<class osgEarth::FeatureCursor> &)" (?search@OGRGeocodeImplementation@?A0xd82272fa@@UEAA?AVStatus@osgEarth@@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEAV?$ref_ptr@VFeatureCursor@osgEarth@@@osg@@@Z)
1>Geocoder.obj : error LNK2019: unresolved external symbol OGRGeocodeFreeResult referenced in function "public: virtual __cdecl `anonymous namespace'::OGRGeocodeResultCursor::~OGRGeocodeResultCursor(void)" (??1OGRGeocodeResultCursor@?A0xd82272fa@@UEAA@XZ)
1>E:\Code\osgEarth_sourceBuild\osgearth-master\build\x64\Debug\osgEarthd.dll : fatal error LNK1120: 4 unresolved externals
1>Done building project "osgEarth.vcxproj" -- FAILED.

I have tried a couple of different build configurations and none have gotten me as close to a proper build as this...

Sorry for the massive wall of text, I've been slowly hammering away at this for a few weeks.

Thanks for your help :)
- troyle
gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|

Re: Building osgEarth with ECW support correctly

Tom,

GDAL can be built with or without geocoder support; you must have built without. That's fine. Just set the osgEarth CMake variable OSGEARTH_ENABLE_GEOCODER=OFF and try again.

Couple other notes:

GDAL 3 is fine but we've noticed some strange issues with PROJ6 ... so just be aware. We are avoiding it for production use for the time being.

If you aren't already using it, I recommend VCPKG for your windows dependencies. Makes life much easier. (I understand you're building GDAL yourself but for other stuff it's convenient.)

Hope this helps. -gw
Glenn Waldron / Pelican Mapping
troyle troyle
Reply | Threaded
Open this post in threaded view
|

Re: Building osgEarth with ECW support correctly

Awesome! looks like that did the trick and it builds properly
Thanks for the info about GDAL, I will keep going with what I have and if anything goes wrong I can rebuild to a more stable version.

I did use vcpkg to do a test build of osgearth which worked nicely. I am fairly new to all these utilities, so I'm trying to get my head around it all.

I guessing there isn't a vcpkg I can download for GDAL with ECW? I expect no because of that end user license, but maybe I'm wrong and I could have saved myself some time :P

Thanks for your help and the quick response,
- Tom
plevy plevy
Reply | Threaded
Open this post in threaded view
|

Re: Building osgEarth with ECW support correctly

Correct, no ECW with vcpkg.  The other alternative is the prebuilt or dev kit version at gisinternals.

--
Paul Levy : Pelican Mapping


On Mon, Mar 30, 2020 at 3:58 PM troyle [via osgEarth] <[hidden email]> wrote:
Awesome! looks like that did the trick and it builds properly
Thanks for the info about GDAL, I will keep going with what I have and if anything goes wrong I can rebuild to a more stable version.

I did use vcpkg to do a test build of osgearth which worked nicely. I am fairly new to all these utilities, so I'm trying to get my head around it all.

I guessing there isn't a vcpkg I can download for GDAL with ECW? I expect no because of that end user license, but maybe I'm wrong and I could have saved myself some time :P

Thanks for your help and the quick response,
- Tom


If you reply to this email, your message will be added to the discussion below:
http://forum.osgearth.org/Building-osgEarth-with-ECW-support-correctly-tp7593117p7593120.html
To start a new topic under osgEarth, email [hidden email]
To unsubscribe from osgEarth, click here.
NAML