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
};