From 5121c3a77901eb1a23636fbe3b32f1e8eb2ed396 Mon Sep 17 00:00:00 2001 From: Magnus Jacobsson Date: Thu, 29 Jul 2021 07:58:37 +0200 Subject: [PATCH] label: CMake: ensure label symbols are exported from the gvc lib The object modules from the static label lib are statically linked into the gvc shared lib through the common object library which means that their symbols should be exported from gvc instead of imported. Defining GVC_EXPORTS achieves this. This is what the autotools build already does. Fixes this error with MinGW: C:/tools/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: ../label/liblabel.a(xlabels.c.obj):xlabels.c:(.text+0x98): undefined reference to `__imp_zmalloc' C:/tools/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: ../label/liblabel.a(xlabels.c.obj):xlabels.c:(.text+0x1f40): undefined reference to `__imp_zmalloc' --- lib/label/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/label/CMakeLists.txt b/lib/label/CMakeLists.txt index 6acfd3061..5cf937bf8 100644 --- a/lib/label/CMakeLists.txt +++ b/lib/label/CMakeLists.txt @@ -1,3 +1,5 @@ +add_definitions(-DGVC_EXPORTS) + add_library(label STATIC # Header files index.h -- 2.49.0