Hello,
I compiled the new LibRaw 0.21.1 as a Windows DLL - it worked perfectly as a 64-bit DLL, using the 2019 edition of Visual Studio.
I would also like to compile a 32-bit DLL using an older edition of Visual Studio, that works with Windows XP. When I do this, I get lots of these errors:
libraw-0.21.1\libraw\libraw_datastream.h(183) : error C3861: 'data': identifier not found
and
..\src\metadata\sony.cpp(1976) : error C2039: 'data' : is not a member of 'std::vector<_Ty>'
with
[
_Ty=unsigned char
]
The problem is this line in libraw_datastream.h
class buffer_t : public std::vector
{
public:
INT64 _bstart, _bend;
buffer_t() : std::vector(LibRaw_bufio_params::bufsize), _bstart(0), _bend(0) {}
int charOReof(INT64 _fpos)
{
if (_bstart < 0LL || _bend < 0LL || _bend < _bstart || _fpos < 0LL)
return -1;
if ((_bend - _bstart) > (INT64)size())
return -1;
if (_fpos >= _bstart && _fpos < _bend)
return data()[_fpos - _bstart]; //<<------ this one
return -1;
}
I'm pretty good with C, and a bit lacking in C++. I'm not entirely sure what this line is doing, or how to adapt it to work properly with an older C++ compiler.
Any suggestions would be appreciated.
Thanks.
:Jack
We compile 32-bit libraw for
We compile 32-bit libraw for 32-bit RawDigger using MSVC 2010 with no such problem.
data() member is listed for std::vector since C++11
-- Alex Tutubalin @LibRaw LLC
Thanks - this was a helpful
Thanks - this was a helpful clue. I tried compiling it using a slightly less old version of Visual Studio - VS 2013 - and it worked perfectly.
Thanks for your help and for your excellent library. Stay safe.
:Jack
replace with operator[]
return this->operator[](_fpos - _bstart);
Thanks. :Jack
Thanks.
:Jack