[R-SIG-Mac] Conflict between embedded R and use of NSString class method

Simon Urbanek simon.urbanek at r-project.org
Mon Oct 29 01:01:09 CET 2012


On Oct 28, 2012, at 7:03 PM, Paul Johnson wrote:

> Thanks, Simon. After defining R_NO_REMAP in 'OTHER C FLAGS' I get 10 fatal errors from the loader:

Unsurprisingly - you can't set R_NO_REMAP for everything since you don't want to set it for the engine itself. What I meant is that I would simply add
#define R_NO_REMAP
before you include any R header or (if you don't use any R headers directly) before
#include "REngine.h"

Cheers,
Simon


> ents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk -L/Users/paul/Library/Developer/Xcode/DerivedData/REngineTest-dajzwkgfjbqqcafqzihbaptshuzf/Build/Products/Debug -F/Users/paul/Library/Developer/Xcode/DerivedData/REngineTest-dajzwkgfjbqqcafqzihbaptshuzf/Build/Products/Debug -F/Library/Frameworks -filelist /Users/paul/Library/Developer/Xcode/DerivedData/REngineTest-dajzwkgfjbqqcafqzihbaptshuzf/Build/Intermediates/REngineTest.build/Debug/REngineTest.build/Objects-normal/x86_64/REngineTest.LinkFileList -mmacosx-version-min=10.8 -fobjc-link-runtime -framework Cocoa -framework R -o /Users/paul/Library/Developer/Xcode/DerivedData/REngineTest-dajzwkgfjbqqcafqzihbaptshuzf/Build/Products/Debug/REngineTest.app/Contents/MacOS/REngineTest
> 
> Undefined symbols for architecture x86_64:
>   "_allocVector", referenced from:
>       _QuartzCocoa_Cap in QuartzView.o
>       _Re_packagemanger in Rcallbacks.o
>       _Re_datamanger in Rcallbacks.o
>       _Re_browsepkgs in Rcallbacks.o
>       _Re_do_hsbrowser in Rcallbacks.o
>       _Re_do_selectlist in Rcallbacks.o
>       -[REngine parse:withParts:] in REngine.o
>       ...
>   "_asLogical", referenced from:
>       _Re_do_selectlist in Rcallbacks.o
>   "_error", referenced from:
>       _Re_do_selectlist in Rcallbacks.o
>   "_errorcall", referenced from:
>       _Re_packagemanger in Rcallbacks.o
>       _Re_datamanger in Rcallbacks.o
>       _Re_browsepkgs in Rcallbacks.o
>       _Re_do_hsbrowser in Rcallbacks.o
>   "_getAttrib", referenced from:
>       -[RSEXP attr:] in RSEXP.o
>   "_install", referenced from:
>       -[RSEXP attr:] in RSEXP.o
>   "_mkChar", referenced from:
>       _Re_do_selectlist in Rcallbacks.o
>       -[REngine parse:withParts:] in REngine.o
>       -[RSEXP initWithString:] in RSEXP.o
>   "_setAttrib", referenced from:
>       _QuartzCocoa_Cap in QuartzView.o
>   "_warning", referenced from:
>       _QuartzCocoa_DeviceCreate in QuartzView.o
>       _QuartzCocoa_Cap in QuartzView.o
> ld: symbol(s) not found for architecture x86_64
> clang: error: linker command failed with exit code 1 (use -v to see invocation)
> 
> 
> On Sun, Oct 28, 2012 at 3:43 PM, Simon Urbanek <simon.urbanek at r-project.org> wrote:
> 
> On Oct 28, 2012, at 2:37 PM, Paul Johnson wrote:
> 
> > I'm trying to use embedded R (REngine). In my own code I call the NSString
> > class method '+stringWithContentsOfFile:encoding:error:'. Unfortunately, I
> > can't because the embedded R that I include using '#import "Rengine.h"'
> > redefines 'error' and the compiler is unable to recognize the NSString
> > class method.
> >
> > How can this dilemma be solved?
> >
> 
> I strongly prefer using R_NO_REMAP since there are a lot of "gotchas" when using shortened R names including the "error" one.
> 
> Cheers,
> Simon
> 
> 



More information about the R-SIG-Mac mailing list