Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29253 Обсуждение

!DEC$ ATTRIBUTES DEFAULT not supported in CVF 6.6c?

fightinghippos10
Начинающий
561Просмотр.
Tried building the following snip:
INTEGER(4) FUNCTION UTL_TIME_ADD_SEC_F ( FIRST, SECOND, RESULT )
!DEC$ ATTRIBUTES DEFAULT, DLLEXPORT :: UTL_TIME_ADD_SEC_F
IMPLICIT NONE
INCLUDE 'utl_structs.inc'
INCLUDE 'utl_time.inc'
*
* Calling Arguments
*
RECORD /timeStamp/ FIRST
RECORD /timeStamp/ SECOND
RECORD /timeStamp/ RESULT
*
* Declare the interface to the 'C' routine
*
INTERFACE
INTEGER(4) FUNCTION utl_time_add_sec(
+ first,
+ second,
+ result)
INCLUDE 'utl_structs.inc'
RECORD /timeStamp/ first
RECORD /timeStamp/ second
RECORD /timeStamp/ result
!DEC$ ATTRIBUTES STDCALL,DLLIMPORT :: utl_time_add_sec
!DEC$ ATTRIBUTES REFERENCE :: first
!DEC$ ATTRIBUTES REFERENCE :: second
!DEC$ ATTRIBUTES REFERENCE :: result
END FUNCTION
END INTERFACE
*
*********************************
* Start of executable code
*********************************
*
*
* Call 'C' routine
*
UTL_TIME_ADD_SEC_F = utl_time_add_sec(FIRST, SECOND, RESULT)
RETURN
END

I get the following error:
Z:onlineutlutl_libsrcutl_time_f.for(64) : Error: This symbol has multiply declared DEC$ ATTRIBUTES DEFAULT attribute. [UTL_TIME_ADD_SEC_F]
!DEC$ ATTRIBUTES DEFAULT,DLLEXPORT::UTL_TIME_ADD_SEC_F
I removed the DEFAULT attribute and it built fine.
I removed the DLLEXPORT attribute and got the same error.
Is DEC$ ATTRIBUTES DEFAULT not supported in CVF 6.6c?
This compiled fine in CVF 6.6b, although I got a link error. An earlier post indicated a workaround to the link error using a .DEF file, but I'm trying to avoid adding this to all of my projects. I was hoping the link error was fixed in 6.6c.
Is DEC$ ATTRIBUTES DEFAULT not supported in CVF 6.6c?
0 баллов
2 Ответы
Steven_L_Intel1
Сотрудник
561Просмотр.
The DEFAULT attribute is supported. I can't compile your example as-is (don't have the include files), but if I reduce it some, it compiles ok for me.
fightinghippos10
Начинающий
561Просмотр.
My problem was that I had the DEFAULT argument used for the same symbol in the .inc and the .for file. Previous versions of CVF did not flag this error.
Ответить