我在C++中想调用R的函数,按照网上步骤编译了R之后生成了libRInside.dll,RInside.dll,Rmath.dll。之后写了如下代码:
<br />
#define MATHLIB_STANDALONE 1<br />
#include "stdafx.h"<br />
#include "Rmath.h"<br />
#include "R.h"<br />
//#include <RInside.h><br />
#include <iostream><br />
using namespace std;</p>
<p>#pragma comment(lib, "E:\\Codes\\测试代码\\RinCTest\\RinCTest\\Rmath.lib")</p>
<p>int _tmain(int argc, _TCHAR* argv[])<br />
{<br />
double x = fmax2(1.0, 2.0);<br />
return 0;<br />
}<br />
但编译时报错:error LNK2001: 无法解析的外部符号 _Rf_fmax2
请问是什么原因?还有哪些库需要加载?
平台:Win8 32bit
编译器:VS 2005
</p>