Advertisement
Combreal

linkX11.cpp

Feb 28th, 2019
293
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.61 KB | None | 0 0
  1. #include <iostream>
  2. #include <X11/Xlib.h>
  3. #include <stdlib.h>
  4. #include <stdio.h>
  5. using namespace std;
  6.  
  7. int main(void)
  8. {
  9.   Display* d = XOpenDisplay(NULL);
  10.   Screen*  s = DefaultScreenOfDisplay(d);
  11.   int horizontal = s->height;
  12.   int vertical = s->width;
  13.   cout<<horizontal<<"x"<<vertical<<endl;
  14. }
  15. //g++ -g -o Test main.cpp -lX11
  16.  
  17.  
  18. //CMakeLists.txt
  19. /*cmake_minimum_required(VERSION 2.8.4)
  20. project(X11test)
  21. set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
  22. set(SOURCE_FILES main.cpp)
  23. include_directories(/usr/include/X11)
  24. add_executable(X11test ${SOURCE_FILES})
  25. target_link_libraries(X11test X11 )*/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement