How to solve this error in VS2008 linking with Clapack?

Open discussion regarding features, bugs, issues, vendors, etc.

How to solve this error in VS2008 linking with Clapack?

Postby jeolane200820 » Mon Mar 21, 2011 11:06 pm

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.
jeolane200820
 
Posts: 1
Joined: Mon Mar 21, 2011 10:33 pm

Re: How to solve this error in VS2008 linking with Clapack?

Postby admin » Tue Mar 29, 2011 4:33 am

It seems that libf2cd.lib (the F2C library) was not built or the location of the library is not correct.
Julie
admin
Site Admin
 
Posts: 501
Joined: Wed Dec 08, 2004 7:07 pm

Re: How to solve this error in VS2008 linking with Clapack?

Postby donaldsmith » Fri Jul 29, 2011 2:40 am

Presumably, the error is because you're trying to build the application against the (desktop) Windows SDK. The easiest thing to do is to create a new "Win32 Smart Device" project and add your code to it.

Alternatively, check the "Compile for architecture" setting under project properties -> C/C++ and ensure that it is set for the appropriate architecture.
donaldsmith
 
Posts: 3
Joined: Fri Jul 22, 2011 4:18 am


Return to User Discussion

Who is online

Users browsing this forum: Bing [Bot], Google [Bot], Yahoo [Bot] and 1 guest

cron