From laurent.mauron at credit-suisse.com  Thu Mar 17 13:22:44 2005
From: laurent.mauron at credit-suisse.com (Mauron Laurent (KETR 31))
Date: Thu Mar 17 13:22:58 2005
Subject: [Rd] Compiling "R Embedded" examples
Message-ID: <ED765D0AD42FD6408805FA8A766868D103C4E8B3@sxchs009b.itzrh.ska.com>

Hi,

This question was first posted wrongly on R-help. Apologize for the inconvenience.

I am working at a major financial institution and we would like to embed R in one of our front office application. 
The application is written in C/C++ so I started by trying to compile the examples in "tests/Embedding" of R 2.0.1.

I have modified "tests/Embedding/Makefile" according to  https://stat.ethz.ch/pipermail/r-help/2005-February/064341.html 
and set "LD_LIBRARY_PATH" using 

export LD_LIBRARY_PATH="/home/laurent/R-clean/lib/R/lib"

But I get the following error messages during linking:

---------------------
laurent@pollux $ make clean
laurent@pollux $ make
gcc -I. -I../../src/include -I/home/laurent/R-2.0.1/src/include -I/usr/local/include -DHAVE_CONFIG_H   -g -O2 -c /home/laurent/R-2.0.1/tests/Embedding/Rtest.c -o Rtest.o
gcc -I. -I../../src/include -I/home/laurent/R-2.0.1/src/include -I/usr/local/include -DHAVE_CONFIG_H   -g -O2 -c /home/laurent/R-2.0.1/tests/Embedding/embeddedRCall.c -o embeddedRCall.o
../../bin/R CMD LINK gcc -o Rtest Rtest.o embeddedRCall.o -L/home/laurent/R-clean/lib -lR
mkdir .libs
gcc -o Rtest Rtest.o embeddedRCall.o  -L/home/laurent/R-clean/lib -lR -R/home/laurent/R-clean/lib/R/lib
Undefined                       first referenced
 symbol                             in file
MAIN__                              /home/laurent/R-clean/lib/libR.so
ld: fatal: Symbol referencing errors. No output written to Rtest
collect2: ld returned 1 exit status
*** Error code 1
make: Fatal error: Command failed for target `Rtest'
-----------------------

I have installed R from source using the following commands.

-----------------------
laurent@pollux $ cd /home/laurent/R-clean/
laurent@pollux $ /home/laurent/R-2.0.1/configure --enable-R-shlib --prefix=/home/laurent/R-clean
laurent@pollux $ make
laurent@pollux $ make install
-----------------------

I am running Solaris 5.8 as non-admin user, compiler is gcc 2.95.3. Please let me know if more specific information about the environment is required.

Has anyone ne an idea where is the problem? I would be extremly grateful if someone could help us.

Best regards,

Laurent


[Rd] Compiling "R Embedded" examples
Mauron Laurent (KETR 31