首页 > 解决方案 > 加载 plugin.so 错误:未定义符号“mosquitto_client_username”

问题描述

为什么我的插件通过编译,但无法从 conf 文件加载?

mosquitto -c mosquitto.conf
1612271905: mosquitto version 2.0.5 starting
1612271905: Config loaded from mosquitto.conf.
1612271905: Loading plugin: /usr/home/bluse/mosquitto-pg-auth-plug/auth-plugin.so
1612271905: Error: Unable to load auth plugin "/usr/home/bluse/mosquitto-pg-auth-plug/auth-plugin.so".
1612271905: Load error: /usr/home/bluse/mosquitto-pg-auth-plug/auth-plugin.so: Undefined symbol "mosquitto_client_username"

编译命令是:

cc -I/usr/local/include -I`pg_config --includedir` -L/usr/local/lib -L`pg_config --libdir` -lpq -fPIC -shared auth_plugin.c -o auth-plugin.so

我错过了什么吗?帮助!

标签: pluginsmosquitto

解决方案


使用 mosquitto 修复分支,或使用 v2.0.7 版本


推荐阅读