我尝试在 MacOS Lion 上安装 DBD-mysql-4.021,但是当我这样做时,它似乎遗漏了一些头文件。
MacBook-Pro-de-benoit:DBD-mysql-4.021-XXi0wV vanalder$ sudo make
llvm-gcc-4.2 -c -I/Library/Perl/5.12/darwin-thread-multi-2level/auto/DBI -I/Applications/MAMP/Library/include -fno-omit-frame-pointer -g -DDBD_MYSQL_INSERT_ID_IS_GOOD -g -arch x86_64 -arch i386 -g -pipe -fno-common -DPERL_DARWIN -fno-strict-aliasing -fstack-protector -I/usr/local/include -Os -DVERSION=\"4.021\" -DXS_VERSION=\"4.021\" "-I/System/Library/Perl/5.12/darwin-thread-multi-2level/CORE" dbdimp.c In file included from dbdimp.c:20:
dbdimp.h:24:49: error: mysql.h: No such file or directory
dbdimp.h:25:45: error: mysqld_error.h: No such file or directory
dbdimp.h:27:49: error: errmsg.h: No such file or directory In file included from dbdimp.c:20: dbdimp.h:159: error: expected specifier-qualifier-list before ‘MYSQL’ dbdimp.h:257: error: expected specifier-qualifier-list before ‘MYSQL_RES’ In file included from dbdimp.c:20:
....
我尝试从这里安装 MySQL 的二进制文件。我可以安装,但它不起作用。或者用 macports 安装(mysql5-devel -> 无法安装),要如何使用 MySQL 和 Perl?
我从这个链接 [http://www.mysql.com/downloads/mysql/][1]http://www.mysql.com/downloads/mysql/ 再次从 DMG 安装了 mysql,但我仍然有同样的错误当我做
sudo make
dbdimp.h:24:49: error: mysql.h: No such file or directory
dbdimp.h:25:45: error: mysqld_error.h: No such file or directory
dbdimp.h:27:49: error: errmsg.h: No such file or directory
In file included from dbdimp.c:20:
dbdimp.h:159: error: expected specifier-qualifier-list before ‘MYSQL’
dbdimp.h:257: error: expected specifier-qualifier-list before ‘MYSQL_RES’
In file included from dbdimp.c:20:
....
这是我第一次在安装 CPAN 模块时遇到问题(Xcode 安装和 GCC 编译器 k)