[R] R CMD SHLIB changes function name when compiling

2010-10-08 Thread Steve Pederson
Hi, I'm trying to write a function in C for implementation with .Call. When compiling using R CMD SHLIB characters seem to be added to the function name. Here's the complete C code from the file summariseMCMC.c: #includeR.h #includeRdefines.h #includeRinternals.h void summariseMCMC(SEXP

Re: [R] R CMD SHLIB changes function name when compiling

2010-10-08 Thread Prof Brian Ripley
On Fri, 8 Oct 2010, Steve Pederson wrote: Hi, I'm trying to write a function in C for implementation with .Call. When compiling using R CMD SHLIB characters seem to be added to the function name. Here's the complete C code from the file summariseMCMC.c: #includeR.h #includeRdefines.h

Re: [R] R CMD SHLIB changes function name when compiling

2010-10-08 Thread Steve Pederson
Hi Prof Ripley, Thanks for the response the use of the correct terminology. I've checked the environment variables there is none set called CC. The .dll was definitely compiled using R CMD SHLIB. I'm not quite sure what output you're referring to but at the command prompt when I enter:

Re: [R] R CMD SHLIB changes function name when compiling

2010-10-08 Thread Steve Pederson
I think I should also add that I have compiled R from source so am pretty confident that I have the correct set of Rtools. On 8/10/2010 8:06 PM, Prof Brian Ripley wrote: On Fri, 8 Oct 2010, Steve Pederson wrote: Hi, I'm trying to write a function in C for implementation with .Call. When

Re: [R] R CMD SHLIB changes function name when compiling

2010-10-08 Thread Mike Marchywka
Date: Sat, 9 Oct 2010 01:21:47 +1030 From: stephen.peder...@adelaide.edu.au To: rip...@stats.ox.ac.uk CC: r-help@r-project.org Subject: Re: [R] R CMD SHLIB changes function name when compiling I think I should also add that I have compiled R

Re: [R] R CMD SHLIB changes function name when compiling

2010-10-08 Thread Prof Brian Ripley
Is the file .c or .C? You said .c, but then you said a .C file worked (which it should not have), and I wonder if you have this backwards. A .c file is C, a .C file is C++ (in R 2.11.1 but not R 2.12.0). extern C would be required if this were a C++ source, but we were told otherwise. On

Re: [R] R CMD SHLIB changes function name when compiling

2010-10-08 Thread Steve Pederson
It seems that was the problem. My apologies as I was unaware of the difference between a .c file a .C file. Thanks again for your help, Steve On 9/10/2010 1:37 AM, Prof Brian Ripley wrote: Is the file .c or .C? You said .c, but then you said a .C file worked (which it should not have),