C:\Perl\DBD-mysql-4.006>perl makefile.pl
Failed to determine directory of mysql.h. Use
perl Makefile.PL --cflags=-I<dir>
to set this directory. For details see the INSTALL.html file,
section "C Compiler flags" or type
perl Makefile.PL --help
文档上面说是perl makefile.pl执行就可以。但是我执行报错啊。
=============================================
后来,我加上了cflags,libs之后,执行如下
C:\Perl\DBD-mysql-4.006>perl Makefile.pl --cflags=-ID:\include --libs="-LD:\lib
-lmysqlclient"
I will use the following settings for compiling and testing:
cflags (User's choice) = -ID:\include
embedded (guessed ) =
libs (User's choice) = -LD:\lib -lmysqlclient
nocatchstderr (default ) = 0
nofoundrows (default ) = 0
ssl (guessed ) = 0
testdb (default ) = test
testhost (default ) =
testpassword (default ) =
testsocket (default ) =
testuser (default ) =
To change these settings, see 'perl Makefile.PL --help' and
'perldoc INSTALL'.
Argument "6.42_01" isn't numeric in numeric ge (>=) at Makefile.pl line 355.
Checking if your kit is complete...
Looks good
Multiple copies of Driver.xst found in: C:/Perl/site/lib/auto/DBI/ C:/Perl/lib/a
uto/DBI/ at Makefile.pl line 739
Using DBI 1.602 (for perl 5.010000 on MSWin32-x86-multi-thread) installed in C:/
Perl/site/lib/auto/DBI/
Writing Makefile for DBD::mysql
它生成了一个,makefile文件,但是我运行下面的make后还是报错,代码如下:
C:\Perl\DBD-mysql-4.006>make
MAKE Version 4.0 Copyright (c) 1987, 1996 Borland International
Error makefile 350: Colon expected
Error makefile 916: Redefinition of target 'dbdimp.obj'
Error makefile 923: Redefinition of target 'dbdimp.obj'
*** 3 errors during make ***
急救 ,怎么回事呢?
------解决方案--------------------
第一部的错误是说你需要指定mysql.h所在的路径。一般是在mysql的安装文件夹下面的include目录,如果mysql装在C:\program files\mysql,那么就是C:\program files\mysql\include
不知道你是不是装得ActivePerl,如果是,可以用ppm命令在线安装预编译好的DBI和DBD-mysql模块。
或者去www.activeperl.com下载预编译好的模块然后用ppm安装也可以。