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

};

相关推荐
weixin_459753941 小时前
golang如何实现Trace上下文传播_golang Trace上下文传播实现思路
jvm·数据库·python
weixin_444012931 小时前
PHP 中逻辑或(--)运算符的正确使用与条件逻辑重构指南
jvm·数据库·python
iAm_Ike7 小时前
Go 中自定义类型与基础类型间的显式类型转换详解
jvm·数据库·python
iuvtsrt7 小时前
Golang怎么实现方法集与接口的匹配_Golang如何理解值类型和指针类型实现接口的区别【详解】
jvm·数据库·python
tongluowan0078 小时前
MySQL中列数量及长度
数据库·mysql
-liming-9 小时前
单片机设计_串口调试工具
数据库·单片机·mongodb
鹿角片ljp9 小时前
从告警检测到智能研判:SQL 注入研判模型的设计与实践
数据库·sql
小新同学^O^10 小时前
简单学习 --> Spring事务
数据库·学习·spring
前进的李工10 小时前
MySQL慢查询日志优化实战
数据库·mysql·性能优化
KaMeidebaby11 小时前
卡梅德生物技术快报|禽类成纤维细胞 FISH 实验:鸟类性别染色体基因定位技术实现与数据验证
前端·数据库·其他·百度·新浪微博