I'm new to Fortran 2003 (and above) OOP in fortran (although pretty exprienced with Java, C++, etc OOP) and have started out with a basic linked list program to understand how the new standards allow for OOP inheritance, polymorphism, etc. Unfortunately, I can't get it to compile because of a "error #6463: This is not a derived type name" error. I found a related article (http://software.intel.com/en-us/forums/showthread.php?t=78685) that says the problem should have been fixed with Update 7 (2011.1.1.256 - Linux). I'm using 2011_sp1.9.293 and am still getting the error. I assume it is related to the overloaded constructor in the link module having the same name as the datatype. Changing the overloaded constructor to something like 'new' allows me to compile link.f90 and list.f90, but then it fails in main.f90. Anyway, I've attached the original link.f90, list.f90 and main.f90 to see if I'm missing something. The compile options I use are:
ifort -c link.f90
ifort -c list.f90
ifort -c main.f90
And then link the .o files. Unfortunately, I haven't been able to get past linking list.f90.
I've also attached a modified link_new.f90, list_new.f90, which re-name the constructor and compile, but when I attempt to compile the main.f90, I get a "main.f90(7): error #6404: This name does not have a type, and must have an explicit type. [#UNLPOLY]", which I assume is because the definition of the my_list variable doesn't know how to create the type because link is no longer overloaded to new.
Any help would be appreciated.