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

};

相关推荐
Data_Journal1 小时前
用于网页抓取的 Node-unblocker
大数据·开发语言·数据库·python·scrapy
涤生大数据1 小时前
一次“没有运行日志”的DolphinScheduler任务失败排查
大数据·数据库·人工智能·状态模式
专注API从业者1 小时前
告别人工盯品!借助 Open Claw 搭建电商商品自动化监控与数据分析系统(完整可运行源码)
大数据·运维·数据库·数据分析·自动化
viskaz2 小时前
数据库迁移流程学习
数据库
auspicious航3 小时前
PostgreSQL写入慢全攻略:原因排查与性能调优实战
数据库·postgresql
IvorySQL3 小时前
PostgreSQL 日报|逻辑复制行过滤致数据丢失(8 月 21 日)
数据库·postgresql
重生之我是Java开发战士3 小时前
【Java EE】事务与事务的传播机制
数据库·java-ee
润乾软件3 小时前
Trae+SQLazy 编写复杂 SQL 实践
数据库·sql
会编程的吕洞宾3 小时前
Redis大Key拖垮线上?排查定位与治理实战
数据库·redis·bootstrap
呆呆小孩4 小时前
零基础学 MySQL(上):从建库建表到增删改查,一篇搭好 SQL 基础
android·sql·mysql