I use the 18.10 community edition of pgfortran to make the test example on p 123 of the users guide. This creates a DLL and a calling program. I can make the DLL in two steps as described in the example:
pgfortran -Bdynamic -c object1.f90
pgfortran -Mmakedll object1.obj -o obj1.dll
I only had to change the “f” extension “f90”, since the source is free format. However, when I try to build the main program:
pgfortran -Bdynamic -o prog1 prog1.f90 -defaultlib:obj1
I get nothing! pgfortran is busy for a few seconds, no warning, no error message, no obj-file, no exe-file. But I remember that it did work with the 18.4 version of the community edition. Interestingly, when I remove the line
"!DEC$ ATTRIBUTES DLLIMPORT :: sub1, /acommon/ "
from prog1.f90, it works!! Apparently the linker finds the required modules in the obj1.lib without the DLLIMPORT directive. But that this directive should cause the compiler to abort is strange. I can not even compile, i.e.
pgfortran -Bdynamic -c prog1.f90
also produces no output, no warnings, and no error messages. Is this a new feature, or am I doing something wrong?