[R] Using functions in LAPACK in a C program

Paul August paulaugust2003 at yahoo.com
Thu Mar 29 23:40:42 CEST 2007


Hi,

I wonder where I can find an example of using a function in LAPACK library in a user's own C code. I wrote a C program which will be compiled and linked to produce a DLL file and then loaded into R. I hope to use a function from LAPACK library, for example, dgesdd, in the program. Following R manual, I call the function by F77_CALL(dgesdd) in the program. The program can be compiled without problems. However, when it is linked to produce a DLL file, I get an error message 

  Test.obj : error LNK2001: unresolved external symbol _dgesdd_
  Test.dll : fatal error LNK1120: 1 unresolved externals

I use VC++6.0 and the command of linking is something like this

  link.exe Rdll.lib /nologo /dll /out:Test.dll /libpath:C:\R\R-2.2.1\src\gnuwin32 Test.obj

Apparently, the linker cannot resolve dgesdd from Rdll.lib. If anyone knows what I missed here or any example that shows how this can be done properly, please let me know. Thanks a lot.

Paul.



 
____________________________________________________________________________________
Never miss an email again!



More information about the R-help mailing list