Unhandled exception

Unhandled exception

I use MKL8.01 in VS2005, and code below:

bool linsol ( int n, float *a, float *b )
{
int nrhs = 1;
int *ipiv = new int[n] ;
int info = 0;
/* -------------------------- */
//float a[16] = { 1, 0, 0, 0,
// 0, 1, 0, 0,
// 0, 0, 1, 0,
// 0, 0, 0, 1
// };
//float b[4] = {1, 1, 1, 1};
//int n = 4;
/*-------------------------------*/
sgetrs( "T", &n, &nrhs, a, &n, ipiv, b, &n, &info );
if (info == 0)
return true;
return false;
}

The commented lines are the data values.


When I call this function, there is
"Unhandled exception at 0x00451952 in Hermite.exe: 0xC0000005:
Access violation reading location 0x374a2b88."

And I found that the CallStack show the problem as below:

Hermite.exe!_mkl_blas_p4p_sswap() + 0xe2 bytes Asm
Hermite.exe!_mkl_lapack_sgetrs() + 0x25e bytes
Hermite.exe!_mkl_blas_sswap() + 0x93 bytes
Hermite.exe!_mkl_lapack_slaswp() + 0x18c bytes
0012f470()
> Hermite.exe!CHermiteDlg::Hermit() Line 226 C++


However, I don't know how to solve it.
Is there anyone can help me?
Thanks.
1 post / 0 new
For more complete information about compiler optimizations, see our Optimization Notice.