#1363·hiredis

WINDOWS_EXPORT_ALL_SYMBOLS in CMakeLists.txt leads to linker errors in client programs

Author: VolkerEnderleinCreated Aug 28, 2026Updated Aug 28, 2026

As WINDOWS_EXPORT_ALL_SYMBOLS exports all linker symbols from the DLL built, many symbols that should not have been exported are visible and may lead to linker errors in client programs.

legacy_stdio_definitions.lib(legacy_stdio_definitions.obj) : error LNK2005: __imp_sprintf is already defined in hiredisd.lib(h iredisd.dll).

This happened to me in a Qt program linking to the hiredisd.dll via the import library hiredisd.lib.

hiredis should only export the public API functions from the DLL.