镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Mapcache build error #373

Closed
Closed

Description

@szekerest

MapCache doesn't build with the most recent gdal master with the following error

source_gdal.obj : error LNK2019: unresolved external symbol MIN referenced in function CreateWarpedVRT

This is because the MIN macro has been used from cpl_port.h but that has been removed by this commit

OSGeo/gdal@1f41ebc

We need to use MAPCACHE_MIN instead.

Activity

  1. self-assigned this
    on Mar 25, 2026
  2. sebastic commented on Apr 16, 2026

    @sebastic
    Contributor

    We need to use MAPCACHE_MIN instead.

    I used this patch instead:

    --- a/lib/source_gdal.c
    +++ b/lib/source_gdal.c
    @@ -347,9 +347,15 @@ CreateWarpedVRT( GDALDatasetH hSrcDS,
         {
             double dfDesiredXRes = (extent->maxx - extent->minx) / width;
             double dfDesiredYRes = (extent->maxy - extent->miny) / height;
    +#if GDAL_VERSION_NUM >= GDAL_COMPUTE_VERSION(3, 13, 0)
    +        double dfDesiredRes = CPL_MIN( dfDesiredXRes, dfDesiredYRes );
    +        double dfGuessedFullRes = CPL_MIN( adfDstGeoTransform[1],
    +                                   fabs(adfDstGeoTransform[5]) );
    +#else
             double dfDesiredRes = MIN( dfDesiredXRes, dfDesiredYRes );
             double dfGuessedFullRes = MIN( adfDstGeoTransform[1],
                                        fabs(adfDstGeoTransform[5]) );
    +#endif
             double dfApproxDstOvrRatio = dfDesiredRes / dfGuessedFullRes;
    
             GDALRasterBandH hFirstBand = GDALGetRasterBand(hSrcDS, 1);
  3. jmckenna commented on Apr 16, 2026

    @jmckenna
    Member

    @sebastic meaning that the main branch here now still causes you build errors?

  4. sebastic commented on Apr 16, 2026

    @sebastic
    Contributor

    @sebastic meaning that the main branch here now still causes you build errors?

    No, that likely builds successfully. 1.14.1 as used by the Debian package does not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions