Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
Welcome to the Intel Community. If you get an answer you like, please mark it as an Accepted Solution to help others. Thank you!
26758 Discussions

GlutilsMOD.f90 does not compile with XE 2017

chunky_lover_23
Beginner
152 Views

Trying to rebuild my programs on XE2017 (ID w_comp_lib_2017.4.210)  under Microsoft Visual Studio Enterprise 2015 (Version 14.0.25431.01 Update 3)

Get an error:

error #8752: This derived type component of an interoperable type is not itself interoperable (does not have the BIND(C) attribute).   [PALPALENTRY]

Any Ideas

Snippet from code see: below:

 

! Declare our own type for LOGPALETTE - the one in IFWINTY has just

! one element. The C code used malloc, and there are various Fortran

! ways we could fudge this, but the following seems simplest. Note that

! there is a 256-entry limit to a palette.

type, bind(C) :: OUR_LOGPALETTE

integer(WORD) palVersion

integer(WORD) palNumEntries

TYPE (T_PALETTEENTRY) palPalEntry(0:255)

 

0 Kudos
1 Solution
andrew_4619
Honored Contributor I
152 Views
        type :: OUR_LOGPALETTE
              sequence
              integer(WORD) palVersion
              integer(WORD) palNumEntries 
              TYPE (T_PALETTEENTRY) palPalEntry(0:255)
        end type OUR_LOGPALETTE

Removing bind(c) and add sequence works.

View solution in original post

3 Replies
andrew_4619
Honored Contributor I
153 Views
        type :: OUR_LOGPALETTE
              sequence
              integer(WORD) palVersion
              integer(WORD) palNumEntries 
              TYPE (T_PALETTEENTRY) palPalEntry(0:255)
        end type OUR_LOGPALETTE

Removing bind(c) and add sequence works.

View solution in original post

andrew_4619
Honored Contributor I
152 Views

Otherwise you would need to define your own type  MY_T_PALAETTENTRY with bind(c)

chunky_lover_23
Beginner
152 Views

Thank you Andrew.  The "sequence" option works a treat..

Reply