Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Gfortran + Windows7

Status
Not open for further replies.

rih5342

Marine/Ocean
Joined
May 8, 2007
Messages
40
Location
US
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
 
QueryPerformanceFrequency and Counter are kernel32 routines. I've only ever used them in IVF. You will probably need to link them with kernel32.lib.
 

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?
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Sponsor

Back
Top