mysql.cc: In function ‘void print_table_data(MYSQL_RES*)’:
mysql.cc:2355: error: ‘max’ was not declared in this scope
mysql.cc:2357: error: ‘max’ was not declared in this scope
mysql.cc:2378: error: ‘min’ was not declared in this scope
mysql.cc: In function ‘int com_edit(String*, char*)’:
mysql.cc:2849: warning: ignoring return value of ‘int system(const char*)’, declared with attribute warn_unused_result
make[2]: *** [mysql.o] Error 1
make[2]: Leaving directory `/home/yugao/6.0/mysql-6.0.0-alpha/client'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/yugao/6.0/mysql-6.0.0-alpha'
make: *** [all] Error 2
请问,上面的怎么解决,谢谢!!!作者: ggxxkkll 时间: 2013-3-14 11:23
我在include/my_global.h 文件中添加了,如下代码:
/* Define some useful general macros */
-#if !defined(max)
-#define max(a, b) ((a) > (b) ? (a) : (b))
-#define min(a, b) ((a) < (b) ? (a) : (b))
+#if !defined(mysql_max)
+#define mysql_max(a, b) ((a) > (b) ? (a) : (b))
+#define mysql_min(a, b) ((a) < (b) ? (a) : (b))
+static __inline long min( long a, long b ) { return ( ( a < b ) ? a : b ); }
+static __inline long max( long a, long b ) { return ( ( a > b ) ? a : b ); }
#endif
再次编译, sudo make, 出现了如下错误:
In file included from strxmov.c:33:
../include/my_global.h:1528: error: expected identifier or ‘(’ before ‘long’
../include/my_global.h:1528: error: expected ‘)’ before ‘<’ token
../include/my_global.h:1529: error: expected identifier or ‘(’ before ‘long’
../include/my_global.h:1529: error: expected ‘)’ before ‘>’ token