[R] dynamic linking

Samuel Kemp sam.kemp2 at ntlworld.com
Tue Mar 2 13:01:13 CET 2004


Hi,

I managed to fixed my problem with linking a ".a" file (an archive of .o 
files) with the following.....

g++ -I/usr/local/lib/R/include  -I/usr/local/include -mieee-fp  -fPIC  
-g -O2 -c fileGT.cc -o fileGT.o
(i.e. the beginning bit of R CMD SHLIB)

then I linked (underlined) the files with....

g++ -shared -L/usr/local/lib -o fileGT.so fileGT.o 
_-I/home/sekemp/Documents/ann_0.2/include 
-L/home/sekemp/Documents/ann_0.2/lib -lANN_

This is just for information incase any one else gets stuck on this 
problem and is googling around. There may be better ways where one does 
not need to type so much information into the compiler but hey it works!

Cheers,

Sam

----
Samuel Edward Kemp BSc (Hons) /Cardiff/,
Neural & Evolutionary Computation Research Group,
University of Glamorgan,
Wales,
UK.




More information about the R-help mailing list