- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Link Copied
5 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It is defined, but defined as -2 because "the C processor does not define the corresponding C type".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sorry, I meant: check to see if it is a valid KIND.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page