Page 1 of 1

cannot convert int* to integer*

PostPosted: Fri Jun 08, 2012 2:31 pm
by yifli82
Hi all,

I downloaded clapack from http://www.netlib.org/clapack/ and compiled it successfully.

However, I got the following error when calling dsyev_:

error C2664: 'dsyev_' : cannot convert parameter 3 from 'int *' to 'integer *'

How should I resolve this error? Thanks

Yifei

Re: cannot convert int* to integer*

PostPosted: Fri Jun 08, 2012 3:31 pm
by rodney
You need to make sure you #include <f2c.h> in your source file. In the f2c.h header file, there is a typedef that sets the "integer" type.

--Rodney

Re: cannot convert int* to integer*

PostPosted: Fri Jun 08, 2012 4:02 pm
by yifli82
Hi Rodney,

I did include f2c.h. However, in f2c.h

Code: Select all
typedef long int integer;


I fixed the problem by declaring the relevant variables as 'long int' instead of 'int'.

Thanks

Yifei

Re: cannot convert int* to integer*

PostPosted: Fri Jun 08, 2012 4:08 pm
by rodney
You could also, if you wanted to use int's instead of long int's, change the typedef in f2c.h to "typedef int integer" and recompile everything...

--Rodney