3
我正在尝试使用dgesv_函数解决一个简单问题Ax = b。但是我遇到了一个我无法克服的问题。我的代码是:使用dgesv_时发生错误
#include <cstdio>
#include <f2c.h>
#include <clapack.h>
void main(void)
{
/* 3x3 matrix A
* 76 25 11
* 27 89 51
* 18 60 32
*/
double A[9] = {76, 27, 18, 25, 89, 60, 11, 51, 32};
double b[3] = {10, 7, 43};
int N = 3;
int nrhs = 1;
int lda = 3;
int ipiv[3];
int ldb = 3;
int info;
dgesv_(&N, &nrhs, A, &lda, ipiv, b, &ldb, &info);
}
我认为的代码是正确的,但是,每当我运行它,我得到以下错误:
LINK : C:\...\Eye Tracker.exe not found or not built by the last incremental link; performing full link
1> Creating library C:\...\Eye Tracker\Debug\Eye Tracker.lib and object C:\Users\Daniel\documents\visual studio 2010\Projects\Eye Tracker\Debug\Eye Tracker.exp
1>ellipse_fit.obj : error LNK2019: unresolved external symbol "void __cdecl dgesv_(int const *,int const *,double *,int const *,int *,double *,int const *,int *)" ([email protected]@[email protected]) referenced in function "void __cdecl ttt(void)" ([email protected]@YAXXZ)
1>C:\Users\Daniel\documents\visual studio 2010\Projects\Eye Tracker\Debug\Eye Tracker.exe : fatal error LNK1120: 1 unresolved externals
任何人有任何想法如何解决这个问题?
谢谢。
你所链接对LAPACK库?如果您是使用visual studio 2010编译lapack或使用visual studio 2010的libararies? – drescherjm