Illegal use error, please help

Hi all,
I’m getting an error reading

Error 1 Illegal use of symbol exception_noncontinuable_exception - not public entity of module C:\Program Files\Trnsys16_1\SourceCode\Kernel\Messages.f90 29

The code from which this appears to derive is:

use kernel32, only: RaiseException, EXCEPTION_NONCONTINUABLE_EXCEPTION

(those lines are broken up by the size of the window)
Anyhow, I’m a new user, so any help would be greatly appreciated.

Hi John,

You need to remove “EXCEPTION_NONCONTINUABLE_EXCEPTION” since it’s not a public entity of the kernel32 module.

The exception code macros like “EXCEPTION_NONCONTINUABLE_EXCEPTION” are not part of the Fortran kernel32 interface module nor are they easy to import since they are C macros contained in the “WinBase.h” and “WinNT.h” header files. What might be easier is to define these values in your Fortran program as parameters. You could also modify the kernel32 module (the source is located in your PGI installation’s “src” directory) to add the values.

Hope this helps,