在Macos Monterey上建造Libcamera
我正在尝试在Macos Monterey上构建Libcamera,因为这是。
MESON构建
如上所述此处正在进入错误src/libcamera/meson.build:68:0:错误:c共享或静态库'gnutls'找不到
。
试图解决这个问题,我通过Homebrew安装了Gnutls。由于这没有帮助,我也尝试通过MacPorts安装Gnutls-Devel。这也无济于事。
执行pkg-config -list-all | Grep Gnutls
返回 Gnutls Gnutls- GNU系统的运输安全层实现
。
有人知道如何解决吗?我还想了解在MacOS下为Linux开发类似依赖性的首选方法是什么。
谢谢!
I'm trying to build libcamera on MacOS Monterey because it is a required dependency for raspberrypi/libcamera-apps.
meson build
as described here is running into the error src/libcamera/meson.build:68:0: ERROR: C shared or static library 'gnutls' not found
.
Trying to remediate the issue, I installed gnutls via homebrew. Since this didn't help I also tried to install gnutls-devel via MacPorts. This didn't help either.
Executing pkg-config --list-all | grep gnutls
returnsgnutls GnuTLS - Transport Security Layer implementation for the GNU system
.
Does anyone know how to resolve that? I would also like to understand what is the preferred way of managing similar dependencies when developing for linux under MacOS.
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
为了解决上述问题,我已经找出了MacBook上Gnutls上的位置。作为下一步,我通过执行
export libral_path =/opt/local/lib/lib
,将环境变量library_path
设置为此位置。To resolve the above issue I have figured out the location on gnutls on my MacBook. As next step, I set the environment variable
LIBRARY_PATH
to this location by executingexport LIBRARY_PATH=/opt/local/lib
.如果Meson找不到软件包,并且已安装了包裹,则可能只需要链接它即可。
以下是大多数库的一般步骤:
步骤1:不要尝试通过
ls
ing或cd
ing ing 探索根目录)。步骤2:使用
查找
命令查找匹配.dylib
文件。输出:
/
告诉查找要搜索需要很长时间的整个根目录。如果您安装了gnutls
brew selplist gnutls
难以捉摸的.dylib
应在/usr/usr/local/local
(Intel Mac)下)或/opt/local
(苹果硅)。因此,只需单独运行这些命令:步骤3:正如他的答案中提到的OP:在我的情况下,添加包含的目录,
libgnutls.30.dylib
,将像这样:应添加
$ library_path:
,只有libers_path
环境变量已经存在。添加它会将我们的新路径附加到列表中,而不是完全覆盖它。If meson can't find a package and you have it installed, you probably just need to link it.
Here are the general steps for most libraries like this:
Step 1: DO NOT try to manually find the library by
ls
ing orcd
ing around (unless your new and want to explore the root directory).Step 2: Use the
find
command to find the matching.dylib
file.Output:
The
/
tells find to search the entire root directory which takes a long time. If you installedgnutls
withbrew install gnutls
the elusive.dylib
should be under/usr/local
(Intel Mac) or/opt/local
(Apple Silicon). So just run these commands separately:Step 3: As the OP mentioned in his answer: add the directory containing, in my case,
libgnutls.30.dylib
, to yourLIBRARY_PATH
like so:The
$LIBRARY_PATH:
should be added just incase aLIBRARY_PATH
environment variable already exists. Adding it appends our new path to the list rather than completely overwriting it.