Below are my codes. After i build all lib. files successfully, i changed the setting of VS2008, then i debug but failed.
// trial sample.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
#include <string>
using namespace std;
extern "C"{
#include <f2c.h>
#include <blaswrap.h>
#include <clapack.h>
};
int _tmain(int argc, _TCHAR* argv[])
{
integer itype;
itype=1;
char jobz;
jobz='V';
char uplo;
uplo='U';
integer n;
n=3;
doublereal a[]={2,-1,-1,-1,4,-3,-1,-3,4};
integer lda;
lda=3;
doublereal b[]={1,0,0,0,2,0,0,0,3};
integer ldb;
ldb=3;
doublereal *w;
w=new doublereal[3];
doublereal *work;
work=new doublereal[1];
work[0]=0;
integer lwork;
lwork=-1;
integer info;
int r=dsygv_(&itype,&jobz,&uplo,&n,a,&lda,b,&ldb,w,work,&lwork,&info);
cout<<"info="<<info<<endl;
if(info=0)
{
cout<<"the eigenvalues are:"<<endl;
for(int i=0;i<3;i++)
cout<<w[i]<<endl;
cout<<"the eigenvectors are"<<endl;
for(int i=0;i<9;i++)
cout<<a[i]<<endl;
cout<<"the works are:"<<endl;
for(int i=0;i<work[0];i++)
cout<<work[i]<<endl;
}else{
cout<<"Failed"<<endl;
}
return 0;
}
Here is my error :
1>------ Build started: Project: trial sample, Configuration: Debug Win32 ------
1>Compiling...
1>trial sample.cpp
1>Linking...
1>LINK : fatal error LNK1104: cannot open file 'libf2cd.lib'
1>Build log was saved at "file://c:\Users\AA\Documents\Visual Studio 2008\Projects\trial sample\trial sample\Debug\BuildLog.htm"
1>trial sample - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Can somebody help me solve this one ? thanks a lot.