Closed linmaosong2018 closed 5 years ago
This appears to be a bug with the ETA CMake. As a temporary measure, does this work if you manually set OPENSSL_INCLUDE_DIR in Cpp-C/Eta/Impl/Codec/CMakeLists.txt as the following?
target_include_directories(librssl
PUBLIC
$<BUILD_INTERFACE:${Eta_SOURCE_DIR}/Include/Codec>
$<BUILD_INTERFACE:${Eta_SOURCE_DIR}/Include/Util>
$<BUILD_INTERFACE:${Eta_SOURCE_DIR}/Include/Transport>
$<BUILD_INTERFACE:${Eta_SOURCE_DIR}/Impl/Util/Include>
PRIVATE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<BUILD_INTERFACE:${Eta_SOURCE_DIR}/Impl/Transport>
$<BUILD_INTERFACE:${Eta_SOURCE_DIR}/Include>
$<BUILD_INTERFACE:${Eta_SOURCE_DIR}/Utils/zlib>
$<BUILD_INTERFACE:${Eta_SOURCE_DIR}/Utils/Lzf>
$<BUILD_INTERFACE:${OPENSSL_INCLUDE_DIR}>
)
As noted in the #83, we are updating our OpenSSL usage, and will have support for OpenSSL 1.1.0 in a future release.
Many thanks, @MitchellKatoTR , this is very helpful. Although, it seems target libssl_shared needs the same fix, so the below is the full fix:
target_include_directories(librssl
PUBLIC
$<BUILD_INTERFACE:${Eta_SOURCE_DIR}/Include/Codec>
$<BUILD_INTERFACE:${Eta_SOURCE_DIR}/Include/Util>
$<BUILD_INTERFACE:${Eta_SOURCE_DIR}/Include/Transport>
$<BUILD_INTERFACE:${Eta_SOURCE_DIR}/Impl/Util/Include>
PRIVATE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<BUILD_INTERFACE:${Eta_SOURCE_DIR}/Impl/Transport>
$<BUILD_INTERFACE:${Eta_SOURCE_DIR}/Include>
$<BUILD_INTERFACE:${Eta_SOURCE_DIR}/Utils/zlib>
$<BUILD_INTERFACE:${Eta_SOURCE_DIR}/Utils/Lzf>
$<BUILD_INTERFACE:${OPENSSL_INCLUDE_DIR}>
)
add_library( librssl_shared SHARED
${rsslSrcFiles} ${rsslWinInetSrcFiles} ${rsslWinRCFiles} rsslVersionShared.c )
target_include_directories(librssl_shared
PUBLIC
$<BUILD_INTERFACE:${Eta_SOURCE_DIR}/Include/Codec>
$<BUILD_INTERFACE:${Eta_SOURCE_DIR}/Include/Util>
$<BUILD_INTERFACE:${Eta_SOURCE_DIR}/Include/Transport>
$<BUILD_INTERFACE:${Eta_SOURCE_DIR}/Impl/Util/Include>
PRIVATE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<BUILD_INTERFACE:${Eta_SOURCE_DIR}/Impl/Transport>
$<BUILD_INTERFACE:${Eta_SOURCE_DIR}/Include>
$<BUILD_INTERFACE:${Eta_SOURCE_DIR}/Utils/zlib>
$<BUILD_INTERFACE:${Eta_SOURCE_DIR}/Utils/Lzf>
$<BUILD_INTERFACE:${OPENSSL_INCLUDE_DIR}>
)
@linmaosong2018 did adding those $<BUILD_INTERFACE>:${OPENSSL_INCLUDE_DIR}
lines help complete the
I was running into the same errors with using an updated version of OpenSSL (1.1.0g) but then manually installed 1.0.2p in my usr/local
folder and re-did the cmake
builds with the updated -DOPENSSL_ROOT_DIR variable but still ran into the same pointer de-referencing error.
@CEAndrews95 yes it worked for me with the workaround. Did you make the change for both librssl and librssl_shared (see above)?
The ideal fix would be what @MitchellKato mentioned: support for a newer version of openssl. Not sure if that's already implemented/released.
This is been addressed with ESDK1.3.0. Please let us know if there are additional findings. Closing.
I have been trying to build the C++ SDK on Linux. My system's OpenSSL library is 1.10. Due to issue #83 , I manually installed OpenSSL v1.0.2 under
/usr/local/ssl
. And I am passing the path tocmake
withcmake -DOPENSSL_ROOT_DIR=/usr/local/ssl -DOPENSSL_LIBRARIES=/usr/local/ssl/lib <sdk_path>
This would appear to work, as cmake outputs the following
-- Found OpenSSL: /usr/local/ssl/lib/libcrypto.a (found version "1.0.2j")
However, the build still fails:
Diagnosing further with
gcc -E
, it looks like the Eta build doesn't honour what has been set by cmakeSo it is still looking at the system's default OpenSSL under
/usr/include/
.