有人在 Mac 上使用过 libvlc 吗? [英] Anyone used libvlc on Mac?

查看:76
本文介绍了有人在 Mac 上使用过 libvlc 吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

编辑

我已经能够简化错误的重现:

I've been able to simplify the reproduction of the error:

尝试构建此示例时:

$ cc example.c -arch i386 -lvlc.2 -L/Applications/VLC.app/Contents/MacOS/lib/  -I/Applications/VLC.app/Contents/MacOS/include/ -o example
$ ./example 
dyld: Library not loaded: @loader_path/lib/libvlc.2.dylib
  Referenced from: /Users/francis/src/playground/libvlc/./example


原帖

我遇到以下行为:

  • 创建新的 XCode 项目(Cocoa 或命令行工具)
  • /Applications/VLC.app/Contents/MacOS/lib 中的 libvlc.2.dylib 链接
  • 运行应用程序
  • => 堆栈跟踪指向顶部的 __dyld_dyld_fatal_error 和底部的 __dyld__dyld_start 导致崩溃.
  • Create new XCode project (Cocoa or command line tool)
  • Link with libvlc.2.dylib found in /Applications/VLC.app/Contents/MacOS/lib
  • Run the application
  • => Crashes with stack-trace pointing pointing to __dyld_dyld_fatal_error at the top and __dyld__dyld_start at the bottom.

我在这里做错了什么?也许我需要与新的 VLC 构建链接,但我还没有在 Snow Leopard 上成功构建它,MacPort 也不能​​正常工作(在构建阶段失败).

What am I doing wrong here? Maybe I need to link with a fresh VLC build, but I haven't yet succeeded building it on Snow Leopard and the MacPort doesn't work as well (fails during build phase).

谁能为我指明正确的方向以使其正常工作?

Can anyone point me in the right direction for getting it to work?

推荐答案

使用 otool -L 检查您的程序是否与所有库正确链接.

Check with otool -L if your programm is correctly linked with all your libs.

使用 install_name_tools 重新链接每个 dylib

relink every dylib with install_name_tools

这篇关于有人在 Mac 上使用过 libvlc 吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆