What's the problem of my program?
-
Hi all: The following is my program.
#define WIN32_LEAN_AND_MEAN #include #include #include #include #include "lapack\matrix_clapack.h" #define NDIM 2 #define M_PI 3.14 int main (){ integer i, j, info2; integer N, NRHS, LDA, LDB; doublecomplex *A; doublecomplex *B; static integer IPIV[NDIM], INFO; A = (doublecomplex*) malloc(NDIM*NDIM*sizeof(doublecomplex)); B = (doublecomplex*) malloc(NDIM*sizeof(doublecomplex)); N=NDIM; NRHS=1; LDA=NDIM; LDB=NDIM; for (i=0;i And here is the compiler message: `1>------ Build started: Project: test, Configuration: Debug Win32 ------ 1>Compiling... 1>test.cpp 1>Linking... 1>test.obj : error LNK2019: unresolved external symbol _zgesv_ referenced in function _main 1>D:\Project\test\Debug\test.exe : fatal error LNK1120: 1 unresolved externals 1>Build log was saved at "file://d:\Project\test\test\Debug\BuildLog.htm" 1>test - 2 error(s), 0 warning(s) ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========` I just want to try to test the LAPACK library. But what's the problem with this program please? Thanks Asura
-
Hi all: The following is my program.
#define WIN32_LEAN_AND_MEAN #include #include #include #include #include "lapack\matrix_clapack.h" #define NDIM 2 #define M_PI 3.14 int main (){ integer i, j, info2; integer N, NRHS, LDA, LDB; doublecomplex *A; doublecomplex *B; static integer IPIV[NDIM], INFO; A = (doublecomplex*) malloc(NDIM*NDIM*sizeof(doublecomplex)); B = (doublecomplex*) malloc(NDIM*sizeof(doublecomplex)); N=NDIM; NRHS=1; LDA=NDIM; LDB=NDIM; for (i=0;i And here is the compiler message: `1>------ Build started: Project: test, Configuration: Debug Win32 ------ 1>Compiling... 1>test.cpp 1>Linking... 1>test.obj : error LNK2019: unresolved external symbol _zgesv_ referenced in function _main 1>D:\Project\test\Debug\test.exe : fatal error LNK1120: 1 unresolved externals 1>Build log was saved at "file://d:\Project\test\test\Debug\BuildLog.htm" 1>test - 2 error(s), 0 warning(s) ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========` I just want to try to test the LAPACK library. But what's the problem with this program please? Thanks Asura
The implementation of the
zgesv_
function that is inside the LAPACK library could not be found during the linking process. You have to add the LAPACK library, the .lib file, to the list of libraries you're building with. Bring up the options for the project and add the path for the LAPACK lib-file to the "input libraries".
"It's supposed to be hard, otherwise anybody could do it!" - selfquote
"No one remembers a coward!" - Jan Elfström 1998
"...but everyone remembers an idiot!" - my lawyer 2005 when heard of Jan's saying above -
The implementation of the
zgesv_
function that is inside the LAPACK library could not be found during the linking process. You have to add the LAPACK library, the .lib file, to the list of libraries you're building with. Bring up the options for the project and add the path for the LAPACK lib-file to the "input libraries".
"It's supposed to be hard, otherwise anybody could do it!" - selfquote
"No one remembers a coward!" - Jan Elfström 1998
"...but everyone remembers an idiot!" - my lawyer 2005 when heard of Jan's saying aboveRoger Stoltz wrote:
Bring up the options for the project and add the path for the LAPACK lib-file to the "input libraries".
An easier way is to use a
#pragma comment(lib "LAPACK.lib")
(assuming LAPACK.lib is the lib file name) directive to link import libraries.
You may be right
I may be crazy
-- Billy Joel --Within you lies the power for good, use it!!!
-
Roger Stoltz wrote:
Bring up the options for the project and add the path for the LAPACK lib-file to the "input libraries".
An easier way is to use a
#pragma comment(lib "LAPACK.lib")
(assuming LAPACK.lib is the lib file name) directive to link import libraries.
You may be right
I may be crazy
-- Billy Joel --Within you lies the power for good, use it!!!
Ha, that one I didn't know about! :rose: Thanks for the info, PJ. Nice to know. My 5 for that! This day was not in vain after all, now that I've learnt something new...:-D
"It's supposed to be hard, otherwise anybody could do it!" - selfquote
"No one remembers a coward!" - Jan Elfström 1998
"...but everyone remembers an idiot!" - my lawyer 2005 when heard of Jan's saying above