LAPACK Archives

[Lapack] have irritating link error when linking with LAPACK with Vistua

Ok Julie. I'll try build with cmake. May bother you again if has more 
obstacles. Thanks a lot.
?
Lake

From: julie langou <julie@Domain.Removed>
To: da wang <dawang2002@Domain.Removed>
Cc: "lapack@Domain.Removed" <lapack@Domain.Removed>
Sent: Monday, September 19, 2011 7:51 AM
Subject: Re: [Lapack] have irritating link error when linking with LAPACK with 
Vistual Studio


Dear Lake,
did you try building directly the libraries?
You just have to download LAPACK and build it using cmake.
Julie

On Sep 15, 2011, at 11:08 AM, da wang wrote:

Oh, a little additional info: I am using Win7 on 64 bit machine so I use your 
x64 version. But I even tried your win32 version, still the same link error. 
Did I miss any step to compile with LAPACK in Windows? Thanks a lot.
?
Lake


From: da wang <dawang2002@Domain.Removed>
To: "lapack@Domain.Removed" <lapack@Domain.Removed>
Sent: Thursday, September 15, 2011 10:05 AM
Subject: have irritating link error when linking with LAPACK with Vistual 
Studio


Dear Sir/Madam,

I am very interested in using your LAPACK for Windows to do some calculation. 
However, from your website, I followed all your instructions to use LAPACK 
with your sample code, but always get?below link error:
1>------ Build started: Project: linkWithLAPACK, Configuration: Debug Win32 
------
1>Build started 9/15/2011 9:50:39 AM.
1>InitializeBuildStatus:
1>  Touching "Debug\linkWithLAPACK.unsuccessfulbuild".
1>ClCompile:
1>  All outputs are up-to-date.
1>  All outputs are up-to-date.
1>ManifestResourceCompile:
1>  All outputs are up-to-date.
1>linkWithLAPACK.obj : error LNK2019: unresolved external symbol _dgesv_ 
referenced in function _wmain
1>C:\R&D Example\linkWithLAPACK\Debug\linkWithLAPACK.exe : fatal error 
LNK1120: 1 unresolved externals
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:00.74
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
My code is directly copied from your website and made the change to use extern 
"C" per your instruction:
// linkWithLAPACK.cpp : Defines the entry point for the console application.
//#include
"stdafx.h"//#include < stdio.h>extern
"C"voiddgesv_(constint*N, constint*nrhs, double*A, constint*lda, int*ipiv, 
double*b, constint*ldb, int*info);/*extern "C"*/
voiddgels_(constchar*trans, constint*M, constint*N, constint*nrhs,
double*A, constint*lda, double*b, constint*ldb, double*work,
constint* lwork, int*info); int
_tmain(intargc, _TCHAR* argv[]){
/* 3x3 matrix A* 76 25 11
* 27 89 51
* 18 60 32
*/
doubleA[9] = {76, 27, 18, 25, 89, 60, 11, 51, 32};
doubleb[3] = {10, 7, 43};
intN = 3;
intnrhs = 1;
intlda = 3;
intipiv[3];
intldb = 3;
intinfo;dgesv_(&N, &nrhs, A, &lda, ipiv, b, &ldb, &info);
if(info == 0) /* succeed */printf(
"The solution is %lf %lf %lf\n", b[0], b[1], b[2]);
elsefprintf(stderr, 
"dgesv_ fails %d\n", info);?
returninfo;
//return 0;}

And in Visual Studio 2010?Linker->General->Additional Library Directories, I 
add the full path to the directory containing your .lib files. In 
Linker->Input->Additional Dependencies, I add 
"BLASd.lib;LAPACKd.lib;%(AdditionalDependencies)" since I am making debug 
build?with your debug version(even I changed to your no debug version, it's 
the same).

Everything is done according to the instruction in your website, but always 
get that link error. Really appreciate your guys help on this. Thanks a lot.

Lake
cell: (805)2026762
?

_______________________________________________
Lapack mailing list
Lapack@Domain.Removed
http://lists.eecs.utk.edu/mailman/listinfo/lapack

-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
http://lists.eecs.utk.edu/mailman/private/lapack/attachments/20110919/c07c94d7/attachment-0001.html
 

<Prev in Thread] Current Thread [Next in Thread>


For additional information you may use the LAPACK/ScaLAPACK Forum.
Or one of the mailing lists, or