[Rcpp-devel] 来自lxh的邮件
lxh
zjgslxh at 163.com
Tue Mar 10 14:49:18 CET 2015
Hi,
#########################################
> Rcpp::sourceCpp('armaPRI.cpp')
Error in inDL(x, as.logical(local), as.logical(now), ...) :
unable to load shared object 'C:/Users/lxh/AppData/Local/Temp/RtmpeenRl8/sourcecpp_27081dce2d4b/sourceCpp_77404.dll':
LoadLibrary failure: The specified module could not be found.
I get this when trying to use RcppArmadillo with my princomp computation program(armaPRI.cpp). I am sure that i have missed something which results above error message, but i have no idea about that.
By the way, the program eigentrans.cpp which uses the RcppEigen package works well.
The Rtools path and the R bin path are already added to my Enviroment Path:
#############################################################
c:\Rtools\gcc-4.6.3\bin;c:\Rtools\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\MiKTeX 2.9\miktex\bin\;C:\Python27;C:\Python27\DLLs;C:\Python27\Scripts;C:\Program Files\ATI Technologies\ATI.ACE\Core-Static;C:\TDM-GCC-32\bin;C:\R-3.1.3\bin;D:\Program Files\RStudio\bin\pandoc
###########################################################################################
armaPRI.cpp
###########################################################################################
// [[Rcpp::depends(RcppArmadillo)]]
#include <RcppArmadillo.h>
using namespace arma;
using namespace Rcpp;
// [[Rcpp::export]]
int PRINCOMP(){
mat A = randu<mat>(5,4);
mat coeff;
mat score;
vec latent;
vec tsquared;
princomp(coeff, score, latent, tsquared, A);
Rcout<<coeff<<endl;
return 0;
}
#####################################################################################################
>>eigentrans.cpp
#####################################################################################################
// [[Rcpp::depends(RcppEigen)]]
#include <RcppEigen.h>
using namespace Rcpp;
//[[Rcpp::export]]
List trans(NumericMatrix& AA,NumericMatrix& BB) {
const Eigen::MatrixXd A(as<Eigen::MatrixXd>(AA));
const Eigen::MatrixXd B(as<Eigen::MatrixXd>(BB));
Eigen::MatrixXd m(A.cwiseProduct(B));
Eigen::MatrixXd n(A.array().sin());
return List::create(Named("A")=A,Named("B")=B,Named("m")=m,Named("n")=n);
}
##################################################################################################
> sessionInfo()
R version 3.1.3 (2015-03-09)
Platform: i386-w64-mingw32/i386 (32-bit)
Running under: Windows 7 (build 7601) Service Pack 1
locale:
[1] LC_COLLATE=Chinese (Simplified)_People's Republic of China.936
[2] LC_CTYPE=Chinese (Simplified)_People's Republic of China.936
[3] LC_MONETARY=Chinese (Simplified)_People's Republic of China.936
[4] LC_NUMERIC=C
[5] LC_TIME=Chinese (Simplified)_People's Republic of China.936
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] Rcpp_0.11.5
loaded via a namespace (and not attached):
[1] RcppArmadillo_0.4.650.1.1 tools_3.1.3
thanksAt 2015-03-10 20:28:24, rcpp-devel-request at lists.r-forge.r-project.org wrote:>Welcome to the Rcpp-devel at lists.r-forge.r-project.org mailing list!>>To post to this list, send your message to:>> rcpp-devel at lists.r-forge.r-project.org>>General information about the mailing list is at:>> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel>>>If you ever want to unsubscribe or change your options (eg, switch to>or from digest mode, change your password, etc.), visit your>subscription page at:>> https://lists.r-forge.r-project.org/cgi-bin/mailman/options/rcpp-devel/zjgslxh%40163.com>>>You can also make such adjustments via email by sending a message to:>> Rcpp-devel-request at lists.r-forge.r-project.org>>with the word `help' in the subject or body (don't include the>quotes), and you will get back a message with instructions.>>You must know your password to change your options (including changing>the password, itself) or to unsubscribe without confirmation. It is:>> mugua123>>Normally, Mailman will remind you of your lists.r-forge.r-project.org>mailing list passwords once every month, although you can disable this>if you prefer. This reminder will also include instructions on how to>unsubscribe or change your account options. There is also a button on>your options page that will email your current password to you.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20150310/a16585b3/attachment-0001.html>
More information about the Rcpp-devel
mailing list