Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[mosquitto-dev] undefined reference to `mosquitto_client_id'

Hi, guys. Some time ago I developed an auth plugin for mosquitto in Go using cgo (, which works fine with mosquitto 1.4.x.

Recently I tried to add 1.5.x support, but I'm facing undefined functions when trying to build:
/tmp/go-build392224134/b001/_x003.o: In function `mosquitto_auth_acl_check':
./auth-plugin.c:86: undefined reference to `mosquitto_client_id'
./auth-plugin.c:87: undefined reference to `mosquitto_client_username'

As you can see at, mosquitto_broker.h is included. I thought an older version of libmosquitto could be the problem, so I ran rm /usr/local/lib/libmosquitto*and rebuilt mosquitto 1.5.3. All the headers, mosquitto.hmosquitto_plugin.h and mosquitto_broker.h are present at /usr/local/include, which is shown when printing gcc's and g++'s include paths with gcc -xc -E -v - (same for g++), but I still have the problem. I tried this at my personal machine and on a fresh docker instance, still no luck.

Am I missing something when building mosquitto?

Back to the top