在 Mac OS X 10.7.2 上构建 libjingle 时出现链接错误
我想在 Mac OS X 10.7.2 上构建 libjingle。我刚刚克服了编译器错误,现在遇到了链接器错误。路径 /Developer/libjingle/libjingle-0.6.3/talk/build/dbg/lib
存在,但系统显示未知。我怎样才能修复它并使 libjingle 真正工作?
MBP17:talk rei25$ /Developer/swtoolkit/hammer.sh
scons: Reading SConscript files ...
scons: warning: The build_dir keyword has been deprecated; use the variant_dir keyword instead.
File "/Developer/swtoolkit/site_scons/site_init.py", line 203, in BuildEnvironmentSConscripts
scons: done reading SConscript files.
scons: Building targets ...
scons: `all_libraries' is up to date.
________Linking build/dbg/obj/login
ld: unknown option: -rpath=/Developer/libjingle/libjingle-0.6.3/talk/build/dbg/lib
collect2: ld returned 1 exit status
scons: *** [build/dbg/obj/login] Error 1
scons: building terminated because of errors.
I want to build libjingle on Mac OS X 10.7.2. I just overcome the compiler error and meet the linker error now. The path /Developer/libjingle/libjingle-0.6.3/talk/build/dbg/lib
exists but system says unknown. How can I fix it and make libjingle really work?
MBP17:talk rei25$ /Developer/swtoolkit/hammer.sh
scons: Reading SConscript files ...
scons: warning: The build_dir keyword has been deprecated; use the variant_dir keyword instead.
File "/Developer/swtoolkit/site_scons/site_init.py", line 203, in BuildEnvironmentSConscripts
scons: done reading SConscript files.
scons: Building targets ...
scons: `all_libraries' is up to date.
________Linking build/dbg/obj/login
ld: unknown option: -rpath=/Developer/libjingle/libjingle-0.6.3/talk/build/dbg/lib
collect2: ld returned 1 exit status
scons: *** [build/dbg/obj/login] Error 1
scons: building terminated because of errors.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我发布到您的其他 question 也解决了这个问题。在 libjingle 的 SCons 构建文件中,他们删除了 linux 构建的默认 RPATH。我根本不了解 SCons,所以我不确定它是如何进入那里的。我注意到 linux 版本删除了默认值,所以我在 OS X 版本中删除了它,这似乎有效。虽然 OS X 的 ld 应该采用 rpath 参数,但我相信它不应该在 rpath 和实际路径之间有等号。这就是它可能失败的原因,但是您根本不需要设置它。但是,我还没有运行单元测试,不知道删除 rpath 参数是否会导致运行时问题。至少现在可以编译了。
The patch I posted to your other question fixes this issue as well. In the SCons build file for libjingle they remove the default RPATH for the linux build. I don't know SCons at all, so I'm not sure how it gets in there to begin with. I noticed the linux build removes the default, so I removed it for the OS X build, this appears to work. Although ld for OS X is suppose to take a rpath parameter, I believe it's not suppose to have an equal sign between rpath and the actual path. So thats why it may be failing, however you don't need to have it set at all. But, I haven't run the unit tests yet to know if removing the rpath param will cause an runtime problem. Atleast it compiles now.
将此代码添加到您的 main.scons 中,如下所示:
谢谢。
凯恩。
add this code in your main.scons as below:
Thanks.
Kane.