mysql报错,net_async_status

复制代码
kym@hcss-ecs-1356:~/WeChat/user/build$ make
[  5%] Building CXX object CMakeFiles/user_server.dir/server/server.cc.o
In file included from /home/kym/WeChat/user/../common/user_mysql.hpp:3,
                 from /home/kym/WeChat/user/server/server.hpp:6,
                 from /home/kym/WeChat/user/server/server.cc:1:
/home/kym/WeChat/user/../common/mysql.hpp:2: warning: "MYSQL_NO_ASYNC" redefined
    2 | #define MYSQL_NO_ASYNC
      | 
<command-line>: note: this is the location of the previous definition
In file included from /usr/include/odb/mysql/mysql.hxx:26,
                 from /usr/include/odb/mysql/database.hxx:17,
                 from /home/kym/WeChat/user/../common/mysql.hpp:9:
/usr/include/mysql/mysql.h:486:6: error: using typedef-name 'net_async_status' after 'enum'
  486 | enum net_async_status STDCALL mysql_real_connect_nonblocking(
      |      ^~~~~~~~~~~~~~~~
/home/kym/WeChat/user/../common/mysql.hpp:3:13: note: 'net_async_status' has a previous declaration here
    3 | typedef int net_async_status;
      |             ^~~~~~~~~~~~~~~~
/usr/include/mysql/mysql.h:490:6: error: using typedef-name 'net_async_status' after 'enum'
  490 | enum net_async_status STDCALL mysql_send_query_nonblocking(
      |      ^~~~~~~~~~~~~~~~
/home/kym/WeChat/user/../common/mysql.hpp:3:13: note: 'net_async_status' has a previous declaration here
    3 | typedef int net_async_status;
      |             ^~~~~~~~~~~~~~~~
/usr/include/mysql/mysql.h:492:6: error: using typedef-name 'net_async_status' after 'enum'
  492 | enum net_async_status STDCALL mysql_real_query_nonblocking(
      |      ^~~~~~~~~~~~~~~~
/home/kym/WeChat/user/../common/mysql.hpp:3:13: note: 'net_async_status' has a previous declaration here
    3 | typedef int net_async_status;
      |             ^~~~~~~~~~~~~~~~
/usr/include/mysql/mysql.h:494:6: error: using typedef-name 'net_async_status' after 'enum'
  494 | enum net_async_status STDCALL
      |      ^~~~~~~~~~~~~~~~
/home/kym/WeChat/user/../common/mysql.hpp:3:13: note: 'net_async_status' has a previous declaration here
    3 | typedef int net_async_status;
      |             ^~~~~~~~~~~~~~~~
/usr/include/mysql/mysql.h:496:6: error: using typedef-name 'net_async_status' after 'enum'
  496 | enum net_async_status STDCALL mysql_next_result_nonblocking(MYSQL *mysql);
      |      ^~~~~~~~~~~~~~~~
/home/kym/WeChat/user/../common/mysql.hpp:3:13: note: 'net_async_status' has a previous declaration here
    3 | typedef int net_async_status;
      |             ^~~~~~~~~~~~~~~~
/usr/include/mysql/mysql.h:497:6: error: using typedef-name 'net_async_status' after 'enum'
  497 | enum net_async_status STDCALL mysql_select_db_nonblocking(MYSQL *mysql,
      |      ^~~~~~~~~~~~~~~~
/home/kym/WeChat/user/../common/mysql.hpp:3:13: note: 'net_async_status' has a previous declaration here
    3 | typedef int net_async_status;
      |             ^~~~~~~~~~~~~~~~
/usr/include/mysql/mysql.h:545:6: error: using typedef-name 'net_async_status' after 'enum'
  545 | enum net_async_status STDCALL mysql_free_result_nonblocking(MYSQL_RES *result);
      |      ^~~~~~~~~~~~~~~~
/home/kym/WeChat/user/../common/mysql.hpp:3:13: note: 'net_async_status' has a previous declaration here
    3 | typedef int net_async_status;
      |             ^~~~~~~~~~~~~~~~
/usr/include/mysql/mysql.h:552:6: error: using typedef-name 'net_async_status' after 'enum'
  552 | enum net_async_status STDCALL mysql_fetch_row_nonblocking(MYSQL_RES *res,
      |      ^~~~~~~~~~~~~~~~
/home/kym/WeChat/user/../common/mysql.hpp:3:13: note: 'net_async_status' has a previous declaration here
    3 | typedef int net_async_status;
      |             ^~~~~~~~~~~~~~~~
make[2]: *** [CMakeFiles/user_server.dir/build.make:92: CMakeFiles/user_server.dir/server/server.cc.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:85: CMakeFiles/user_server.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

用vim打开 /usr/include/mysql/mysql.h, 把这几行代码加进去,

#ifndef NET_ASYNC_STATUS_DEFINED

#define NET_ASYNC_STATUS_DEFINED

enum net_async_status {

NET_ASYNC_COMPLETE = 0,

NET_ASYNC_NOT_READY,

NET_ASYNC_ERROR

};

相关推荐
吴声子夜歌18 分钟前
SQL经典实例——使用多张表
数据库·sql
倔强的石头_1 小时前
《Kingbase护城河》——深度解密数据库行锁冲突与等待事件架构
数据库
IT策士1 小时前
Redis 从入门到精通:性能调优与多语言客户端对比
数据库·redis·缓存
sevencheng7982 小时前
【ADB】adb命令行常用按键模拟代码
linux·adb·模拟按键,返回键,音量键
Bert.Cai2 小时前
Oracle INSTR函数详解
数据库·oracle
茉莉玫瑰花茶4 小时前
综合案例 - AI 智能租房助手 [ 5 ]
服务器·数据库·人工智能·python·ai
ywl4708120874 小时前
jwt生产token,简单版helloworld
java·数据库·spring
器灵科技4 小时前
AI视频工具实测:Seedance/可灵/HappyHorse谁最能打?
java·运维·数据库·人工智能·github
huangdong_5 小时前
京东商品图片视频批量下载与m3u8视频合并技术完整实现方案
大数据·前端·数据库
倒流时光三十年5 小时前
PostgreSQL CASE 条件表达式详解
数据库·postgresql