- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am totally new to mixed-language programming and am having difficulty creating a dll to be called by R. I found the following small example which supposedly works for the CVF 6.6 compiler online:
SUBROUTINE MYSUB(X,N,XMEAN)
CDEC$ ATTRIBUTES DLLEXPORT,C,REFERENCE,ALIAS:'mysub_' :: MYSUB
IMPLICIT DOUBLE PRECISION (A-H,O-Z)
DOUBLE PRECISION X(N)
XMEAN=0D0
DO 10 J=1,N
XMEAN=XMEAN+X(J)
10 CONTINUE
XMEAN=XMEAN/N
RETURN
END
When I try to load the dll in R using dyn.load(), I receive the following error message (I replaced the long path with <file> in the message):
Error in inDL(x, as.logical(local), as.logical(now), ...) :
unable to load shared object '<file>':
LoadLibrary failure: %1 is not a valid Win32 application.
nd.
I am using XE 12.1 with the Visual Studio shell and R 2.15.1. Are there other compiler directives or Project settings I shoudl experiment with?
Many thanks!
Jeff
>
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page