Visual Studio 2010 and KIND=C_INT64_T error

Visual Studio 2010 and KIND=C_INT64_T error

I'm using visual studio 2010, Visual Fortran Compiler XE 12.0.4.196 [Intel(R) 64], Windows 7_64 and I have a snippet of a module:

MODULE test

  USE, INTRINSIC :: ISO_C_BINDING

  IMPLICIT NONE

  TYPE, BIND(C) :: tmp
     INTEGER(c_int64_t) :: tmp2
  END TYPE mesg_t

And I get the error message:

error #6684: This is an incorrect value for a kind type parameter in this context. [C_INT64_T]
Does this mean that C_INT64_T is not defined (.i.e. a negative kind). How do I pass to C an INT64_T type from Fortran in a portable way in Windows using the Intel compiler without the need to write a separate code to find the equivalent integer KIND in fortran? I have no problems in linux.

 Thanks.

6 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

The current version does define C_INT64_T on Windows. It's possible that 12.0.4 didn't - I will check in the morning. The definitions differ by platform depending on what the then-current "corresponding" C compiler supported.

Steve Intel Developer Support

Sorry for not getting to this yesterday. Indeed, compiler version 12.0 defined C_INT64_T as -2 because older versions of VS didn't support stdint.h. We added support for those kinds in compiler version 12.1 (Composer XE 2011 SP1).

Steve Intel Developer Support

Thanks Steve, I'll add a test at build time to see if C_INT64_T is defined, but it's good to know what version it was first supported in.

It is defined, but defined as -2 because "the C processor does not define the corresponding C type".

Steve Intel Developer Support

Sorry, I meant: check to see if it is a valid KIND.

Login to leave a comment.