maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   Using X11 lib with qt creator (https://talk.maemo.org/showthread.php?t=72223)

Lullen 2011-04-16 09:46

Using X11 lib with qt creator
 
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?

jstokes 2011-04-16 09:51

Re: Using X11 lib with qt creator
 
Someone may have a better solution but you could try this: Add
Quote:

CONFIG += link_pkgconfig
PKGCONFIG += x11
to your project file. Make sure the X11 headers (/usr/include/X11) are installed

Lullen 2011-04-16 09:55

Re: Using X11 lib with qt creator
 
Worked perfectly!


All times are GMT. The time now is 09:11.

vBulletin® Version 3.8.8