libxml2 and msys2/mingw static
I have this error for $(shell pkg-config --libs --static --cflags libxml-2.0)
in Makefile (in CalculiX FEA program: http://www.dhondt.de/):
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/mingw64/lib\libnetcdf.a(ncxml_xml2.c.obj):(.text+0x13): undefined reference to `__imp_xmlCleanupParser'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/mingw64/lib\libnetcdf.a(ncxml_xml2.c.obj):(.text+0x38): undefined reference to `__imp_xmlReadMemory'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/mingw64/lib\libnetcdf.a(ncxml_xml2.c.obj):(.text+0x53): undefined reference to `__imp_xmlFreeDoc'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/mingw64/lib\libnetcdf.a(ncxml_xml2.c.obj):(.text+0x63): undefined reference to `__imp_xmlDocGetRootElement'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/mingw64/lib\libnetcdf.a(ncxml_xml2.c.obj):(.text+0x9a): undefined reference to `__imp_xmlGetProp'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe:CC:/msys64/mingw64/lib\libnetcdf.a(ncxml_xml2.c.obj):(.text+0xb4): undefined reference to `__imp_xmlFree'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/mingw64/lib\libnetcdf.a(ncxml_xml2.c.obj):(.text+0x17d): undefined reference to `__imp_xmlNodeGetContent'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/mingw64/lib\libnetcdf.a(ncxml_xml2.c.obj):(.text+0x199): undefined reference to `__imp_xmlFree'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/mingw64/lib\libnetcdf.a(ncxml_xml2.c.obj):(.text+0x289): undefined reference to `__imp_xmlNodeListGetString'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/mingw64/lib\libnetcdf.a(ncxml_xml2.c.obj):(.text+0x290): undefined reference to `__imp_xmlFree'
collect2.exe: error: ld returned 1 exit status
but if I replace it by /mingw64/lib/libxml2.dll.a this error no longer occurs, however the program requires dynamic libraries, my goal is a fully static exe file (about 2 - 3 years ago I had a completely static version: https://calculix.discourse.group/t/calculix-and-pastix-solver-windows-version/130/51?u=rafal.brzegowy)
Required dll libraries:
libiconv-2.dll
liblzma-5.dll
libxml2-2.dll
zlib1.dll
Source files: https://github.com/gustafson/CalculiX/tree/exodus
My original post: https://github.com/msys2/MINGW-packages/issues/19485
Edited by Rafał Brzegowy