我在程序中include一个数值计算的函数库,
结果编译链接的时候出现如下的链接错误,
请教各位大侠,该如何解决这个问题?谢谢!Linking...
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _free already defined in LIBCD.lib(d
bgheap.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _malloc already defined in LIBCD.lib
(dbgheap.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _exit already defined in LIBCD.lib(c
rt0dat.obj)
LINK : warning LNK4098: defaultlib "MSVCRT" conflicts with use of other libs
; use /NODEFAULTLIB:library
Debug/test_lapack.exe : fatal error LNK1169: one or more multiply defined sy
mbols found
Error executing link.exe.
结果编译链接的时候出现如下的链接错误,
请教各位大侠,该如何解决这个问题?谢谢!Linking...
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _free already defined in LIBCD.lib(d
bgheap.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _malloc already defined in LIBCD.lib
(dbgheap.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _exit already defined in LIBCD.lib(c
rt0dat.obj)
LINK : warning LNK4098: defaultlib "MSVCRT" conflicts with use of other libs
; use /NODEFAULTLIB:library
Debug/test_lapack.exe : fatal error LNK1169: one or more multiply defined sy
mbols found
Error executing link.exe.
extern "C" {
#undef min
#undef max
#include "f2c.h"
#undef abs
#include "clapack.h"
}
}#define SIZE 4void main()
{
char JOBU;
char JOBVT; int i;
long M = SIZE;
long N = SIZE;
long LDA = M;
long LDU = M;
long LDVT = N;
long LWORK;
long INFO;
int mn = min( M, N );
int MN = max( M, N );
double a[SIZE*SIZE] = { 16.0, 5.0, 9.0 , 4.0, 2.0, 11.0, 7.0 , 14.0, 3.0, 10.0, 6.0, 15.0, 13.0, 8.0, 12.0, 1.0};
double s[SIZE];
double wk[201];
double uu[SIZE*SIZE];
double vt[SIZE*SIZE];
JOBU = 'A';
JOBVT = 'A';
LWORK = 201;
lapack::dgesvd_( &JOBU, &JOBVT, &M, &N, a, &LDA, s, uu,
&LDU, vt, &LDVT, wk, &LWORK, &INFO);
}
多线程时Release对应MultiThread,而Debug对应Debug MultiThread