Re: Issue from IVF 9.0 to IVF 10.1



Marco Ppower wrote:
I have just updated my Fortran compiler from IVF 9.0 to 10.1 and I have my suite of DLLs, that I can't link successfully because of some LNK2019 unresolved external symbols in my source code. These Fortran files are correctly compiled, but it is the linker to complain for, while the IVF v9.0 linker linked the same sources without any issue.

I admit that the calling and called functions are badly formatted, because of the implicit variables definition and the not-so-precise type matching, but that's the source code I got from my colleagues and I have to run soon.

This is the function being called:

SUBROUTINE ASSEMBLABLK(NA,NCOL,A,NRIFA,NEQ,NBLOCK,LBLOK,NUMEL,KERR,NEQUAZ,KGEON,KEXIT)

IMPLICIT REAL*8(A-H,O-Z)
DIMENSION NA(NEQ),A(LBLOK),NCOL(NBLOCK)
DIMENSION NRIFA(2*LBLOK)
...

The part of the subroutine calling this is here:

IMPLICIT REAL*8 (A-H,O-Z)

ALLOCATABLE A(:)
....

ALLOCATE (A(MTOT))
CALL ASSEMBLABLK(A(N1),A(N2),A(N3),A(N3),NEQ,NBLOCK,LBLOK,MAXC,NUMEL,KERR,NEQUAZ,KGEON,KEXIT)

The errors are here:

Error 1 error LNK2019: unresolved external symbol _ASSEMBLABLK@52 referenced in function _PUSHOVER Pushover.obj
Error 2 fatal error LNK1120: 1 unresolved externals


What's wrong? Is there a way to activate full parameter passing type checking between functions with the Intel Visual Fortran compiler?

I posted here, because I'm not able to post on the Intel Visual Fortran forum, but as soon as I can do it, you may find this issue posted even there.


As has been pointed out already, you pass 13 arguments to a subroutine which has been declared with 12. Real*8 arrays are passed where Integer*4 variables (possibly, this is scratch pad memory) are expected. While a compiler following the Cdecl convention may produce an executable without any complaints, it does not follow that the program will work correctly and do what is expected.

The variable KEXIT is undefined, since the subroutine does not know that it is the 13th argument. The same section of array A is used for the 3rd and 4th arguments. Is that proper?

It is possible, but unlikely, that despite all these dubious practices the program gave you the correct results. What you have seen are examples of bugs that can go undetected for years. When, for some reason, the compiler or compiler options change or the runtime library changes you may be surprised by failure to work correctly and start suspecting that the compiler or the runtime have bugs.

-- mecej4
.



Relevant Pages

  • Re: GPL vs non-GPL device drivers
    ... shipped the source code of the modified POP server. ... given you the compiler he compiled it with, ... Actually, if memory serves, when you license a work under the GPL, part of the ... a derivative work" the claim is invalid - because, as it has been shown, a ...
    (Linux-Kernel)
  • Re: more compiler switches
    ... Also print the version number of the compiler ... driver program and of the preprocessor and the compiler proper. ... C source code which should not be preprocessed. ... Like -v except the commands are not executed and all command arguments are ...
    (comp.lang.fortran)
  • Re: Dad upgrade.
    ... If the source code is available in full, the job of compiling it is very ... end of it, you do just hit the `go' button on the compiler, and out pops ... neither is any good without some hardware to store it and execute it - ... program will be happily translated into machine code for whatever CPU ...
    (uk.comp.sys.mac)
  • portable makefiles with f90 modules
    ... What is the current status of designing portable makefiles (on ... unix-like OSs and beyond) in large programming projects with f90 ... I'm assuming in a large project that source code is spread across ... files (or whatever they happen to be called by that compiler). ...
    (comp.lang.fortran)
  • Re: Richard Stallman is responsible for the shrinking economy
    ... there are still _some_ reasons and I've experienced them. ... Having access to the source code is an insurance policy. ... the then-fastest/best c compiler was used (Lattice c) ... compiler was used. ...
    (comp.arch.embedded)