zhaojh329 / rtty

🐛 Access your terminal from anywhere via the web.
MIT License
3.7k stars 505 forks source link

交叉编译时报错,求大神给看看 #99

Closed matthuo333 closed 2 years ago

matthuo333 commented 3 years ago

Environment

rtty

rttys

Description

在交叉编译时报错:

[ 7%] Building C object src/ssl/CMakeFiles/xssl.dir/openssl.c.o In file included from /usr/include/openssl/ssl.h:146:0, from /root/rtty/src/ssl/openssl.c:51: /usr/include/openssl/e_os2.h:56:33: fatal error: openssl/opensslconf.h: No such file or directory compilation terminated. src/ssl/CMakeFiles/xssl.dir/build.make:62: recipe for target 'src/ssl/CMakeFiles/xssl.dir/openssl.c.o' failed make[2]: [src/ssl/CMakeFiles/xssl.dir/openssl.c.o] Error 1 CMakeFiles/Makefile2:153: recipe for target 'src/ssl/CMakeFiles/xssl.dir/all' failed make[1]: [src/ssl/CMakeFiles/xssl.dir/all] Error 2 Makefile:127: recipe for target 'all' failed make: *** [all] Error 2

Formating code blocks by wrapping them with pairs of ```

matthuo333 commented 3 years ago

openssl 编译安装 1.0.2 后解决了。但是又出现之下问题:

image

matthuo333 commented 3 years ago

我最终在编译前,禁用了ssl. 编译完了。但是,运行后,又出现如下提示:

rtty: error while loading shared libraries: /usr/lib/libev.so.4: internal error

shakespark commented 3 years ago

libev.so.4没放上去还是编的不对?

matthuo333 commented 3 years ago

按照说明,已经做了软连接。仍然这个提示。

shakespark commented 3 years ago

还是/usr/lib/libev.so.4有问题。运行时只需要这个so,你不做软链接也可以的

matthuo333 commented 3 years ago

还是/usr/lib/libev.so.4有问题。运行时只需要这个so,你不做软链接也可以的

编译后,只有这个文件:ibev.so.4.0.0 其他默认都是软链接文件

matthuo333 commented 3 years ago

image

shakespark commented 3 years ago

附上我昨晚交叉编译(arm7架构)的步骤供参考

export GCC_ARM_PATH="/home/dtvl/xxx/build/toolchain/gcc-4.9-2016.02-x86_64_arm-linux-gnueabi" export GCC_ARM_GCC="${GCC_ARM_PATH}/bin/arm-linux-gnueabi-gcc" export GCC_ARM_GXX="${GCC_ARM_PATH}/bin/arm-linux-gnueabi-g++" export GCC_ARM_LIB_PATH="${GCC_ARM_PATH}/lib" export GCC_ARM_INCLUDE_PATH="${GCC_ARM_PATH}/include"

编译libev export LIBEV_PATH="/home/dtvl/rtty-client/libev" ./configure --prefix=${LIBEV_PATH}/OUT --host=arm-linux-gnueabi CC=${GCC_ARM_GCC} CXX=${GCC_ARM_GXX} LDFLAGS="-L${GCC_ARM_LIB_PATH}" CPPFLAGS="-I${GCC_ARM_INCLUDE_PATH}" make install

编译rtty cmake -DCMAKE_INSTALL_PREFIX:PATH=/home/dtvl/rtty-client/rtty/OUT . -DCMAKE_C_COMPILER=${GCC_ARM_GCC} -DCMAKE_FIND_ROOT_PATH=${LIBEV_PATH}/OUT -DSSL_SUPPORT=OFF make install

matthuo333 commented 3 years ago

附上我昨晚交叉编译(arm7架构)的步骤供参考

export GCC_ARM_PATH="/home/dtvl/xxx/r14_ltev2x_app/build/toolchain/gcc-4.9-2016.02-x86_64_arm-linux-gnueabi"

export GCC_ARM_GCC="${GCC_ARM_PATH}/bin/arm-linux-gnueabi-gcc"

export GCC_ARM_GXX="${GCC_ARM_PATH}/bin/arm-linux-gnueabi-g++"

export GCC_ARM_LIB_PATH="${GCC_ARM_PATH}/lib"

export GCC_ARM_INCLUDE_PATH="${GCC_ARM_PATH}/include"

编译libev

export LIBEV_PATH="/home/dtvl/rtty-client/libev"

./configure --prefix=${LIBEV_PATH}/OUT --host=arm-linux-gnueabi CC=${GCC_ARM_GCC} CXX=${GCC_ARM_GXX} LDFLAGS="-L${GCC_ARM_LIB_PATH}" CPPFLAGS="-I${GCC_ARM_INCLUDE_PATH}"

make install

编译rtty

cmake -DCMAKE_INSTALL_PREFIX:PATH=/home/dtvl/rtty-client/rtty/OUT . -DCMAKE_C_COMPILER=${GCC_ARM_GCC} -DCMAKE_FIND_ROOT_PATH=${LIBEV_PATH}/OUT -DSSL_SUPPORT=OFF

make install

你的编译环境是什么系统?

shakespark commented 3 years ago

本机是ubuntu,交叉编译出arm7

matthuo333 commented 3 years ago

嗯,回头按照你这个步骤试试,先谢谢大神

matthuo333 commented 3 years ago

本机是ubuntu,交叉编译出arm7

刚查了SOC,是armv8 麻烦再请教,这样需要改哪些参数呢?

shakespark commented 3 years ago

把你的交叉工具链路径传的正确就行。 如果你之前交叉编译工具链已经正常编出来你板子上可以跑的程序,那么这个也一样的编