To all,

Does anyone know how to compile C++ code and link in the X11 library?


I'm using :


 g++ -Wall -L/usr/X11/lib -lX11 -m64 --std=c++11 -o prog1 xlib1.cpp

and I get


/tmp/ccVNWGzR.o: In function `main':
xlib1.cpp:(.text+0xe): undefined reference to `XOpenDisplay'
xlib1.cpp:(.text+0x6d): undefined reference to `XCreateWindow'
xlib1.cpp:(.text+0x88): undefined reference to `XMapWindow'
xlib1.cpp:(.text+0x94): undefined reference to `XFlush'
collect2: error: ld returned 1 exit status

in my very small C++ program.


Thanks.

Mike Ritter


-- 
ubuntu-au mailing list
ubuntu-au@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-au

Reply via email to