×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Gfortran + Windows7

Gfortran + Windows7

Gfortran + Windows7

(OP)
I'm trying to get this to work with Gfortran and Windows7.

Anyone have experience with accessing the OS under Seven?

Thanks.

MODULE IFWIN
USE, INTRINSIC :: ISO_C_BINDING
IMPLICIT NONE
PRIVATE
PUBLIC QueryPerformanceCounter
INTERFACE
FUNCTION QueryPerformanceCounter(lpPerformanceCount)
BIND(C, NAME='QueryPerformanceCounter')
IMPORT
IMPLICIT NONE
INTEGER(C_INT) QueryPerformanceCounter
INTEGER(C_INT64_T) lpPerformanceCount
END FUNCTION QueryPerformanceCounter
END INTERFACE
PUBLIC QueryPerformanceFrequency
INTERFACE
FUNCTION QueryPerformanceFrequency(lpFrequency)
BIND(C, NAME='QueryPerformanceFrequency')
IMPORT
IMPLICIT NONE
INTEGER(C_INT) QueryPerformanceFrequency
INTEGER(C_INT64_T) lpFrequency
END FUNCTION QueryPerformanceFrequency
END INTERFACE
END MODULE IFWIN

PROGRAM MAIN
USE IFWIN
USE, INTRINSIC :: ISO_C_BINDING
IMPLICIT NONE
INTEGER(C_INT64_T) lpFrequency, lpPerformanceCount
INTEGER(C_INT) I
I = QueryPerformanceFrequency(lpFrequency)
I = QueryperformanceCounter(lpPerformanceCount)
WRITE (*, *) lpFrequency, lpPerformanceCount
END PROGRAM MAIN

RE: Gfortran + Windows7

QueryPerformanceFrequency and Counter are kernel32 routines. I've only ever used them in IVF. You will probably need to link them with kernel32.lib.

RE: Gfortran + Windows7

(OP)

With a .lib (static library) you link it directly.
With a .dll (dynamic link library), it just has to be in the path.

On my system, kernel32.ddl is buried in the path.

Anyway, my errors are related to the variable types, supposedly coming from ISO_C_BINDING.

C_INT isn't understood by the compiler.

Any ideas?

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources