I am attempting to bring R-3.0.2 functionality into a project with a very
large C++ codebase.  The existing codebase already has a LENGTH function
defined.  R also defines a LENGTH function.

I first compiled R as a shared library and linked it into this existing
codebase, along with RInside. When I run a parseEvalQ with a linear model
command it will stack dump.  Looking at the backtrace, what is happening is
that line 51 of lm.c is executing:

if(n) ny = LENGTH(y)/n;  /* n x ny, or a vector */

However, the LENGTH call is getting routed into our internal codebase.
 This causes a stack dump.

I then tried compiling R as a static library.  After that I couldn't even
compile my existing code because it flags the issue right off the bat:

... error: declaration of C function 'int LENGTH(const ... *)' conflicts
with
... /r/lib64/R/include/Rinternals.h:435: error: previous declaration 'int
LENGTH(SEXPREC*)' here

It is not possible to remove/rename the LENGTH function from the existing
codebase.  Any help would be appreciated in resolving this.

Thanks.

	[[alternative HTML version deleted]]

