cannot convert int* to integer*

Open discussion regarding features, bugs, issues, vendors, etc.

cannot convert int* to integer*

Postby yifli82 » Fri Jun 08, 2012 2:31 pm

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
yifli82
 
Posts: 3
Joined: Thu Jun 07, 2012 12:19 pm

Re: cannot convert int* to integer*

Postby rodney » Fri Jun 08, 2012 3:31 pm

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
rodney
 
Posts: 49
Joined: Thu Feb 10, 2011 8:20 pm
Location: Colorado College

Re: cannot convert int* to integer*

Postby yifli82 » Fri Jun 08, 2012 4:02 pm

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
yifli82
 
Posts: 3
Joined: Thu Jun 07, 2012 12:19 pm

Re: cannot convert int* to integer*

Postby rodney » Fri Jun 08, 2012 4:08 pm

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
rodney
 
Posts: 49
Joined: Thu Feb 10, 2011 8:20 pm
Location: Colorado College


Return to User Discussion

Who is online

Users browsing this forum: No registered users and 1 guest