Help getting plplot to work

Hi everyone,

I’m having trouble getting a simple plplot example program to compile. I’m on Ubuntu 20.10 and using gfortran with pkg-config --libs --cflags plplot-fortran to set up the flags.

The error I’m getting is

    6 |     call plparseopts(PL_PARSE_FULL)
      |                                   1
Error: There is no specific subroutine for the generic ‘plparseopts’ at (1)

which, I think means that my call doesn’t match any specific subroutines in the plparseopts interface, but I’m not sure why that would be / what I’m doing wrong.

A minimum example to reproduce this is:

program plotgraph

    use plplot
    implicit none

    call plparseopts(PL_PARSE_FULL)

end program plotgraph

Any tips from those more familiar with the library? Thanks

I often get this error message in my own code. If foo is an interface to subroutines foo1, foo2, foo3, and I think call foo() is valid because the arguments match foo2, then I rewrite the code to call foo2() explicitly. Then the compiler tells me exactly what is wrong – which argument does not match. I see the subroutines for the plparseopts interface here.

Gfortran has a neat feature where if you use IMPLICIT NONE and try to use an undeclared variable, often because of a typo, it guesses what variable you intended in the error message. If a compiler could say “no match for call foo, closest match is foo2”, that would be helpful.

1 Like

it is a function call not a subroutine call i think

1 Like

Yes the issue was indeed that it was a function not a subroutine - rookie mistake, sorry and thanks.