0

here is my CMakeLists.txt:

cmake_minimum_required(VERSION 3.3)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
add_executable(ex ex.c)
target_link_libraries(ex xdo)

the full code is here

of course, the libxdo.so and xdo.h is exist

anxvonial
  • 61
  • 1
  • 2
  • 10

2 Answers2

1

the checked answer is wrong, the right solution is:

#define __USE_XOPEN
#include "unistd.h"
#include <xdo.h>
pozklundw
  • 505
  • 1
  • 9
  • 16
-1

I find the reason, useconds_t in "unistd.h", but it require first use #define __USE_XOPEN, the right code is

#include "unistd.h"
#define __USE_XOPEN
#include <xdo.h>
anxvonial
  • 61
  • 1
  • 2
  • 10