Error: Ambiguous interfaces Fortran
I'm wrote a Fortran program to do analysis;
It seems to install fine on my OpenSuse 10.3; but when I try to compile it on my OpenSuse 11.0, it gives me this error after I type "$make" gfortran -g -I"src/mod" -J"src/mod" -o src/obj/mod_quaternion.o -c src/derivedType/mod_quaternion.f90 src/derivedType/mod_quaternion.f90:455.47: Imultiplication_q2,Rmultiplication_q2 1 Error: Ambiguous interfaces 'rmultiplication_q2' and 'rmultiplication_q' in intrinsic '*' operator at (1) make: *** [mod_quaternion.o] Error 1 I know I'm not giving a lot of details here; but could anyone shed some light as to what the problem might be? Especially the part about the ambiguous interfaces. |
That's the FORTRAN compiler's way of telling you it's confused about how you want to multiply "i * x". It knows "i" is an integer, and it knows "x" is some kind of real ... but it wants you to better specify exactly what kind of "real".
This link might help: http://www.sesp.cse.clrc.ac.uk/Publi...re/node11.html |
Code:
interface operator ( * ) |
Sorry - I didn't realize that *you* were trying to code "explicit interfaces". I thought you were trying to get some legacy F77 (or older) code to compile in a Fortran 90/95 environment.
I don't have any experience with explicit interfaces (new, I believe, in Fortran 90). Here are a couple of links that might help: http://www.physicsforums.com/showthread.php?t=237380 http://books.google.com/books?id=40U...A468#PPA458,M1 PS: Maybe the problem would go away if you *didn't* use the explicit interfaces. Or at least didn't attempt to override any operators - but used functions, instead. Just a thought .. PSM |
Haha; thanks anyways, I figured it out.
Explicit Interfaces are the way of the future for Fortran. |
All times are GMT -5. The time now is 06:47 AM. |