Developer Discussions

Discuss topics with other Hexagon Geospatial Power Portfolio developers and experts to get the most out of our products.
Showing results for 
Search instead for 
Do you mean 
Reply
Highlighted
New Contributor
Posts: 2
Registered: ‎12-03-2019

Error when compiling GDAL with ECW support on Redhat Linux using ERDAS ECW/JP2 SDK 5.5

Hi,

 

any idae why make gives this error? Is there some compiler option in order to avoid this error?

 

make[2]: Entering directory `/srv/gdal/gdal-2.3.0/frmts/ecw'

/bin/sh /srv/gdal/gdal-2.3.0/libtool --mode=compile --silent --tag=CXX

g++ -std=c++11 -I/srv/gdal/gdal-2.3.0/port -I/srv/gdal/gdal-2.3.0/gcore

-I/srv/gdal/gdal-2.3.0/alg -I/srv/gdal/gdal-2.3.0/ogr -I/srv/gdal/gdal- 2.3.0/ogr/ogrsf_frmts -I/srv/gdal/gdal-2.3.0/gnm -I/srv/gdal/gdal- 2.3.0/apps -DHAVE_AVX_AT_COMPILE_TIME -DHAVE_SSSE3_AT_COMPILE_TIME -DHAVE_SSE_AT_COMPILE_TIME -D_GLIBCXX_USE_CXX11_ABI=0 -Wall -Wextra -Winit-self -Wunused-parameter -Wformat -Werror=format-security -Wno- format-nonliteral -Wlogical-op -Wshadow -Werror=vla -Wmissing- declarations -Wnon-virtual-dtor -Woverloaded-virtual -fno-operator- names -Wzero-as-null-pointer-constant  -DFRMT_ecw -DGNM_ENABLED -I/srv/gdal/gdal-2.3.0/port  -DGDAL_COMPILATION -DHAVE_ECW_BUILDNUMBER_H -DLINUX -DX86 -DPOSIX -DHAVE_COMPRESS -DECW_COMPRESS_RW_SDK_VERSION -I/srv/hexagon/include  - DDO_NOT_USE_DEBUG_BOOL -DPOSIX -DLINUX -c -o ../o/ecwdataset.lo ecwdataset.cpp In file included from ecwdataset.cpp:34:0:

gdal_ecw.h:93:23: error: ‘virtual CNCSError JP2UserBox:Smiley Tonguearse(NCS:Smiley FrustratedDK::CFileBase&, NCS::CIOStream&)’ marked override, but does not override

     virtual CNCSError Parse(NCS:Smiley FrustratedDK::CFileBase &JP2File,

                       ^

gdal_ecw.h:95:23: error: ‘virtual CNCSError JP2UserBox::UnParse(NCS:Smiley FrustratedDK::CFileBase&, NCS::CIOStream&)’ marked override, but does not override

     virtual CNCSError UnParse(NCS:Smiley FrustratedDK::CFileBase &JP2File,

                       ^

In file included from /srv/hexagon/include/NCSEcw/API/View.h:9:0,

                 from /srv/hexagon/include/NCSFile.h:7,

                 from ecwsdk_headers.h:58,

                 from gdal_ecw.h:45,

                 from ecwdataset.cpp:34:

/srv/hexagon/include/NCSEcw/SDK/Box.h:81:30: warning: ‘virtual NCS::CError NCS:Smiley FrustratedDK::CBox::UnParse(NCS:Smiley FrustratedDK::CFileBase&, const CIOStreamPtr&)’ was hidden [-Woverloaded-virtual]

  NCSECW_IMPEX virtual CError UnParse(CFileBase &FileBase, const CIOStreamPtr &Stream);

 

Regards,

 

Tab

Highlighted
Staff
Posts: 9
Registered: ‎02-27-2019

Re: Error when compiling GDAL with ECW support on Redhat Linux using ERDAS ECW/JP2 SDK 5.5

What version of gcc are you compiling with?

Highlighted
New Contributor
Posts: 2
Registered: ‎03-24-2020

Re: Error when compiling GDAL with ECW support on Redhat Linux using ERDAS ECW/JP2 SDK 5.5

I got the same problem  with:

 

GCC 5.5.0

 

GDAL 2.2.0

 

ERDAS ECW JP2 SDK 5.5

 

 

Oracle Linux 6.10

 

 

Highlighted
New Contributor
Posts: 3
Registered: ‎03-25-2020

Re: Error when compiling GDAL with ECW support on Redhat Linux using ERDAS ECW/JP2 SDK 5.5

Got the same here.

 

tested with:

gdal 2.2.4 and 2.4.4

gcc 7.5

erdas ECW/JP SDK 5.5 and 5.5 Update 1

Ubuntu Server 18.04 LTS

 

In file included from ecwdataset.cpp:34:0:
gdal_ecw.h:93:23: error: ‘virtual CNCSError JP2UserBox:Smiley Tonguearse(NCS:Smiley FrustratedDK::CFileBase&, NCS::CIOStream&)’ marked ‘override’, but does not override
virtual CNCSError Parse(NCS:Smiley FrustratedDK::CFileBase &JP2File,
^~~~~
gdal_ecw.h:95:23: error: ‘virtual CNCSError JP2UserBox::UnParse(NCS:Smiley FrustratedDK::CFileBase&, NCS::CIOStream&)’ marked ‘override’, but does not override
virtual CNCSError UnParse(NCS:Smiley FrustratedDK::CFileBase &JP2File,
^~~~~~~
gdal_ecw.h:95:23: warning: by ‘virtual CNCSError JP2UserBox::UnParse(NCS:Smiley FrustratedDK::CFileBase&, NCS::CIOStream&)’ [-Woverloaded-virtual]
gdal_ecw.h:93:23: warning: by ‘virtual CNCSError JP2UserBox:Smiley Tonguearse(NCS:Smiley FrustratedDK::CFileBase&, NCS::CIOStream&)’ [-Woverloaded-virtual]
virtual CNCSError Parse(NCS:Smiley FrustratedDK::CFileBase &JP2File,
^~~~~
ecwdataset.cpp: In destructor ‘virtual ECWDataset::~ECWDataset()’:
ecwdataset.cpp:1077:76: error: invalid cast from type ‘NCS::CIOStreamPtr {aka std::shared_ptr<NCS::CIOStream>}’ to type ‘VSIIOStream*’
poUnderlyingIOStream = ((VSIIOStream *)(poFileView->GetStream()));
^
ecwdataset.cpp: In static member function ‘static CNCSJP2FileView* ECWDataset:Smiley SurprisedpenFileView(const char*, bool, int&, bool)’:
ecwdataset.cpp:2556:59: error: no matching function for call to ‘NCS::CView:Smiley Surprisedpen(VSIIOStream*&, bool&)’
oErr = poFileView->Open( poIOStream, bProgressive );
^
In file included from /usr/local/hexagon/include/NCSFile.h:7:0,
from ecwsdk_headers.h:52,
from gdal_ecw.h:45,
from ecwdataset.cpp:34:
/usr/local/hexagon/include/NCSEcw/API/View.h:387:30: note: candidate: virtual NCS::CError NCS::CView:Smiley Surprisedpen(wchar_t*, bool, bool)
NCSECW_IMPEX virtual CError Open(wchar_t *pURLPath, bool bProgressiveDisplay = false, bool bWrite = false);
^~~~
/usr/local/hexagon/include/NCSEcw/API/View.h:387:30: note: no known conversion for argument 1 from ‘VSIIOStream*’ to ‘wchar_t*’
/usr/local/hexagon/include/NCSEcw/API/View.h:396:30: note: candidate: virtual NCS::CError NCS::CView:Smiley Surprisedpen(char*, bool, bool)
NCSECW_IMPEX virtual CError Open(char *pURLPath, bool bProgressiveDisplay = false, bool bWrite = false);
^~~~
/usr/local/hexagon/include/NCSEcw/API/View.h:396:30: note: no known conversion for argument 1 from ‘VSIIOStream*’ to ‘char*’
/usr/local/hexagon/include/NCSEcw/API/View.h:404:30: note: candidate: virtual NCS::CError NCS::CView:Smiley Surprisedpen(const NCS::CString&, bool, bool)
NCSECW_IMPEX virtual CError Open(const CString &URLPath, bool bProgressiveDisplay = false, bool bWrite = false);
^~~~
/usr/local/hexagon/include/NCSEcw/API/View.h:404:30: note: no known conversion for argument 1 from ‘VSIIOStream*’ to ‘const NCS::CString&’
/usr/local/hexagon/include/NCSEcw/API/View.h:417:30: note: candidate: virtual NCS::CError NCS::CView:Smiley Surprisedpen(const CIOStreamPtr&, bool, NCSFileType)
NCSECW_IMPEX virtual CError Open(const CIOStreamPtr &stream, bool bProgressiveDisplay = false, NCSFileType eType = NCS_FILE_UNKNOWN);
^~~~
/usr/local/hexagon/include/NCSEcw/API/View.h:417:30: note: no known conversion for argument 1 from ‘VSIIOStream*’ to ‘const CIOStreamPtr& {aka const std::shared_ptr<NCS::CIOStream>&}’
ecwdataset.cpp:2573:53: error: invalid cast from type ‘NCS::CIOStreamPtr {aka std::shared_ptr<NCS::CIOStream>}’ to type ‘VSIIOStream*’
((VSIIOStream *)(poFileView->GetStream()));

Highlighted
New Contributor
Posts: 2
Registered: ‎12-03-2019

Re: Error when compiling GDAL with ECW support on Redhat Linux using ERDAS ECW/JP2 SDK 5.5

NAME="SLES"
VERSION="11.4"
VERSION_ID="11.4"
PRETTY_NAME="SUSE Linux Enterprise Server 11 SP4"
ID="sles"

 

GeoServer 2.16.0

gdal-2.2.3

ECW/JP2 SDK Server Read-only End-user SDK v5.0 052013

swig-3.0.2

gcc (SUSE Linux) 4.3.4 [gcc-4_3-branch revision 152973]

 

./configure CFLAGS="-std=c99" --with-java --with-ecw=/tmp/geoserver/ecwjp2_sdk

Highlighted
Staff
Posts: 6
Registered: ‎03-02-2020

Re: Error when compiling GDAL with ECW support on Redhat Linux using ERDAS ECW/JP2 SDK 5.5

Do the compression and decompression examples compile and run correctly? If so, please look at the compiler flags in the makefile.

 

Since you are using GCC 5.5 you probably should be using the new ABI (D_GLIBCXX_USE_CXX11_ABI=1) but that depends how your other libraries are compiled. You also have a lot of warnings enabled which may be causing it failure, try changing these.

Highlighted
New Contributor
Posts: 3
Registered: ‎03-25-2020

Re: Error when compiling GDAL with ECW support on Redhat Linux using ERDAS ECW/JP2 SDK 5.5

How can I do this?

 

How can i enable D_GLIBCXX_USE_CXX11_ABI=1 in the compression and decompression examples for testing?

 

i have tried gdal 2.2.4 compile with ECW and CXX11_ABI=1 like:

./configure --with-ecw=/usr/local/hexagon CXXFLAGS="-D_GLIBCXX_USE_CXX11_ABI=1"

but got the same errors.

 

 

Errors:

In file included from ecwdataset.cpp:34:0:
gdal_ecw.h:93:23: error: 'virtual CNCSError JP2UserBox:Smiley Tonguearse(NCS:Smiley FrustratedDK::CFileBase&, NCS::CIOStream&)' marked 'override', but does not override
virtual CNCSError Parse(NCS:Smiley FrustratedDK::CFileBase &JP2File,
^~~~~
gdal_ecw.h:95:23: error: 'virtual CNCSError JP2UserBox::UnParse(NCS:Smiley FrustratedDK::CFileBase&, NCS::CIOStream&)' marked 'override', but does not override
virtual CNCSError UnParse(NCS:Smiley FrustratedDK::CFileBase &JP2File,
^~~~~~~
gdal_ecw.h:93:23: warning: by 'virtual CNCSError JP2UserBox:Smiley Tonguearse(NCS:Smiley FrustratedDK::CFileBase&, NCS::CIOStream&)' [-Woverloaded-virtual]
virtual CNCSError Parse(NCS:Smiley FrustratedDK::CFileBase &JP2File,
^~~~~
gdal_ecw.h:95:23: warning: by 'virtual CNCSError JP2UserBox::UnParse(NCS:Smiley FrustratedDK::CFileBase&, NCS::CIOStream&)' [-Woverloaded-virtual]
virtual CNCSError UnParse(NCS:Smiley FrustratedDK::CFileBase &JP2File,
^~~~~~~
ecwdataset.cpp: In destructor 'virtual ECWDataset::~ECWDataset()':
ecwdataset.cpp:1068:76: error: invalid cast from type 'NCS::CIOStreamPtr {aka std::shared_ptr<NCS::CIOStream>}' to type 'VSIIOStream*'
poUnderlyingIOStream = ((VSIIOStream *)(poFileView->GetStream()));
^
ecwdataset.cpp: In static member function 'static CNCSJP2FileView* ECWDataset:Smiley SurprisedpenFileView(const char*, bool, int&, bool)':
ecwdataset.cpp:2471:59: error: no matching function for call to 'NCS::CView:Smiley Surprisedpen(VSIIOStream*&, bool&)'
oErr = poFileView->Open( poIOStream, bProgressive );
^
In file included from /usr/local/hexagon/include/NCSFile.h:7:0,
from ecwsdk_headers.h:52,
from gdal_ecw.h:45,
from ecwdataset.cpp:34:
/usr/local/hexagon/include/NCSEcw/API/View.h:387:30: note: candidate: virtual NCS::CError NCS::CView:Smiley Surprisedpen(wchar_t*, bool, bool)
NCSECW_IMPEX virtual CError Open(wchar_t *pURLPath, bool bProgressiveDisplay = false, bool bWrite = false);
^~~~
/usr/local/hexagon/include/NCSEcw/API/View.h:387:30: note: no known conversion for argument 1 from 'VSIIOStream*' to 'wchar_t*'
/usr/local/hexagon/include/NCSEcw/API/View.h:396:30: note: candidate: virtual NCS::CError NCS::CView:Smiley Surprisedpen(char*, bool, bool)
NCSECW_IMPEX virtual CError Open(char *pURLPath, bool bProgressiveDisplay = false, bool bWrite = false);
^~~~
/usr/local/hexagon/include/NCSEcw/API/View.h:396:30: note: no known conversion for argument 1 from 'VSIIOStream*' to 'char*'
/usr/local/hexagon/include/NCSEcw/API/View.h:404:30: note: candidate: virtual NCS::CError NCS::CView:Smiley Surprisedpen(const NCS::CString&, bool, bool)
NCSECW_IMPEX virtual CError Open(const CString &URLPath, bool bProgressiveDisplay = false, bool bWrite = false);
^~~~
/usr/local/hexagon/include/NCSEcw/API/View.h:404:30: note: no known conversion for argument 1 from 'VSIIOStream*' to 'const NCS::CString&'
/usr/local/hexagon/include/NCSEcw/API/View.h:417:30: note: candidate: virtual NCS::CError NCS::CView:Smiley Surprisedpen(const CIOStreamPtr&, bool, NCSFileType)
NCSECW_IMPEX virtual CError Open(const CIOStreamPtr &stream, bool bProgressiveDisplay = false, NCSFileType eType = NCS_FILE_UNKNOWN);
^~~~
/usr/local/hexagon/include/NCSEcw/API/View.h:417:30: note: no known conversion for argument 1 from 'VSIIOStream*' to 'const CIOStreamPtr& {aka const std::shared_ptr<NCS::CIOStream>&}'
ecwdataset.cpp:2488:53: error: invalid cast from type 'NCS::CIOStreamPtr {aka std::shared_ptr<NCS::CIOStream>}' to type 'VSIIOStream*'
((VSIIOStream *)(poFileView->GetStream()));
^
../../GDALmake.opt:646: recipe for target '../o/ecwdataset.lo' failed
make[2]: *** [../o/ecwdataset.lo] Error 1

 

Highlighted
New Contributor
Posts: 2
Registered: ‎03-24-2020

Re: Error when compiling GDAL with ECW support on Redhat Linux using ERDAS ECW/JP2 SDK 5.5

Do you have any suggestion ?

 

Highlighted
Staff
Posts: 6
Registered: ‎03-02-2020

Re: Error when compiling GDAL with ECW support on Redhat Linux using ERDAS ECW/JP2 SDK 5.5

Looking closer into this, the GDAL ecw driver has not been updated to be compatible with the 5.5 SDK. Your choices are to use 5.4 for the time being, this should compile fine on Linux with gdal 2.2, 2.3 and 2.4. I will look into getting an updated driver into GDAL that supports the 5.5 API.

Highlighted
New Contributor
Posts: 3
Registered: ‎03-25-2020

Re: Error when compiling GDAL with ECW support on Redhat Linux using ERDAS ECW/JP2 SDK 5.5

i tryed again with gdal 3.0.4 and ecw/jp2 SDK 5.5 Update 1 with and without CXXFLAGS="-D_GLIBCXX_USE_CXX11_ABI=1"

but got the same errors.

 

i also checked at gdal github and found a merge for SDK 5.5 support:

https://github.com/OSGeo/gdal/commit/e5cb5406ea9090b2f17cffeeb7ba5fb49e7158f2

 

so why do i get the same errors?