LAPACK Archives

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

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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
http://lists.eecs.utk.edu/mailman/private/lapack/attachments/20110915/bad0642d/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