Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29253 Discussions

Can't find FLUSH() in IFPORT using IVF 8.0, VC++ 2003

marshall_buhl
Beginner
1,264 Views
Hi,
I seem to be having a problem using the FLUSH() routine in IFPORT. I get an unresolved external in the following program:

PROGRAM
Test

USE

IFPORT

CALL

FLUSH ( 6 )

STOP

END


Here's the error message:

test error LNK2019: unresolved external symbol _FLUSH@4 referenced in function _MAIN__

I (think I've) read all the appropriate documentation and can find no mention that I need to change linker settings except in the porting guide, which seems to refer to IF v7, although I tried those suggestions too. I changed from using DFPORT to IFPORT. I also tried IFLPORT, but none of the three seem to work.

Is a new porting guide going to be ready soon?

Marshall

0 Kudos
4 Replies
Peter_Priestley
Beginner
1,264 Views

This is exactly the same problem I was having with the COM Server example (see separate thread). This is a nice easy example so I will elaborate...

The interface for FLUSH (see IFPORT.f90) is as follows

SUBROUTINE FLUSH(LUNIT)

!DEC$ATTRIBUTES DEFAULT :: FLUSH

INTEGER(4) :: LUNIT

END SUBROUTINE

The compiler is using the Project settings for calling convention (probably CVF or STDCALL) and the explicit 'DEC$ATTRIBUTES DEFAULT...' is ignored. _FLUSH@4 is a STDCALL hash of the routine name. The Intel 'DEFAULT' is apparently 'C,REFERENCE'.

It appears to me that there is a problem in that 'DEC$ATTRIBUTES...' does not override the project settings. This will surely have wide implications for projects ported from CVF?

0 Kudos
Steven_L_Intel1
Employee
1,264 Views

The ATTRIBUTES did override the command line - but the meaning of DEFAULT changed.

As for FLUSH, I can't reproduce a problem with using it. USE DFPORT or IFPORT should work fine. If you have a sample project that shows a problem, please send it to Premier Support.

0 Kudos
Peter_Priestley
Beginner
1,264 Views
If you create a new Fortran Console project in VS2003 & IVF8.0, then the test program in the first posting above works fine.
But try twiddling Project Properties/Fortran /External Procedures /Calling Convention to some setting other than 'default' (e.g. try CVF or STDCALL), then the problem happens. The project setting takes priority over the INTERFACE declaration in the IFPORT module....which it shouldn't in my view.
I will make up an example for Premier Support.
0 Kudos
marshall_buhl
Beginner
1,264 Views

Hi,

I checked out the Calling Convention as Peter suggested and for the project that had the link problems, it was set to "CVF." It was set to "default" for the project that linked fine. I changed the problem project to "default" and it now links fine.

Thanks Peter!
Marshall
0 Kudos
Reply