【发布时间】:2017-03-06 19:09:59
【问题描述】:
1 CC = g++
2 FLAGS = -g -DGL_GLEXT_PROTOTYPES -I./glm -Wall
3 LDFLAGS = -lX11 -lpthread
所以我的 Makefile 中有这些 但我得到了错误
ld: library not found for -lX11
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [compile-debug] Error 1
不知道应该怎么解决
【问题讨论】:
-
你的控制台中
locate libX11的输出是什么? -
为 Ubuntu 安装 libx11-dev,或为 Fedora/Red Hat 安装 libX11-devel。或者告诉我们您在哪个平台上。
-
在 macOS Sierra 上
-
locate libX11 /opt/X11/lib/libX11-xcb.1.dylib /opt/X11/lib/libX11-xcb.dylib /opt/X11/lib/libX11.6.dylib /opt/X11/lib/libX11.dylib
标签: c++ makefile linker x11 compiler-flags