Problems to compile libraw with gpr_sdk enabled

Hello,

I downloaded latest beta1 of libraw 0.20, compiled it with gcc 7.3 inside CodeBlocks IDE.
All is working fine.

No I enabled gpr_sdk as follows:
- I set both compiler options USE_GPRSDK and USE_DNGSDK
- I downloaded gpr_sdk from https://github.com/gopro/gpr as given in file README-GoPro.txt
I did no modification to any of these files
- I put the options where to find the *.h files and tried to compile libraw

with command:
x86_64-w64-mingw32-g++.exe -w -m64 -D_WINDOWS -DUNICODE -DWIN32 -DLIBRAW_BUILDLIB -DUSE_JPEG -DUSE_X3FTOOLS -DUSE_6BY9RPI -DUSE_GPRSDK -DUSE_DNGSDK
-I.. -I..\..\LIBJPEG\jpeg-9d-64 -I..\..\GoPro\source\lib\dng_sdk -I..\..\GoPro\source\lib\common\public -I..\..\GoPro\source\lib\gpr_sdk\private
-I..\..\GoPro\source\lib\common\private -c E:\Projects\Project_EIXM\LIBRAW_20BETA-GOPRO\src\libraw_cxx.cpp -o ..\object\debug\LIBRAW_20BETA-GOPRO\src\libraw_cxx.o

and got the following compiler errors:
In file included from E:\Projects\Project_EIXM\LIBRAW_20BETA-GOPRO\src\libraw_cxx.cpp:31:0:

E:\Projects\Project_EIXM\LIBRAW_20BETA-GOPRO\src\integration/dngsdk_glue.cpp:
In function 'dng_ifd* search_for_ifd(const dng_info&, uint64, ushort, ushort, int&, dng_stream&)':
E:\Projects\Project_EIXM\LIBRAW_20BETA-GOPRO\src\integration/dngsdk_glue.cpp:63:34:
error: invalid initialization of reference of type 'const std::vector&' from expression of type 'const AutoPtr [22]'
ret = search_single_ifd(info.fIFD, offset, ifdIndex, stream);
~~~~~^~~~
E:\Projects\Project_EIXM\LIBRAW_20BETA-GOPRO\src\integration/dngsdk_glue.cpp:28:17: note: in passing argument 1 of 'dng_ifd* search_single_ifd(const std::vector&, uint64, int&, dng_stream&)'
static dng_ifd* search_single_ifd(const std::vector & v, uint64 offset, int& idx, dng_stream& stream)
^~~~~~~~~~~~~~~~~

E:\Projects\Project_EIXM\LIBRAW_20BETA-GOPRO\src\integration/dngsdk_glue.cpp:65:44:
error: invalid initialization of reference of type 'const std::vector&' from expression of type 'const AutoPtr [10]'
if (!ret) ret = search_single_ifd(info.fChainedIFD, offset, dummy, stream);
~~~~~^~~~~~~~~~~
E:\Projects\Project_EIXM\LIBRAW_20BETA-GOPRO\src\integration/dngsdk_glue.cpp:28:17: note: in passing argument 1 of 'dng_ifd* search_single_ifd(const std::vector&, uint64, int&, dng_stream&)'
static dng_ifd* search_single_ifd(const std::vector & v, uint64 offset, int& idx, dng_stream& stream)
^~~~~~~~~~~~~~~~~
E:\Projects\Project_EIXM\LIBRAW_20BETA-GOPRO\src\integration/dngsdk_glue.cpp:68:42: error: 'const class dng_info' has no member named 'fChainedSubIFD'; did you mean 'fChainedIFD'?
for (int c = 0; !ret && c < info.fChainedSubIFD.size(); c++)
^~~~~~~~~~~~~~
fChainedIFD
E:\Projects\Project_EIXM\LIBRAW_20BETA-GOPRO\src\integration/dngsdk_glue.cpp:69:42: error: 'const class dng_info' has no member named 'fChainedSubIFD'; did you mean 'fChainedIFD'?
ret = search_single_ifd(info.fChainedSubIFD

, offset, dummy, stream);
                                          ^~~~~~~~~~~~~~
                                          fChainedIFD
 
Can someone point me to the right direction, because I do not see what I am doing wrong.
Any help is appreciated.
Thanks in advance
herb

Forums: 

Thank you for the feedback.

Thank you for the feedback.

Current LibRaw (w/ ability to extract any DNG subframe via shot_select option) relies on DNG SDK 1.4 internals, it is not compatible w/ DNG SDK included into GPR SDK.

Looks like we need to update README.GoPro by removing this option:

I. GPR SDK comes with (patched) Adobe DNG SDK source. You may use this DNG SDK instead of
Adobe's one, or use standard Adobe's distribution.

-- Alex Tutubalin

Followup:

Followup:

1) GPR SDK includes Adobe DNG SDK v1.4 dated May 2012 (according to $datetime in comments).
In this version, dng_info's fIFD and fChainedIFD are AutoPtr arrays of fixed size.

2) In Adobe DNG SDK v1.4 dated June 2015, same fields are std::vector

This is very minor change, it should be easy to adopt, but I do not see any way to distinguish two SDKs at compile time.
It could be selectable by user w/ additional #define (like USE_OUTDATED_DNG_SDK :)

We'll try to solve this problem in beta update (need some time to set-up testbed with outdated DNG SDK included w/ GPR).

Right now we've updated DNG/GPR readme files only: https://github.com/LibRaw/LibRaw/commit/d86f980a5c7d30e7d553156861a108e1...

-- Alex Tutubalin

Finally: old DNG SDK 1.4

Finally: old DNG SDK 1.4 (dated May 2012) is *not* compatible with LibRaw. Internals of dng_info are very different in May 2012 and June 2015 versions, the older one does not have fChainedSubIFD array.

Implementing support for older version is just a big time waste: it will require lot of testing (already done for modern DNG SDK version) and no benefits.

So, you'll need to go second route (via patched modern DNG SDK 1.4), the DNG SDK provided w/ GPR SDK will not fit.

Readmes are updated to reflect this.

-- Alex Tutubalin