Skip to content

Fortran DLL

2 messages · Alex Randriamiharisoa, Roger Bivand

#
Dear R-users,
After the reading of "Writing R extensions", "readme.packages", "Using 
external compilers with
R", ...,  I have tried to create a DLL for my Fortran file using the command:

g77 --shared -o robeth.dll robeth.f

and failed with several messages as :
c:\temp/ccU8N5fb.o: ...  undefined reference to 'realpr_'
c:\temp/ccU8N5fb.o: ...  undefined reference to 'dblepr_'
c:\temp/ccU8N5fb.o: ...  undefined reference to 'intpr_'
c:\temp/ccU8N5fb.o: ...  undefined reference to 'rexit_'

What I have missed. If I insert #include <R.h> at the top of the file, the 
MinGW
g77 compiler exits immediately =>  "undefined or invalid # directives"

I've tested on  R Version 1.5.1 and 1.7.0, for windows. If a special 
library is needed,
someone could send it to me by mail.
Thanks for your help.
Alex R.
#
On Fri, 23 May 2003, Alex Randriamiharisoa wrote:

            
These are references to R.dll, which is not linked.

Perhaps try 

Rcmd SHLIB robeth.f

to use the build train that will link correctly.