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

};

相关推荐
hINs IONN2 小时前
在Mysql环境下对数据进行增删改查
数据库·mysql
Chuer_2 小时前
AI For BI是什么?一文拆解AI For BI应用落地!
大数据·数据库·人工智能·安全·数据分析·甘特图
梵高的向日葵�2392 小时前
OpenCV+MySQL+Qt构建智能视觉系统(msvc)
qt·opencv·mysql
一颗青果2 小时前
数据库事务
数据库·oracle
weixin_424999362 小时前
html如何修改备注
jvm·数据库·python
21439652 小时前
HTML怎么创建时间轴布局_HTML结构化时间线写法【方法】
jvm·数据库·python
gmaajt2 小时前
HTML函数开发需要SSD吗_SSD对HTML函数开发效率影响【详解】
jvm·数据库·python
LiAo_1996_Y2 小时前
p标签能嵌套div吗_HTML块级元素嵌套规则【解答】
jvm·数据库·python
2301_816660212 小时前
c++怎么将纯C的FILE-升级为C++的fstream_流缓冲绑定技巧【详解】
jvm·数据库·python