I have properly installed the XQuarts.app
but have the linking phase problem.
Here is the simple code.
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xresource.h>
int main() {
Display* dis = XOpenDisplay(NULL);
return 0;
}
When i compile it from XQuartz.app like this
g++ -c main.cpp -I/opt/X11/include
However it outputs:
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
My mac version:
Yosemite 10.10.2
I googled a lot but couldn't find any useful help. Thanks in advance.