rendered paste body/*
#include <X11/Xlib.h>
#include <X11/Xlibint.h>
#include <X11/Xproto.h>
#include <X11/Xatom.h>
#include <X11/extensions/Xrandr.h>
#include <X11/extensions/Xrender.h> /* we share subpixel information */
#include <stdio.h>
#include "/opt/xorg/include/X11/Xlib.h"
#include "/opt/xorg/include/X11/Xlibint.h"
#include "/opt/xorg/include/X11/Xproto.h"
#include "/opt/xorg/include/X11/Xatom.h"
#include "/opt/xorg/include/X11/extensions/Xrandr.h"
#include "/opt/xorg/include/X11/extensions/Xrender.h" /* we share subpixel information */
#include <string.h>
#include <stdlib.h>
#include <stdarg.h>
#include <math.h>
int main(int argc, char *argv[])
{
char* display_name = "default";
int screen = 0;
Display *dpy = XOpenDisplay(display_name);
Window root = RootWindow (dpy, screen);
XRRScreenResources *sr = XRRGetScreenResources ( dpy, root );
XRROutputInfo *output = XRRGetOutputInfo(dpy, sr, sr->outputs[0]);
sprintf("\nScreen name: %s \n", output->name);
return 0;
}
and the output:
/tmp/ccUusm2q.o: In function `main':
tmp.c:(.text+0x26): undefined reference to `XOpenDisplay'
tmp.c:(.text+0x5a): undefined reference to `XRRGetScreenResources'
tmp.c:(.text+0x7b): undefined reference to `XRRGetOutputInfo'
collect2: ld returned 1 exit status