现在我的机器是redhad as 3。0
安装了mysql4.1,目录是/usr/local/mysql
python 是2.4.1 目录是/usr/local/python2.4
现在安装MySql-python 1.2.0的时候 build报告错误
unning build_py
running build_ext
building '_mysql' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/local/include/python2.4 -c _mysql.c -o build/temp.linux-i686-2.4/_mysql.o
_mysql.c:41:19: mysql.h: No such file or directory
_mysql.c:42:26: mysqld_error.h: No such file or directory
_mysql.c:43:20: errmsg.h: No such file or directory
_mysql.c:73: syntax error before "MYSQL"
_mysql.c:73: warning: no semicolon at end of struct or union
_mysql.c:76: syntax error before '}' token
_mysql.c:76: warning: type defaults to `int' in declaration of `_mysql_ConnectionObject'
_mysql.c:76: warning: data definition has no type or storage class
_mysql.c:87: syntax error before "MYSQL_RES"
_mysql.c:87: warning: no semicolon at end of struct or union
_mysql.c:91: syntax error before '}' token
_mysql.c:91: warning: type defaults to `int' in declaration of `_mysql_ResultObject'
_mysql.c:91: warning: data definition has no type or storage class
_mysql.c:103: syntax error before '*' token
_mysql.c:104: warning: function declaration isn't a prototype
_mysql.c: In function `_mysql_Exception':
_mysql.c:117: warning: implicit declaration of function `mysql_errno'
_mysql.c:117: `c' undeclared (first use in this function)
_mysql.c:117: (Each undeclared identifier is reported only once
_mysql.c:117: for each function it appears in.)
_mysql.c:120: `CR_MAX_ERROR' undeclared (first use in this function)
_mysql.c:128: `CR_COMMANDS_OUT_OF_SYNC' undeclared (first use in this function)
_mysql.c:129: `ER_DB_CREATE_EXISTS' undeclared (first use in this function)
_mysql.c:130: `ER_SYNTAX_ERROR' undeclared (first use in this function)
_mysql.c:131: `ER_PARSE_ERROR' undeclared (first use in this function)
_mysql.c:132: `ER_NO_SUCH_TABLE' undeclared (first use in this function)
_mysql.c:133: `ER_WRONG_DB_NAME' undeclared (first use in this function)
_mysql.c:134: `ER_WRONG_TABLE_NAME' undeclared (first use in this function)
_mysql.c:135: `ER_FIELD_SPECIFIED_TWICE' undeclared (first use in this function)
_mysql.c:136: `ER_INVALID_GROUP_FUNC_USE' undeclared (first use in this function)
_mysql.c:137: `ER_UNSUPPORTED_EXTENSION' undeclared (first use in this function)
_mysql.c:138: `ER_TABLE_MUST_HAVE_COLUMNS' undeclared (first use in this function)
_mysql.c:144: `ER_DUP_ENTRY' undeclared (first use in this function)
_mysql.c:166: warning: implicit declaration of function `mysql_error'
_mysql.c:166: warning: passing arg 1 of `PyString_FromString' makes pointer from integer without a cast
_mysql.c: In function `_mysql_server_init':
_mysql.c:185: warning: unused variable `s'
_mysql.c:186: warning: unused variable `cmd_argc'
_mysql.c:186: warning: unused variable `i'
_mysql.c:186: warning: unused variable `groupc'
_mysql.c:187: warning: unused variable `item'
_mysql.c:261: warning: label `finish' defined but not used
_mysql.c: At top level:
_mysql.c:311: syntax error before '*' token
_mysql.c:314: warning: function declaration isn't a prototype
_mysql.c: In function `_mysql_ResultObject_Initialize':
_mysql.c:316: `MYSQL_RES' undeclared (first use in this function)
_mysql.c:316: `result' undeclared (first use in this function)
_mysql.c:317: `conn' undeclared (first use in this function)
_mysql.c:321: `MYSQL_FIELD' undeclared (first use in this function)
_mysql.c:321: `fields' undeclared (first use in this function)
_mysql.c:323: `args' undeclared (first use in this function)
_mysql.c:323: `kwargs' undeclared (first use in this function)
_mysql.c:328: `self' undeclared (first use in this function)
_mysql.c:333: warning: implicit declaration of function `mysql_use_result'
_mysql.c:335: warning: implicit declaration of function `mysql_store_result'
_mysql.c:342: warning: implicit declaration of function `mysql_num_fields'
_mysql.c:345: warning: implicit declaration of function `mysql_fetch_fields'
_mysql.c: At top level:
_mysql.c:396: syntax error before '*' token
_mysql.c:399: warning: function declaration isn't a prototype
_mysql.c: In function `_mysql_ResultObject_traverse':
_mysql.c:401: `self' undeclared (first use in this function)
_mysql.c:402: warning: implicit declaration of function `visit'
_mysql.c:402: `arg' undeclared (first use in this function)
_mysql.c: At top level:
_mysql.c:411: syntax error before '*' token
_mysql.c:412: warning: function declaration isn't a prototype
_mysql.c: In function `_mysql_ResultObject_clear':
_mysql.c:413: `self' undeclared (first use in this function)
_mysql.c: At top level:
_mysql.c:422: syntax error before '*' token
_mysql.c:425: warning: function declaration isn't a prototype
_mysql.c: In function `_mysql_ConnectionObject_Initialize':
_mysql.c:426: `MYSQL' undeclared (first use in this function)
_mysql.c:426: `conn' undeclared (first use in this function)
_mysql.c:435: `MYSQL_PORT' undeclared (first use in this function)
_mysql.c:451: `self' undeclared (first use in this function)
_mysql.c:454: `args' undeclared (first use in this function)
_mysql.c:454: `kwargs' undeclared (first use in this function)
_mysql.c:497: warning: implicit declaration of function `mysql_init'
_mysql.c:500: warning: implicit declaration of function `mysql_options'
_mysql.c:500: `MYSQL_OPT_CONNECT_TIMEOUT' undeclared (first use in this function)
_mysql.c:504: `MYSQL_OPT_COMPRESS' undeclared (first use in this function)
_mysql.c:505: `CLIENT_COMPRESS' undeclared (first use in this function)
_mysql.c:508: `MYSQL_OPT_NAMED_PIPE' undeclared (first use in this function)
_mysql.c:510: `MYSQL_INIT_COMMAND' undeclared (first use in this function)
_mysql.c:512: `MYSQL_READ_DEFAULT_FILE' undeclared (first use in this function)
_mysql.c:514: `MYSQL_READ_DEFAULT_GROUP' undeclared (first use in this function)
_mysql.c:517: `MYSQL_OPT_LOCAL_INFILE' undeclared (first use in this function)
_mysql.c:525: warning: implicit declaration of function `mysql_real_connect'
_mysql.c: In function `_mysql_connect':
_mysql.c:604: `c' undeclared (first use in this function)
_mysql.c:606: syntax error before ')' token
_mysql.c: At top level:
_mysql.c:617: syntax error before '*' token
_mysql.c:620: warning: function declaration isn't a prototype
_mysql.c: In function `_mysql_ConnectionObject_traverse':
_mysql.c:621: `self' undeclared (first use in this function)
_mysql.c:622: `arg' undeclared (first use in this function)
_mysql.c: At top level:
_mysql.c:628: syntax error before '*' token
_mysql.c:629: warning: function declaration isn't a prototype
_mysql.c: In function `_mysql_ConnectionObject_clear':
_mysql.c:630: `self' undeclared (first use in this function)
_mysql.c: At top level:
_mysql.c:640: syntax error before '*' token
_mysql.c:642: warning: function declaration isn't a prototype
_mysql.c: In function `_mysql_ConnectionObject_close':
_mysql.c:643: `args' undeclared (first use in this function)
_mysql.c:646: `self' undeclared (first use in this function)
_mysql.c:648: warning: implicit declaration of function `mysql_close'
_mysql.c: At top level:
_mysql.c:668: syntax error before '*' token
_mysql.c:670: warning: function declaration isn't a prototype
_mysql.c: In function `_mysql_ConnectionObject_affected_rows':
_mysql.c:671: `args' undeclared (first use in this function)
_mysql.c:672: `self' undeclared (first use in this function)
_mysql.c:673: warning: implicit declaration of function `mysql_affected_rows'
_mysql.c: In function `_mysql_debug':
_mysql.c:689: warning: implicit declaration of function `mysql_debug'
_mysql.c: At top level:
_mysql.c:702: syntax error before '*' token
_mysql.c:704: warning: function declaration isn't a prototype
_mysql.c: In function `_mysql_ConnectionObject_dump_debug_info':
_mysql.c:706: `args' undeclared (first use in this function)
_mysql.c:707: `self' undeclared (first use in this function)
_mysql.c:709: warning: implicit declaration of function `mysql_dump_debug_info'
_mysql.c: At top level:
_mysql.c:721: syntax error before '*' token
_mysql.c:723: warning: function declaration isn't a prototype
等等这些错误,应该如何处理?
--转自