考虑下面的场景。在 R2.14.0 中添加包“RMySQL”
> install.packages('RMySQL',type='source')
* installing *source* package 'RMySQL' ...
** package 'RMySQL' successfully unpacked and MD5 sums checked
**checking for $MYSQL_HOME... C:/wampp/mysql/**
gcc -I"G:/PROGRA~1/R/R-214~1.0/include" -I"C:/wampp/mysql/"/include -I"d:/RCompile/CRANpkg/extralibs/local/include" -O3 -Wall -std=gnu99 -mtune=core2 -c RS-DBI.c -o RS-DBI.o
gcc -I"G:/PROGRA~1/R/R-214~1.0/include" -I"C:/wampp/mysql/"/include -I"d:/RCompile/CRANpkg/extralibs/local/include" -O3 -Wall -std=gnu99 -mtune=core2 -c RS-MySQL.c -o RS-MySQL.o
gcc -shared -s -static-libgcc -o RMySQL.dll tmp.def RS-DBI.o RS-MySQL.o -Ld:/RCompile/CRANpkg/extralibs/local/lib C:/wampp/mysql//lib/opt/libmysql.lib -LG:/PROGRA~1/R/R-214~1.0/bin/i386 -lR
installing to G:/Program Files/R/R-2.14.0/library/RMySQL/libs/i386
** R
** inst
** preparing package for lazy loading
Creating a generic function for 'format' from package 'base' in package 'RMySQL'
Creating a generic function for 'print' from package 'base' in package 'RMySQL'
** help
*** installing help indices
** building package indices ...
** testing if installed package can be loaded
Error : .onLoad failed in loadNamespace() for 'RMySQL', details:
call: i$Location
error: $ operator is invalid for atomic vectors
Error: loading failed
Execution halted
ERROR: loading failed
* removing 'G:/Program Files/R/R-2.14.0/library/RMySQL'
安装失败的任何想法或解释?平台详情:
- 赢XP
- R2.14.0
- RMySQL_0.9-3.tar.gz
- MySQL 来自最新的 xampp 安装,其中 lib 和头文件位于 mysql_home 目录下的各个目录中。