Closed rymdbullen closed 10 years ago
Check the LDFLAGS setting in the Makefile, and/or amend it to your
needs. If you want Mysql only, LDFLAGS will have to be set to something
like -lmosquitto -lmysql
, depending on your platform. (Find the exact
location of the Mysql libs by running "mysql_config --libs".)
You will not need these:
/usr/bin/ld: cannot find -lpq /usr/bin/ld: cannot find -lsqlite3 /usr/bin/ld: cannot find -lhiredis /usr/bin/ld: cannot find -lldap /usr/bin/ld: cannot find -llber
but you will need -lmosquitto, which is provided as mosquitto-dev or some such package.
Also, please make sure you're using an up-to-date version of Mosquitto and its libraries; check mosquitto.org on how to set up your system to grab from Mosquitto's repository.
Works like charm. Thank you very much for your swift response.
May I add that the solution was to keep only the needed LDFLAGS and install the libmosquitto-dev package.
I've got some troubles compiling the mosquitto-auth-plugin on a raspberyy pi running RASPBIAN, Version:June 2014, Release date:2014-06-20.
I want to run the backend mysql and I've installed the prerequisites:
mosquitto (1.3.2) mosquitto-clients python-mosquitto (from http://repo.mosquitto.org/debian/mosquitto-repo) mysql-server-5.5 libmysqlclient-dev libssl-dev
I've only enabled the mysql backend:
BACKENDS=-DBE_MYSQL
But the compiler complaints:
openhab@openhab ~/checkout/mosquitto-auth-plug $ make clean && make rm -f .o .so (cd contrib/tinycdb-0.78; make realclean ) make[1]: Entering directory `/home/openhab/checkout/mosquitto-auth-plug/contrib/tinycdb-0.78' rm -f .o .lo core ~ libcdb[.][aps]_ libnss_cdb.so.2* cdb cdb-shared make[1]: Leaving directory
/home/openhab/checkout/mosquitto-auth-plug/contrib/tinycdb-0.78' cc -I/home/openhab/checkout/mosquitto-1.3.2/src/ -I/home/openhab/checkout/mosquitto-1.3.2/lib/ -fPIC -Wall -Werror -DBE_MYSQL
mysql_config --cflags-Icontrib/tinycdb-0.78// -I/usr/local/include/hiredis -I/usr/include -I/src -DDEBUG=1 -I/usr/include/openssl/include -c -o auth-plug.o auth-plug.c cc -I/home/openhab/checkout/mosquitto-1.3.2/src/ -I/home/openhab/checkout/mosquitto-1.3.2/lib/ -fPIC -Wall -Werror -DBE_MYSQL
mysql_config --cflags-Icontrib/tinycdb-0.78// -I/usr/local/include/hiredis -I/usr/include -I/src -DDEBUG=1 -I/usr/include/openssl/include -c -o base64.o base64.c cc -I/home/openhab/checkout/mosquitto-1.3.2/src/ -I/home/openhab/checkout/mosquitto-1.3.2/lib/ -fPIC -Wall -Werror -DBE_MYSQL
mysql_config --cflags-Icontrib/tinycdb-0.78// -I/usr/local/include/hiredis -I/usr/include -I/src -DDEBUG=1 -I/usr/include/openssl/include -c -o pbkdf2-check.o pbkdf2-check.c cc -I/home/openhab/checkout/mosquitto-1.3.2/src/ -I/home/openhab/checkout/mosquitto-1.3.2/lib/ -fPIC -Wall -Werror -DBE_MYSQL
mysql_config --cflags-Icontrib/tinycdb-0.78// -I/usr/local/include/hiredis -I/usr/include -I/src -DDEBUG=1 -I/usr/include/openssl/include -c -o log.o log.c cc -I/home/openhab/checkout/mosquitto-1.3.2/src/ -I/home/openhab/checkout/mosquitto-1.3.2/lib/ -fPIC -Wall -Werror -DBE_MYSQL
mysql_config --cflags-Icontrib/tinycdb-0.78// -I/usr/local/include/hiredis -I/usr/include -I/src -DDEBUG=1 -I/usr/include/openssl/include -c -o hash.o hash.c cc -I/home/openhab/checkout/mosquitto-1.3.2/src/ -I/home/openhab/checkout/mosquitto-1.3.2/lib/ -fPIC -Wall -Werror -DBE_MYSQL
mysql_config --cflags-Icontrib/tinycdb-0.78// -I/usr/local/include/hiredis -I/usr/include -I/src -DDEBUG=1 -I/usr/include/openssl/include -c -o be-psk.o be-psk.c cc -I/home/openhab/checkout/mosquitto-1.3.2/src/ -I/home/openhab/checkout/mosquitto-1.3.2/lib/ -fPIC -Wall -Werror -DBE_MYSQL
mysql_config --cflags-Icontrib/tinycdb-0.78// -I/usr/local/include/hiredis -I/usr/include -I/src -DDEBUG=1 -I/usr/include/openssl/include -c -o be-cdb.o be-cdb.c cc -I/home/openhab/checkout/mosquitto-1.3.2/src/ -I/home/openhab/checkout/mosquitto-1.3.2/lib/ -fPIC -Wall -Werror -DBE_MYSQL
mysql_config --cflags-Icontrib/tinycdb-0.78// -I/usr/local/include/hiredis -I/usr/include -I/src -DDEBUG=1 -I/usr/include/openssl/include -c -o be-mysql.o be-mysql.c cc -I/home/openhab/checkout/mosquitto-1.3.2/src/ -I/home/openhab/checkout/mosquitto-1.3.2/lib/ -fPIC -Wall -Werror -DBE_MYSQL
mysql_config --cflags-Icontrib/tinycdb-0.78// -I/usr/local/include/hiredis -I/usr/include -I/src -DDEBUG=1 -I/usr/include/openssl/include -c -o be-sqlite.o be-sqlite.c cc -I/home/openhab/checkout/mosquitto-1.3.2/src/ -I/home/openhab/checkout/mosquitto-1.3.2/lib/ -fPIC -Wall -Werror -DBE_MYSQL
mysql_config --cflags-Icontrib/tinycdb-0.78// -I/usr/local/include/hiredis -I/usr/include -I/src -DDEBUG=1 -I/usr/include/openssl/include -c -o be-redis.o be-redis.c cc -I/home/openhab/checkout/mosquitto-1.3.2/src/ -I/home/openhab/checkout/mosquitto-1.3.2/lib/ -fPIC -Wall -Werror -DBE_MYSQL
mysql_config --cflags-Icontrib/tinycdb-0.78// -I/usr/local/include/hiredis -I/usr/include -I/src -DDEBUG=1 -I/usr/include/openssl/include -c -o be-postgres.o be-postgres.c cc -I/home/openhab/checkout/mosquitto-1.3.2/src/ -I/home/openhab/checkout/mosquitto-1.3.2/lib/ -fPIC -Wall -Werror -DBE_MYSQL
mysql_config --cflags-Icontrib/tinycdb-0.78// -I/usr/local/include/hiredis -I/usr/include -I/src -DDEBUG=1 -I/usr/include/openssl/include -c -o be-ldap.o be-ldap.c (cd contrib/tinycdb-0.78; make libcdb.a cdb ) make[1]: Entering directory
/home/openhab/checkout/mosquitto-auth-plug/contrib/tinycdb-0.78' cc -fPIC -O -D_FILE_OFFSET_BITS=64 -c cdb_init.c cc -fPIC -O -D_FILE_OFFSET_BITS=64 -c cdb_find.c cc -fPIC -O -D_FILE_OFFSET_BITS=64 -c cdb_findnext.c cc -fPIC -O -D_FILE_OFFSET_BITS=64 -c cdb_seq.c cc -fPIC -O -D_FILE_OFFSET_BITS=64 -c cdb_seek.c cc -fPIC -O -D_FILE_OFFSET_BITS=64 -c cdb_unpack.c cc -fPIC -O -D_FILE_OFFSET_BITS=64 -c cdb_make_add.c cc -fPIC -O -D_FILE_OFFSET_BITS=64 -c cdb_make_put.c cc -fPIC -O -D_FILE_OFFSET_BITS=64 -c cdb_make.c cc -fPIC -O -D_FILE_OFFSET_BITS=64 -c cdb_hash.c rm -f libcdb.a ar rv libcdb.a cdb_init.o cdb_find.o cdb_findnext.o cdb_seq.o cdb_seek.o cdb_unpack.o cdb_make_add.o cdb_make_put.o cdb_make.o cdb_hash.o ar: creating libcdb.a a - cdb_init.o a - cdb_find.o a - cdb_findnext.o a - cdb_seq.o a - cdb_seek.o a - cdb_unpack.o a - cdb_make_add.o a - cdb_make_put.o a - cdb_make.o a - cdb_hash.o ranlib libcdb.a cc -fPIC -O -D_FILE_OFFSET_BITS=64 -c cdb.c cc -fPIC -o cdb cdb.o libcdb.a make[1]: Leaving directory/home/openhab/checkout/mosquitto-auth-plug/contrib/tinycdb-0.78' cc -fPIC -shared auth-plug.o base64.o pbkdf2-check.o log.o hash.o be-psk.o be-cdb.o be-mysql.o be-sqlite.o be-redis.o be-postgres.o be-ldap.o -o auth-plug.so -L/usr/include/openssl/lib -lcrypto contrib/tinycdb-0.78/libcdb.a
mysql_config --libs` -lpq -Lcontrib/tinycdb-0.78 -lcdb -lsqlite3 -L/usr/local/lib -lhiredis -L/usr/lib -lldap -llber -L/usr/include/openssl/lib -lcrypto -L/home/openhab/checkout/mosquitto-1.3.2/lib/ -lmosquitto /usr/bin/ld: cannot find -lpq /usr/bin/ld: cannot find -lsqlite3 /usr/bin/ld: cannot find -lhiredis /usr/bin/ld: cannot find -lldap /usr/bin/ld: cannot find -llber /usr/bin/ld: cannot find -lmosquitto collect2: ld returned 1 exit status make: *\ [auth-plug.so] Error 1What do I need to do to have the compiler find these libraries?
Thanks in advance!