This is still a problem when compiling from source on El Capitan.
Building using:
make -D "CMAKE_OSX_ARCHITECTURES:STRING=x86_64" -DOPENSSL_INCLUDE_DIR=/usr/local/Cellar/openssl/1.0.2e/include/ -DOPENSSL_LIBRARIES=/usr/local/Cellar/openssl/1.0.2e/lib/ . && make
Specified SSL since cmake was unable to find / utilize the system's built in SSL.
Undefined symbols for architecture x86_64:
"_ERR_remove_thread_state", referenced from:
_winpr_CleanupSSL in libwinpr.a(ssl.c.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: ** [client/Mac/MacFreeRDP.framework/Versions/1.1.0/MacFreeRDP] Error 1
make[1]: ** [client/Mac/CMakeFiles/MacFreeRDP-library.dir/all] Error 2
make: *** [all] Error 2
Despite me specifying paths to OPENSSL it appears to try and link against the system SSL library
-- Finding required feature OpenSSL for cryptography (encryption, certificate validation, hashing functions)
-- Found OpenSSL: /usr/lib/libssl.dylib;/usr/lib/libcrypto.dylib (found version "0.9.8zg")
From CMakeCache.txt
//Path to a library.
OPENSSL_CRYPTO_LIBRARY:FILEPATH=/usr/lib/libcrypto.dylib
//Path to a file.
OPENSSL_INCLUDE_DIR:PATH=/usr/local/Cellar/openssl/1.0.2e/include
Modifying to:
cmake -D "CMAKE_OSX_ARCHITECTURES:STRING=x86_64" -DOPENSSL_INCLUDE_DIR=/usr/local/Cellar/openssl/1.0.2e/include/ -DOPENSSL_CRYPTO_LIBRARY=/usr/local/Cellar/openssl/1.0.2e/lib/libcrypto.dylib
Allowed for proper compilation.
Don't use version 1.0.2e.
brew install openssl098
then compile with:
cmake -DWITH_X11=ON -D "CMAKE_OSX_ARCHITECTURES:STRING=x86_64" -DOPENSSL_INCLUDE_DIR=/usr/local/Cellar/openssl098/0.9.8zh/include/ -DOPENSSL_CRYPTO_LIBRARY=/usr/local/Cellar/openssl098/0.9.8zh/lib/libcrypto.dylib .
@jmdevince the problem you are hitting is that, although El Capitan doesn't come with openssl headers, they still ship a pkg-config file (/usr/lib/pkgconfig/libssl.pc with version 0.9.8zg). The detection script finds this pkg-config file but uses lib you supply but the Version from the pkg-config file -> linking error. That is also why installing openssl098 helps and fixes your problem.
To properly use a recent version with brew you should set the PKG_CONFIG_PATH to the brew directory of openssl before running cmake:
export PKG_CONFIG_PATH=$(brew --prefix)/opt/openssl/lib/pkgconfig
This way you don't need todo any extra settings. Just run cmake -DWITH_X11=ON
If you try this make sure you remove the CMakeCache.txt (or do a git clean) before.
@jmdevince btw
If you already use brew you could also do a
brew install homebrew/x11/freerdp --HEAD
to get the latest xfreerdp.
I would suggest updating the documentation to reflect proper compilation procedure on Mac.
https://github.com/FreeRDP/FreeRDP/wiki/Compilation#compiling-from-sources does not reflect the instructions you just gave me and does nobody any good unless it's documented.
@bmiklautz
Was getting the same OpenSSL undefined symbol error with the latest HEAD (aece090) on El Capitan. Adding the export PKG_CONFIG_PATH=$(brew --prefix)/opt/openssl/lib/pkgconfig to the top of my build script fixed the issue for me.
Most helpful comment
I would suggest updating the documentation to reflect proper compilation procedure on Mac.
https://github.com/FreeRDP/FreeRDP/wiki/Compilation#compiling-from-sources does not reflect the instructions you just gave me and does nobody any good unless it's documented.