私はXQuarts.app
を正しくインストールしましたが、リンクフェーズに問題があります。
ここにシンプルなコードがあります。
Mac OSでx11を実行
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xresource.h>
int main() {
Display* dis = XOpenDisplay(NULL);
return 0;
}
しかし、それは出力私はこの
g++ -c main.cpp -I/opt/X11/include
ようXQuartz.appからそれをコンパイルします。私はGoogleで検索
Yosemite 10.10.2
:
Undefined symbols for architecture x86_64: "_XOpenDisplay", referenced from: _main in main.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make: *** [default] Error 1
を私のMac版ロットではありませんでしたが、有用な助けを求めてください。前もって感謝します。
'/ include'はコンパイルのためのもので、リンクしません。ライブラリではなく、.hファイルがあります。 – MSalters