首页 > 解决方案 > 在 yocto 中使用 ssl 支持构建 pjproject 时未定义的引用

问题描述

我试图在 yocto 中使用 ssl 支持交叉编译 pjproject,但尝试构建 pjlib-test 时出错。我尝试在我的 .bb 文件中将 openssl 包添加到 DEPENDS,但没有任何变化。任何帮助,将不胜感激。

tmp/work/armv7at2hf-neon-mx6ul-fslc-linux-gnueabi/pjproject/2.8-r0/pjproject-2.8/third_party/lib         -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -fuse-ld=bfd -lssl -lcrypto -fuse-ld=bfd -lssl -lcrypto
| output/pjlib-test-arm-fslc-linux-gnueabi/ssl_sock.o: In function `get_cipher_list':
| /usr/src/debug/pjproject/2.8-r0/pjproject-2.8/pjlib/src/pjlib-test/ssl_sock.c:49: undefined reference to `pj_ssl_cipher_get_availables'
| /usr/src/debug/pjproject/2.8-r0/pjproject-2.8/pjlib/src/pjlib-test/ssl_sock.c:58: undefined reference to `pj_ssl_cipher_name'
| output/pjlib-test-arm-fslc-linux-gnueabi/ssl_sock.o: In function `ssl_on_data_sent':
| /usr/src/debug/pjproject/2.8-r0/pjproject-2.8/pjlib/src/pjlib-test/ssl_sock.c:362: undefined reference to `pj_ssl_sock_get_user_data'
| /usr/src/debug/pjproject/2.8-r0/pjproject-2.8/pjlib/src/pjlib-test/ssl_sock.c:377: undefined reference to `pj_ssl_sock_send'
| /usr/src/debug/pjproject/2.8-r0/pjproject-2.8/pjlib/src/pjlib-test/ssl_sock.c:393: undefined reference to `pj_ssl_sock_close'
| output/pjlib-test-arm-fslc-linux-gnueabi/ssl_sock.o: In function `ssl_on_data_read':
| /usr/src/debug/pjproject/2.8-r0/pjproject-2.8/pjlib/src/pjlib-test/ssl_sock.c:266: undefined reference to `pj_ssl_sock_get_user_data'
| /usr/src/debug/pjproject/2.8-r0/pjproject-2.8/pjlib/src/pjlib-test/ssl_sock.c:349: undefined reference to `pj_ssl_sock_close'
| /usr/src/debug/pjproject/2.8-r0/pjproject-2.8/pjlib/src/pjlib-test/ssl_sock.c:323: undefined reference to `pj_ssl_sock_get_info'
| /usr/src/debug/pjproject/2.8-r0/pjproject-2.8/pjlib/src/pjlib-test/ssl_sock.c:296: undefined reference to `pj_ssl_sock_send'
| output/pjlib-test-arm-fslc-linux-gnueabi/ssl_sock.o: In function `dump_ssl_info':
| /usr/src/debug/pjproject/2.8-r0/pjproject-2.8/pjlib/src/pjlib-test/ssl_sock.c:93: undefined reference to `pj_ssl_cipher_name'
| output/pjlib-test-arm-fslc-linux-gnueabi/ssl_sock.o: In function `ssl_on_connect_complete':

编辑:似乎是因为它没有检测到 openssl,我可以通过使用 --with-ssl= 标志来完成它,但我不知道在哪里指向这个标志,因为当我将它设置为 /usr 时 yocto 拒绝构建/lib libssl 所在的位置,或者如果我将其设置为 openssl 所在的 /usr/bin。

标签: makefileyoctopjsip

解决方案


我会首先检查为什么 pjproject 配置无法找到 openssl(它不应该是 linux 上的火箭科学)。但是您所要求的通常可以通过以下方式完成:

EXTRA_OECONF = "--with-ssl=${STAGING_DIR_HOST}${prefix}"

由于您没有分享您的食谱,因此无法判断这是否真的适用于您的情况。


推荐阅读