diff --git a/CMakeLists.txt b/CMakeLists.txt
index 328df14f7c10e5fadf4a6351dd347a944df94cbd..ca6b09c470aa1f0a611647abcc19ce967281190b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -607,7 +607,7 @@ if (OPENDHT_C)
     target_link_libraries(opendht-c PRIVATE opendht)
     if (BUILD_SHARED_LIBS)
         target_compile_definitions(opendht-c PRIVATE OPENDHT_C_BUILD)
-        target_compile_definitions(opendht-c PUBLIC opendht_EXPORTS)
+        target_compile_definitions(opendht-c PUBLIC opendht_c_EXPORTS)
         set_target_properties (opendht-c PROPERTIES SOVERSION ${opendht_VERSION_MAJOR} VERSION ${opendht_VERSION})
     endif()
     install (TARGETS opendht-c DESTINATION ${CMAKE_INSTALL_LIBDIR} EXPORT opendht-c)