When I compile ansys demo function ResRd Demo.F against its binlib.dll using ifort compiler,
warning #5117: Bad#proprocessor line and fatal error LNK1107 happen. Detailed are in attachment.
Is there something more I can do? Am I getting the flags wrong?
This should have been posed to the Windows forum, but I think you are confusing compilation and linking steps. You want to compile your demo file into an object file before linking it with an external library.
Ok, implicit undefined in impcom.inc is not valid Fortran. Maybe it is some extension for which you need to set a flag. When you try to find it, it could possibly be an Oracle extension or a VMS extension to F77, there could be a flag for the compiler to accept it, but neither gfortran, nor ifort nor nagfor accept it.
IMPLICIT UNDEFINED is not supported by Intel Fortran. I had never heard of it before - definitely not VMS. Interesting that the compiler recognizes it enough to give you the error, though. IMPLICIT NONE (without the letter range) is the correct syntax.
Hello Steve and Juergen,
Thanks for your responses. I absolutely believe that you are Drs. Fortran. Although I use ifort first time and I just join this forum for less than two days, I saw that both of you have resolved many of issues on this forum before. Before I join this forum, I have searched on implicit undefined (a-z). I just found oracle fortran 77 mentioned this (https://docs.oracle.com/cd/E19957-01/805-4939/6j4m0vn9v/index.html). I agree with you that implicit none is the correct syntax. Interesting that ifort compiler does not support implicit undefined(a-z) and ansys uses ifort compiler, how ansys passes its compilation. I also agree that it is some extension for setting a flag. My question is What flag for ifort compiler accept it?
thanks for the flowers, but I am convinced that it is hubris to see myself mentioned in the same league with Steve. I would consider myself only as a gifted amateur.
I got the source to compile. Here's what I did:
In inpcom.h, replaced the invalid IMPLICIT lines with IMPLICIT NONE
Added the options:
/fpp /DPCWINNT_SYS /DSYSTEM_FLOAT_H
I don't know what SYSTEM_FLOAT_H means here, just that defining it means that it doesn't look for a float.h that was not provided.
Hello Steve and Juergen,
Thank both of you so much. I really appreciate your help. According to Steve's instruction, the problem is resolved. In addition, as Juergen pointed out that I confuse the compilation and linking. please allow me to have a naïve question: Can I use /link option directly link to binlib.dll with ifort? I try it and failed. So I convert a dll to a lib and then compile them. Furthermore, I also try gfortran. gfortran compiles it successfully via converting functions to small cases and appending underscore . When running the exe file created by gfortran, it fails to load functions. I saw somewhere that ifort and gfortran are compatible. maybe it is incorrect.
thank you once again.