我收到一個鏈接器錯誤,指出在嘗試使用g ++編譯RInside示例文件時找不到符號。任何援助將不勝感激。g ++ ld無法找到適用於x86_64架構的RInside符號
R版本2.13.1安裝在Mac OS X 10.5上。 Rcpp和RInside包含文件已被複制到usr/include目錄。 ř頭文件和庫已經使用-I和g ++的-L改性劑包括如下所示:
$g++ -I/Library/Frameworks/R.framework/Headers -L/Library/Frameworks/R.framework/Libraries rinside_sample0.cpp
的rinside_sample0.cpp文件是設置有RInside包的樣品,如下所示:
// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 8; -*-
//
// Simple example showing how to do the standard 'hello, world' using embedded R
//
// Copyright (C) 2009 Dirk Eddelbuettel
// Copyright (C) 2010 Dirk Eddelbuettel and Romain Francois
//
// GPL'ed
#include <RInside.h> // for the embedded R via RInside
int main(int argc, char *argv[]) {
RInside R(argc, argv); // create an embedded R instance
R["txt"] = "Hello, world!\n"; // assign a char* (string) to 'txt'
R.parseEvalQ("cat(txt)"); // eval the init string, ignoring any returns
exit(0);
}
當我嘗試用克至++編譯我得到一個錯誤,如下圖所示:
ld: symbol(s) not found for architecture x86_64
有人能告訴我什麼,我做錯了,如何解決?任何援助將不勝感激。
如何檢查框架設置以查看其構建的體系結構? – Aperium
嘗試shell:文件DIR/TO/Lib.a – namar0x0309