I use CodeBlocks in Mac to compile my source code:
#include <X11/Xlib.h>
Display *display;
int main()
{
display = XOpenDisplay(NULL);
XCloseDisplay(display);
return 0;
}
Compiling the source code is 开发者_开发知识库successfull, but linking to X11 is not successfull. How to I solve this problem? Where is libX11 in Mac?
Thanks.
As Bavarious noted, you'll be looking in /usr/X11/lib (and OS X 10.6.8 uses a symlink to make /usr/X11R6 an option as well). I only used CodeBlocks once, so I couldn't tell you what it requires you do to pass
-L/usr/X11/lib
to gcc.
精彩评论