[ 65%] Building C object src/CMakeFiles/mosquitto.dir/logging.c.o
/Users/tristan/Coding/mosquitto/src/logging.c:97:2: error: implicit declaration of function 'gettimeofday' is invalid in C99
[-Werror,-Wimplicit-function-declaration]
gettimeofday(&tv, NULL);
^
I had to add
#include <sys/time.h>
to the logging.c file
(update see comment below... me forgot params) Also, it seems that it does not link the crypto correctly although cmake output is correct it links it to the apple one when using brew...
-- Found OpenSSL: /usr/local/opt/openssl/lib/libcrypto.dylib (found version "1.1.1h")
But when compiling...
[ 33%] Linking C shared library libmosquitto.dylib
ld: cannot link directly with dylib/framework, your binary is not an allowed client of /usr/lib/libcrypto.dylib for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [lib/libmosquitto.1.6.12.dylib] Error 1
When I tried the fixes branch to compile to fix https://github.com/eclipse/mosquitto/issues/1831 , got same sort of error as https://github.com/eclipse/mosquitto/issues/1831 only in a different file.
I had to add
#include <sys/time.h>
to the logging.c file
(update see comment below... me forgot params) Also, it seems that it does not link the crypto correctly although cmake output is correct it links it to the apple one when using brew...
Running:
cmake --DOPENSSL_ROOT_DIR=/usr/local/opt/openssl/lib -DOPENSSL_INCLUDE_DIR=/usr/local/opt/openssl/include .
-- Found OpenSSL: /usr/local/opt/openssl/lib/libcrypto.dylib (found version "1.1.1h")
But when compiling...
Fix for that was here... https://gist.github.com/llbbl/c54f44d028d014514d5d837f64e60bac by changing the version number from 1.1.1d to 1.1.1h
Reference https://stackoverflow.com/questions/58446253/xcode-11-ld-error-your-binary-is-not-an-allowed-client-of-usr-lib-libcrypto-dy
A very happy compilation... without error on [33%] and [66%] :-)