[gdal-dev] Current SVN doesn't build with VS

Kurt Schwehr schwehr at gmail.com
Fri Nov 13 14:16:01 PST 2015


Hi Joaquim,

Yes, MAX should work - that was what was originally in the code.  I'm
trying hard to get away from macros and such and get to the most robust
code we can.  I really want to find a way that we can use std::max
<http://www.cplusplus.com/reference/algorithm/max/> which is the C++ way to
get the maximum value.  I'd like to get macro usage down as far as possible
in the C++ and only use them in pure C code.  There are limits, but
std::max shouldn't be one of them.  Any help would be greatly appreciated.

Thanks!
-kurt

On Fri, Nov 13, 2015 at 11:28 AM, Joaquim Luis <jluis at ualg.pt> wrote:

> Hi Kurt,
>
> I'll update but later. Now I have to go. Meanwhile I had replaced
>  std::max by MAX and it passed that point.
>
>
>
> Hi Joaquim,
>
> I broke the build with https://trac.osgeo.org/gdal/changeset/31403/.
> Even created a ticket: https://trac.osgeo.org/gdal/ticket/6212 and I
> added your error message to the ticket.
>
> http://build.gisinternals.com/sdk/Default.aspx has been down, so it's
> been tough to see what is happening.
>
> It looks like with my latest fix that the max macro is indeed gone, but
> now it looks like you are hitting trouble with C++11.  I've just submitted
> https://trac.osgeo.org/gdal/changeset/31463 which might fix the issue.
> Can you do a svn update, try again and let me know what you get?
>
> Thanks,
> -kurt
>
>
>
> On Fri, Nov 13, 2015 at 10:46 AM, Joaquim Luis <jluis at ualg.pt> wrote:
>
>> The error is
>>
>> v:\gdal\frmts\hdf4\hdf4imagedataset.cpp(2386) : error C2784: '_Ty
>> std::max(std::initializer_list<_Elem>,_Pr)' : could not deduce template
>> argument for 'std::initializer_list<_Elem>' from 'int'
>>         c:\program files (x86)\microsoft visual studio
>> 12.0\vc\include\algorithm(4108) : see declaration of 'std::max'
>>
>> Joaquim
>> _______________________________________________
>> gdal-dev mailing list
>> gdal-dev at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>
>
>
>
> --
> --
> http://schwehr.org
>
>
>
>
>


-- 
--
http://schwehr.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20151113/e573d01e/attachment.html>


More information about the gdal-dev mailing list