[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 (https://github.com/iegomez/mosquitto-go-auth), 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 https://github.com/iegomez/mosquitto-go-auth/blob/new-mosquitto/auth-plugin.c, 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?