问题描述
我有一个非常基本的X11应用程序,我在Linux上运行,试图在OSX 10.5.8下进行编译.我已经安装了X11和X11 SDK,并如下修改了makefile:
I have a pretty basic X11 app that I run on Linux that I'm trying to get compiled under OSX 10.5.8. I have X11 and the X11 SDK installed, and modified the makefile as follows:
CFLAGS = -L/usr/X11/lib -I/usr/X11/include
一切正常,但链接器找不到X11库.
Everything compiles fine, but the linker can't find the X11 lib.
ld: library not found for -lX11
我看过google,但到目前为止,我发现的唯一其他人或者没有安装X11 SDK,或者不知道-L标志.
I've looked on google, but the only other people I've found with this problem so far either didn't have the X11 SDK installed or didn't know about the -L flag.
有什么想法吗?
推荐答案
您可能在错误的位置查找了库;它肯定在OS X盒中的其他位置.尝试输入:
You may be looking in the wrong location for the library; it's certainly in a different location on my OS X box. Try typing:
locate libX11.dylib
并添加适当的路径.例如.在我的系统上,您的CFLAGS中需要-L/usr/X11/lib/
.
and adding an appropriate path. E.g. on my system you'd need -L/usr/X11/lib/
in you CFLAGS.
这篇关于ld在OSX Leopard上找不到X11库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!