Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
1 View

Fortran2003 : linkconstructor does not have a type with ifort version 13.1.3

Hello,

I am getting the following problem when compiling a Fortran 2003 code with ifort  version 13.1.3

error #6404: This name does not have a type, and must have an explicit type.   [LINKCONSTRUCTOR]
    function linkConstructor(value, previous, next)
-------------^
src/linkedList.f03(81): error #6678: When the target is an expression it must deliver a pointer result.
            this%firstLink => link(value, null(), null())
------------------------------------------^
src/linkedList.f03(81): error #6678: When the target is an expression it must deliver a pointer result.   [LINK]
            this%firstLink => link(value, null(), null())

I am compiling successfully the same code on another machine whith ifort version 14.0.2 and running my simulations without any problem.

Could this be in relation with the used version of the ifort compiler ? or did I make a linking mistake or something similar ?

Thanks !

 

0 Kudos
4 Replies
Highlighted
Black Belt
1 View

You showed too little of the

You showed too little of the code to enable a diagnosis to be made.

If implicit typing is in effect, linkConstructor would be of type INTEGER. Since the compiler complained that it had no type, we can guess that an earlier-seen IMPLICIT NONE is in effect. If that is true, you needed to provide a type declaration for the function name.

Similar comments could be made regarding the types of the other variables and functions.

0 Kudos
Highlighted
1 View

It could well be a bug in

It could well be a bug in that old compiler. 16.0.2 is current.

Retired 12/31/2016
0 Kudos
Highlighted
Beginner
1 View

Thank you for your replies.

 

Thank you for your replies. I commented a certain 'implicit none' in the code and that 's resolved the error 6404 (even if it is working correctly with the version 14.0.2 of the compiler). But I still have this error :

error #6678: When the target is an expression it must deliver a pointer result.   [LINK]
            this%firstLink => link(value, null(), null())

caused by this line :

this%firstLink => link(value, null(), null())

About the same error, I found this :
https://software.intel.com/en-us/articles/error-6678-compiler-defect-with-pointer-assignment-to-a-ty...

but I am not sure that it has any relation with the error I m having.

Since it works correctly with ifort version 14.0.2, I supposed too that it's a compiler version problem. I will try to get the latest version in this server and see if this will solve the problem. Thank you ! 

Ines.

0 Kudos
Highlighted
Black Belt
1 View

Quote:Ines F. wrote:

Ines F. wrote:

I commented a certain 'implicit none' in the code and that's resolved the error 6404 (even if it is working correctly with the version 14.0.2 of the compiler). Since it works correctly with ifort version 14.0.2, I supposed too that it's a compiler version problem. 

If removing IMPLICIT NONE made compiler error messages go away, you should be worried that in your code some variables have not had their types correctly typed. It is not  unusual if a newer version of the compiler catches errors that an older version did not. You should not equate "no error messages" to "no errors". By "working correctly", do you mean "compiled without error messages", or do you actually mean "compiled and ran with no error messages, and delivered results known to be correct"?

0 Kudos