Active Topics

 


Reply
Thread Tools
Posts: 289 | Thanked: 101 times | Joined on Oct 2009
#1
I am trying to move the mouse cursor with the X11 lib.
The code I found is the following:
Code:
int delta_x = 500, delta_y = 160;
    Display *display = XOpenDisplay(0);
    Window root = DefaultRootWindow(display);
    XWarpPointer(display, None, root, 0, 0, 0, 0, delta_x, delta_y);
    XCloseDisplay(display);
But I keep getting an error with all the X* functions that it is not a defined reference. So I searched for the problem and think I found a solution: http://ubuntuforums.org/showthread.php?t=1402709

So all I need now is to add the -lX11. Here is my question, how do I add it?
 
Posts: 235 | Thanked: 339 times | Joined on Nov 2010
#2
Someone may have a better solution but you could try this: Add
CONFIG += link_pkgconfig
PKGCONFIG += x11
to your project file. Make sure the X11 headers (/usr/include/X11) are installed
 

The Following User Says Thank You to jstokes For This Useful Post:
Posts: 289 | Thanked: 101 times | Joined on Oct 2009
#3
Worked perfectly!
 

The Following User Says Thank You to Lullen For This Useful Post:
Reply


 
Forum Jump


All times are GMT. The time now is 12:51.