From 53fef718971dc4d9fabea8939e56ed7556269c48 Mon Sep 17 00:00:00 2001 From: yoyixms <21124824+yoyixms@users.noreply.github.com> Date: Wed, 23 Sep 2026 07:11:02 +0200 Subject: [PATCH] modbus: export the libmodbus_version_* variables from the DLL They were declared without MODBUS_API, so an MSVC build of modbus.dll did not export them and programs using them, such as tests/version.c, failed to link. MinGW builds did not notice thanks to auto-import. --- src/modbus.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/modbus.h b/src/modbus.h index 237d3e11f..424994fc8 100644 --- a/src/modbus.h +++ b/src/modbus.h @@ -150,9 +150,9 @@ enum { #define EMBMDATA (EMBXGTAR + 5) #define EMBBADSLAVE (EMBXGTAR + 6) -extern const unsigned int libmodbus_version_major; -extern const unsigned int libmodbus_version_minor; -extern const unsigned int libmodbus_version_micro; +MODBUS_API extern const unsigned int libmodbus_version_major; +MODBUS_API extern const unsigned int libmodbus_version_minor; +MODBUS_API extern const unsigned int libmodbus_version_micro; typedef struct _modbus modbus_t;