Re: [Rd] C Interface

2010-06-20 Thread michael meyer
Thanks for all replies. I'll use inlining until I have figured out how to build a proper package. Michael [[alternative HTML version deleted]] __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel

Re: [Rd] C Interface

2010-06-19 Thread Daniel Cegiełka
I'm not a windows expert. You have C code file (not cc or cpp): > R CMD SHLIB OrthoFunctions.c and you use g++ compiler... ok, we can use c++ compiler for c.. but it's looks like c++ code with c code inside: > extern "C" { Try it without "extern "C" and with gcc compiler instead g++. regards,

Re: [Rd] C Interface

2010-06-18 Thread Dirk Eddelbuettel
Michael, You are getting confused in compiler minutia when you could be concentrating on your code. The inline package can help here. Consider the snippet below which loads inline, defines your function body sans headers etc and then uses the magic of inline to compile, link and load your fun

Re: [Rd] C Interface

2010-06-18 Thread Simon Urbanek
On Jun 18, 2010, at 10:23 AM, michael meyer wrote: > Greetings, > > I am trying to call simple C-code from R. > I am on Windows XP with RTools installed. > > The C-function is > > #include > #include > #include > #include > > // prevent name mangling > extern "C" { > > SEXP __cdecl test

[Rd] C Interface

2010-06-18 Thread michael meyer
Greetings, I am trying to call simple C-code from R. I am on Windows XP with RTools installed. The C-function is #include #include #include #include // prevent name mangling extern "C" { SEXP __cdecl test(SEXP s){ SEXP result; PROTECT(result = NEW_NUMERIC(1)); double* ptr=NUMERIC_PO