Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
12 Views

GlutilsMOD.f90 does not compile with XE 2017

Jump to solution

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

Accepted Solutions
Highlighted
Valued Contributor III
12 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
Highlighted
Valued Contributor III
13 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
Highlighted
Valued Contributor III
12 Views

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

0 Kudos
Highlighted
12 Views

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

0 Kudos