Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28446 Discussions

GlutilsMOD.f90 does not compile with XE 2017

chunky_lover_23
Beginner
428 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 II
428 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

0 Kudos
3 Replies
andrew_4619
Honored Contributor II
429 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.

0 Kudos
andrew_4619
Honored Contributor II
428 Views

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

0 Kudos
chunky_lover_23
Beginner
428 Views

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

0 Kudos
Reply