[gdal-dev] Preventing symbol export in custom GDAL build
Kai Pastor, DG0YT
dg0yt at darc.de
Wed Dec 10 10:06:14 PST 2025
In vcpkg, x64-windows means MSVC.
And even in the visibility world, you can find libs that get it wrong
when the attention is exclusively on shared libs.
(Studying the proposed libspatialite patch, I believe I spotted
different defaults for visibility in different chunks. Needs more
investigation...)
Am 10.12.25 um 19:02 schrieb Andrew Bell:
>
>
> On Wed, Dec 10, 2025 at 12:55 PM Kai Pastor, DG0YT via gdal-dev
> <gdal-dev at lists.osgeo.org> wrote:
>
> Am 10.12.25 um 17:09 schrieb Andrew Bell via gdal-dev:
>> Hi,
>>
>> All symbols that aren't specifically exported should be hidden if
>> when you build the flag "-fvisibility=hidden" is set. See
>> cmake/helpers/configure.cmake.
>
> I don't think this will help with MSVC and its dllexport declarations.
>
>
> I don't know that this is MSVC. I thought it was a GCC build on
> Windows, but regardless, things are essentially the same (on Windows
> you *must* export all the symbols you want visible). I don't know
> spatialite, but there should be some sort of DLL marker (like CPL_DLL
> in GDAL) that can be turned off when building a static library that
> you then link into GDAL.
>
> This may be helpful:
>
> https://gcc.gnu.org/wiki/Visibility
>
> --
> Andrew Bell
> andrew.bell.ia at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20251210/27333298/attachment.htm>
More information about the gdal-dev
mailing list