Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
这是我的 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)
完整的代码在这里
当然,存在 libxdo.so 和 xdo.h
检查的答案是错误的,正确的解决方案是:
#define __USE_XOPEN #include "unistd.h" #include <xdo.h>
useconds_t我在“unistd.h”中找到了原因,但它需要首先使用#define __USE_XOPEN,正确的代码是
useconds_t
#define __USE_XOPEN
#include "unistd.h" #define __USE_XOPEN #include <xdo.h>