我尝试交叉编译BeagleBoard Black的Azure IoT C SDK(https://github.com/azure/azure-iot-sdk-c)。交叉编译azure iot sdk
我的确设置了Debian GNU/Linux 8.7(jessie)Machine并安装了这里描述的工具链:http://exploringbeaglebone.com/chapter7/。
然后我也跟着这里的步骤: https://github.com/Azure/azure-iot-sdk-c/blob/master/doc/SDK_cross_compile_example.md并创建了一个工具链文件:
./build.sh --toolchain-file toolchain-bb.cmake -cl --sysroot=/usr/lib/arm-linux-gnueabihf
以下错误Occures
:INCLUDE(CMakeForceCompiler)
SET(CMAKE_SYSTEM_NAME Linux) # this one is important
SET(CMAKE_SYSTEM_VERSION 1) # this one not so much
# this is the location of the amd64 toolchain targeting the Raspberry Pi
SET(CMAKE_C_COMPILER /usr/bin/arm-linux-gnueabihf-gcc)
SET(CMAKE_FIND_ROOT_PATH /usr/lib/arm-linux-gnueabihf)
# search for programs in the build host directories
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
# for libraries and headers in the target directories
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
我使用调用Azure的SDK的Buildscript
CMake Error at /usr/share/cmake-3.0/Modules/FindPackageHandleStandardArgs.cmake:136 (message):
Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the
system variable OPENSSL_ROOT_DIR (missing: OPENSSL_LIBRARIES
OPENSSL_INCLUDE_DIR)
Call Stack (most recent call first):
/usr/share/cmake-3.0/Modules/FindPackageHandleStandardArgs.cmake:343 (_FPHSA_FAILURE_MESSAGE)
/usr/share/cmake-3.0/Modules/FindOpenSSL.cmake:328 (find_package_handle_standard_args)
c-utility/CMakeLists.txt:141 (find_package)
我试图安装openssl使用:
sudo apt-get install openssl:armhf
但错误依然存在,如果我建源arm64(仅使用Azure的IOT-SDK的build.sh文件)一切工作正常。
如果我克隆OpenSSL和构建它靶臂我得到以下错误:
CMake Error at /usr/share/cmake-3.0/Modules/FindPackageHandleStandardArgs.cmake:136 (message):
Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the
system variable OPENSSL_ROOT_DIR (missing: OPENSSL_LIBRARIES) (found
version "1.1.1")
* * * *时,*库不在*主目录*下搜索库。这正是“SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)”的意思(参见[docs](https://cmake.org/cmake/help/v3.7/variable/CMAKE_FIND_ROOT_PATH_MODE_LIBRARY.html))。 'apt-get'可以和* host *包一起使用。 – Tsyvarev
@Tsyvarev如果我克隆openssl并为它构建它我得到另一个错误,我编辑了问题 – Console
您需要在sysroot下安装OpenSSL,并可能提供一个有关它的位置提示给CMake(可能,建议* OPENSSL_ROOT_DIR *会帮助) 。 – Tsyvarev