From 9c1e160a31fc35cccf0f2a2bcf49eea87cb1a9fa Mon Sep 17 00:00:00 2001 From: Povilas Kanapickas Date: Wed, 21 Sep 2022 04:50:12 +0300 Subject: [PATCH] Use internal linkage for symbols from stb_image.h This makes it possible to link geogram statically into an executable with another static library that includes stb_image.h without hiding its symbols. --- src/lib/geogram/image/image_serializer_stb.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/lib/geogram/image/image_serializer_stb.cpp b/src/lib/geogram/image/image_serializer_stb.cpp index c1a1320c3d96..4ea9e7121b66 100644 --- a/src/lib/geogram/image/image_serializer_stb.cpp +++ b/src/lib/geogram/image/image_serializer_stb.cpp @@ -44,6 +44,11 @@ #define STB_IMAGE_IMPLEMENTATION #define STB_IMAGE_WRITE_IMPLEMENTATION +// Use internal linkage for symbols from stb_image as it is a very commonly embedded library. +// Making these symbols visible causes duplicate symbol problems if geogram is linked +// statically together with another library or executable that also embeds stb_image. +#define STB_IMAGE_STATIC + // [Bruno] I got too many complaints in STB so I "close my eyes" :-) #ifdef __GNUC__ #ifndef __ICC