简体   繁体   中英

How to load custom dll in R

When running a R script in a windows console using a custom DLL , I get the error "can't load shared object path\\dllname".

But the DLL is exactly in this location. Further, using the R gui, I can execute the script.

Where is R looking for DLLs ?

My call is:

dyn.load(paste("myrdll", .Platform$dynlib.ext, sep=""))

The DLL is located in the same folder as the script and in addition in the appropriate system folder. What is R expecting in addition?

Thank you

R cannot load arbitrary DLLs. It can only load those created by compiling and linking the source files using R CMD SHLIB . See the ?utils::SHLIB help page.

I am sorry to confuse the forum: I was trying to load a 32 bit R Wrapper DLL in a 64 bit console. I was thinking the default CMD window on Win 10 64 bit is still 32 bit. So the problem is caused by architecture mismatch.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM