I've compiled the latest master branch to Windows, Android, and other platforms
successfully using similar parameters. However, when I try building on the
latest MacOS Catalina (beta) with the latest iOS SDK and XCode targeting iPhone
simulator, I get the following errors:
/Users/[USER]/Documents/cpp/libssh/src/buffer.c:158:9: error: implicit
declaration of function 'explicit_bzero' is invalid in C99
[-Werror,-Wimplicit-function-declaration] explicit_bzero(buffer->data,
buffer->allocated);
^/Users/[USER]/Documents/cpp/libssh/src/buffer.c:207:9: error: implicit
declaration of function 'explicit_bzero' is invalid in C99
[-Werror,-Wimplicit-function-declaration] explicit_bzero(buffer->data,
buffer->used); ^/Users/[USER]/Documents/cpp/libssh/src/buffer.c:243:9:
error: implicit declaration of function 'explicit_bzero' is invalid in C99
[-Werror,-Wimplicit-function-declaration] explicit_bzero(ptr, burn_pos);
^/Users/[USER]/Documents/cpp/libssh/src/buffer.c:268:9: error: implicit
declaration of function 'explicit_bzero' is invalid in C99
[-Werror,-Wimplicit-function-declaration] explicit_bzero(buffer->data,
buffer->allocated);
I configure CMake using with the following options:cmake -G Xcode
-DCMAKE_TOOLCHAIN_FILE=~/Documents/ios-cmake/ios.toolchain.cmake
-DPLATFORM=SIMULATOR64 -DBUILD_SHARED_LIBS=FALSE
-DCMAKE_INSTALL_PREFIX=/usr/local/iossim64
-DCMAKE_SYSTEM_PREFIX_PATH=/usr/local/iossim64 -DWITH_MBEDTLS=TRUE
-DWITH_SERVER=FALSE -DWITH_EXAMPLES=FALSE -DWITH_PCAP=FALSE
~/Documents/cpp/libssh
then build like this:cmake --install . --config Debug-iphonesimulator
I used similar parameters for compiling other libraries but only libssh is
giving me this error. I had to use Mbed TLS because I'm creating a
cross-platform application, and compiling against OpenSSL didn't work for me on
Android.