[Rd] How to customize the list of exported functions in a shared library

2007-02-05 Thread Vladimir Eremeev
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

Re: [Rd] How to customize the list of exported functions in a shared library

2007-02-05 Thread Andrew Piskorski
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 > -Wl,-Lc:/mingw/lib,-lfl,-L../sources,-

Re: [Rd] How to customize the list of exported functions in a shared library

2007-02-05 Thread Vladimir Eremeev
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 >>

Re: [Rd] How to customize the list of exported functions in a shared library

2007-02-05 Thread Prof Brian Ripley
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 2.2.

Re: [Rd] How to customize the list of exported functions in a shared library (update)

2007-02-05 Thread Vladimir Eremeev
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

Re: [Rd] How to customize the list of exported functions in a shared library (update)

2007-02-05 Thread Prof Brian Ripley
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 ] -