gpt4 book ai didi

c++ - 如何在 NaCl 模块中使用移植库?

转载 作者:太空宇宙 更新时间:2023-11-04 02:03:42 27 4
gpt4 key购买 nike

我想使用 openssl我的 NaCl 模块中的库。幸运的是它已经被移植了,如https://code.google.com/p/naclports/ .然而,有点遗憾,但我不知道如何将库添加到工具链中。我按照 Readme 文件中的说明进行操作:

...nacl_sdk/pepper_33/naclports/src$ python build_tools/naclports.py install openssl Already installed 'openssl' [x86_64/newlib]

然后我尝试编译这个简单的 C code , 并且编译器提示一些错误是因为与 openssl/evp.h 的链接问题。

这是我的 Makefile:link .请让我知道如何让它运行。

最佳答案

NaCl 实际上由几个不同的工具链组成。 naclports 将构建一个给定的库并将其安装到其中一个。库和 header 直接安装到工具链中,因此无需在命令行上使用 -L 或 -I。

在这种情况下,您已经构建并安装了 openssl 的 x86_64 newlib 版本。这意味着您应该能够构建应用程序的 x86_64 newlib 版本(将 TOOLCHAIN=newlib NACL_ARCH=x86_64 添加到您的 make 调用中)。

要构建所有其他版本的 openssh,您可以使用 naclports 顶层的“make_all.sh”脚本(例如 ./make_all.sh openssl)。

关于c++ - 如何在 NaCl 模块中使用移植库?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23270979/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com