我需要做什么做的xlib链接? [英] What do I need to do to link with xlib?

查看:113
本文介绍了我需要做什么做的xlib链接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的GCC,我需要什么样的交换机添加与Xlib的链接?搜索后,所有我能找到的是 -lX11 ,但给我的 LD:找不到-lX11库

I am using GCC, what switches do I need to add to link with Xlib? After searching, all I could find was -lX11, but that gave me ld: library not found for -lX11

我使用的是Mac(10.6),但我不喜欢任何与Mac专用。

I am using a mac (10.6), but I would not like anything that is Mac specific.

推荐答案

您通常可以使用 章pkg-配置 来确定你需要传递的标志:

You can usually use pkg-config to determine the flags you need to pass:

gcc my-program.c $(pkg-config --cflags --libs x11) -o my-program

这篇关于我需要做什么做的xlib链接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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