Dear R users,
I am writing binding from C library to R.
I use R 2.4.1, windows XP, and MinGW.
commands
set PKG_CPPFLAGS=-I../sources -I.
set PKG_LIBS=-Lc:/mingw/lib -lfl -liberty
set DEBUG=T
R CMD SHLIB -d --output=Rsnns.dll [ list of all C sources]
produce the DLL having all defined
On Mon, Feb 05, 2007 at 01:28:24AM -0800, Vladimir Eremeev wrote:
I am writing binding from C library to R.
I use R 2.4.1, windows XP, and MinGW.
R CMD SHLIB -d --output=Rsnns.dll [ list of all C sources]
R CMD SHLIB -d --output Rsnns.dll Rsnns.c
Andrew Piskorski wrote:
On Mon, Feb 05, 2007 at 01:28:24AM -0800, Vladimir Eremeev wrote:
I am writing binding from C library to R.
I use R 2.4.1, windows XP, and MinGW.
R CMD SHLIB -d --output=Rsnns.dll [ list of all C sources]
R CMD SHLIB -d --output Rsnns.dll Rsnns.c
Vladimir Eremeev wrote:
It calls gcc:
gcc -I../sources -I. -IC:/PROGRA~1/R/include -gdwarf-2 -Wall -O2
-std=gnu99 -c rsnns.c -o rsnns.o
gcc -shared -o Rsnns.dll Rsnns.def [ lots of *.o ] -LC:/PROGRA~1/R/bin
-Lc:/mingw/lib -lfl -liberty -lR
The file Rsnns.def is generated
It is a bit different on Windows, since it is making a DLL and GNU ld has
lots of special-casing for those.
To see how to do it, look at the standard package 'stats'. That has a
.def file and it works. The naming convention is probably what you
missed. (Also, things have changed since R
On Mon, 5 Feb 2007, Vladimir Eremeev wrote:
Vladimir Eremeev wrote:
Something important is missing here!
It calls gcc:
gcc -I../sources -I. -IC:/PROGRA~1/R/include -gdwarf-2 -Wall -O2
-std=gnu99 -c rsnns.c -o rsnns.o
gcc -shared -o Rsnns.dll Rsnns.def [ lots of *.o ]