2
我試圖從內部R. http://code.google.com/p/eureqa-api/ 我使用下面的代碼運行Eurequa但我得到一個編譯錯誤:R:與Eurequa連接R,RCPP編譯錯誤
Error in compileCode(f, code, language = language, verbose = verbose) :
Compilation ERROR, function(s)/method(s) not created!
library(Rcpp)
library(inline)
rcpp1 <- '
int main(int argc, char *argv[])
{
// initialize data set and options
eureqa::data_set data("abc1.txt");
eureqa::search_options options("y = f(x)");
// connect to a eureqa server
eureqa::connection conn("127.0.0.1");
conn.send_data_set(data);
conn.send_options(options);
conn.start_search();
// display results
eureqa::search_progress progress;
eureqa::solution_frontier solutions;
while (conn.query_progress(progress))
{
solutions.add(progress.solution_);
std::cout << progress.summary() << std::endl;
std::cout << solutions.to_string() << std::endl;
}
return 0;
}
'
rcpp2 <- cxxfunction(
rcpp1, plugin="Rcpp",
includes=c('#include <eureqa/eureqa.h>, <iostream>'))
rcpp2()
我將不勝感激您的幫助。
非常感謝您的糾正和參考。 – 2012-07-17 10:59:58
這給了eurequa.h:http://code.google.com/p/eureqa-api/downloads/detail?name = eureqa_api_1_08_0.zip&can = 2&q = – 2012-08-20 19:53:39
這給出了包含iostream的boost C++庫:http:// sourceforge .NET /項目/升壓/文件/升壓/ 1.50.0/boost_1_50_0.zip /下載?了utm_expid = 6384-3&utm_referrer =的http%3A%2F%2Fwww.boost.org%2Fusers%2Fhistory%2Fversion_1_50_0.html – 2012-08-20 19:56:40