So this doesn't change how libxml2 is built. When libxml2 is built without this it defines the symbol dllMain. Which when you statically link with an exe it is absolutely fine. However, if you link libxml into a shared library, that library defines dllMain on Windows so you get duplicate symbols. If you look for it in the libxml code it just renames dllMain to xmlMain. libxml2 should still be built the same way it always has with CMake.