m***@technip.com
2015-05-28 12:50:45 UTC
A legacy fortran program is being upgraded from compiling with Lahey v5.6 to Lahey v7.6 to be able to compile and link Lahey with a Windows 7 64 bit OS. The current version runs on Windows XP.
Winapi calls are made using the DLL_IMPORT statement. A sample Function block is shown below:
INTEGER FUNCTION ACTIVWIN()
! Return the handle of the active window attached to the caller's msg queue.
! Uses Win API function GetActiveWindow.
! Compile with switch: -ml bc or with switch: -ml winapi
DLL_IMPORT GetActiveWindow
INTEGER :: GetActiveWindow
ACTIVWIN= GetActiveWindow()
RETURN
END
All the separate files in the program compile with no errors reported.
Compile command used: lf95 @F90RTNS.LST -c -winconsole -winapi -ml bc -mod "C:\Program Files (x86)\Lahey-Fujitsu Fortran\v7.6\WiSK\lib.l9m"
When trying to link the object files the error below occurs for all Winapi functions called.
Lahey/Fujitsu Fortran 95 Compiler Release 7.60.01 S/N: xxxxxxxxx
Copyright (C) 1994-2014 Lahey Computer Systems. All rights reserved.
Copyright (C) 1998-2014 FUJITSU LIMITED. All rights reserved.
ACTIVWIN.obj : error LNK2001: unresolved external symbol GetActiveWindow
The linking switches are:
-winconsole -nologo -nc -nco -wisk -ml winapi -map xxxxxx -out xxxxxx -libpath "C:\Program Files (x86)\Lahey-Fujitsu Fortran\v7.6\LF95\Lib"
Is there something that must be changed with the new compiler to enable the Winapi commands to work either in the Fortran code or the compiler switches?
Winapi calls are made using the DLL_IMPORT statement. A sample Function block is shown below:
INTEGER FUNCTION ACTIVWIN()
! Return the handle of the active window attached to the caller's msg queue.
! Uses Win API function GetActiveWindow.
! Compile with switch: -ml bc or with switch: -ml winapi
DLL_IMPORT GetActiveWindow
INTEGER :: GetActiveWindow
ACTIVWIN= GetActiveWindow()
RETURN
END
All the separate files in the program compile with no errors reported.
Compile command used: lf95 @F90RTNS.LST -c -winconsole -winapi -ml bc -mod "C:\Program Files (x86)\Lahey-Fujitsu Fortran\v7.6\WiSK\lib.l9m"
When trying to link the object files the error below occurs for all Winapi functions called.
Lahey/Fujitsu Fortran 95 Compiler Release 7.60.01 S/N: xxxxxxxxx
Copyright (C) 1994-2014 Lahey Computer Systems. All rights reserved.
Copyright (C) 1998-2014 FUJITSU LIMITED. All rights reserved.
ACTIVWIN.obj : error LNK2001: unresolved external symbol GetActiveWindow
The linking switches are:
-winconsole -nologo -nc -nco -wisk -ml winapi -map xxxxxx -out xxxxxx -libpath "C:\Program Files (x86)\Lahey-Fujitsu Fortran\v7.6\LF95\Lib"
Is there something that must be changed with the new compiler to enable the Winapi commands to work either in the Fortran code or the compiler switches?