Gabor,
   
  Thank you very much for such a quick response.
   
  As I am new to this area, will you please explain where can I put SEXP func(SEXP a);
in my program.
   
  Once again, thank you very much for your quick response.
   
  Regards,
   
  Deb
  

Gabor Csardi <csardi@rmki.kfki.hu> wrote:
  On Wed, Jul 04, 2007 at 04:39:18AM -0700, Deb Midya wrote:
> Hi R Users,
> 
> Thanks in advance.
> 
> I am using R-2.5.1 on Windows XP.
> 
> I am trying to call C code (testCX1.C) from R. testCX1.c calls another C code (funcC1.c) and returning a value to testCX1.c. I like to have this value in R.
> 
> My steps are below:
> 
> 1. R CMD SHLIB testCX1.c funcC1.c (at command propmt)
> 
> 2. It creates testCX1.dll with warning (but testCX1.dll works):
> 
> testCX1.c:38: warning: implicit declaration of function 'func'
> 
> How to get rid off this error ?

By adding the prototype of 'func' to testCX1.c:

SEXP func(SEXP a);

Probably it is simplest to collect all prototypes in a single header file
and include that from all .c files.

> What is the best way to call funcC1.c from testCX1.c?

See .C and .Call and in particular the 'Writing R Extensions' manual,
5 System and foreign language interfaces.

Gabor

[...]

-- 
Csardi Gabor MTA RMKI, ELTE TTK


       
---------------------------------
Boardwalk for $500? In 2007? Ha! 

	[[alternative HTML version deleted]]

