Jul 27, 2010 0
This USE Statement Is Not Positioned Correctly Within The Scoping Unit
Error: This USE statement is not positioned correctly within the scoping unit.
I keep getting this error, and I have no idea why. The program is in a very standard structure:
I did check help / man page of IFORT but no luck..
This thread at intel.com also discuss about the same problem.
the answer at this thread is
“USE YourModule” must preceed local variable declarations. Your include file (at least one of your include files) is declaring at least one variable.
Place your USE to preceed the include statements.
But that did not work completely,
and other half part of answer is
Add an only clause to select only the GETENV routine:
use IFPORT, only: GETENV
This will hide any other names in IFPORT;
This post will talk about why added USE IFPORT
This worked fine..
share your experience as well..
USE also must precede any IMPLICIT statements. Best is to have them come directly after the SUBROUTINE or FUNCTION statement.
you can have USE and IMPORT statements in the same interface body, but the forbidden ‘mixing’ I was referring to was that of placing any IMPORT statement before any USE statement .. source
number of view: 13Possibly Related Posts:
- Fork Implementation In Windows Operating System Vfork Implement in Win32
- CreateProcess And fork() In Windows Differences And Implementation
- Solution – C Requires That a Struct Or Union Has At Least One Member
- Ifort -extend-source Option Errors & Fortran Fixed Formatting Use nofree
- How To Capture X Protocol Traffic Using Wireshark On Windows XP?
Popular Discussion Here