clang-cl dll build error
There are duplicate vars because of https://gitlab.gnome.org/GNOME/libxml2/-/blob/master/include/libxml/xmlexports.h#L61
Extern C variables on msvc must be declared as extern __declspec(dllexport)
.
MSVC accepts this without extern
, clang-cl for some reason does not.
With extern
both compilers build fine, but this must checked with existing tests.
d:\dev\cppan2\client2>sw build -compiler clang-cl org.sw.demo.xmlsoft.libxml2-2.9.10
[69/69] [org.sw.demo.xmlsoft.libxml2-2.9.10].dll
Exception in file D:\dev\cppan2\client2\src\sw\builder\command.cpp:761, function execute1: When executing: [org.sw.demo.xmlsoft.libxml2-2.9.10].dll
HTMLtree.c.7083984b.obj : error LNK2005: xmlStringText already defined in HTMLparser.c.43034cf8.obj
... tons of such errors
Creating library D:/dev/swst/pkg/63/c5/6249/obj/bld/530341/lib/org.sw.demo.xmlsoft.libxml2-2.9.10.lib and object D:/dev/swst/pkg/63/c5/6249/obj/bld/530341/lib/org.sw.demo.xmlsoft.libxml2-2.9.10.exp
D:\dev\swst\pkg\63\c5\6249\obj\bld\530341\bin\org.sw.demo.xmlsoft.libxml2-2.9.10.dll : fatal error LNK1169: one or more multiply defined symbols found
command failed: exit code = 1169 (0x491)
Total errors: 1