fpm cannot automatically locate external module files; it is the responsibility of the user to specify the necessary include directories using compiler flags such that the compiler can locate external module files during compilation.
Your fpm.toml should probably look a bit closer to this
[build]
...
link = ["user32", "gdi32", "opengl32"]
# If you are USEing and external modules in your code place them below
external-modules = ["netcdf", "h5lt"]
...
Including the correct paths should probably be done via the --flag option, the fpm environmental variables or a response file.
and fpm run is showing pretty much the same output
$ fpm run --Ic:\dislin\gf\real64 c:\dislin\dismg_d.a
UNKNOWN LONG KEYWORD: --Ic:dislingfreal64
KEYWORD SHORT PRESENT VALUE
version v F [F]
verbose V F [F]
usage u F [F]
target F [" "]
runner F [" "]
profile F [" "]
no-prune F [F]
list F [F]
link-flag F [" "]
help h F [F]
flag F [" "]
example F [F]
directory C F [" "]
cxx-flag F [" "]
cxx-compiler F [" "]
compiler F ["gfortran"]
c-flag F [" "]
c-compiler F [" "]
archiver F [" "]
all F [F]
UNNAMED
000001[run ]
My code is
program main_fpm
use Dislin ! Dislin module
implicit none
integer (4), parameter :: x=4, y=4
real(8), dimension(x,y) :: r
call random_number (r)
call qplclr (r,x,y) ! dislin quickplot routine
end program main_fpm
$ fpm run --flag "-Ic:\dislin\gf\real64"
first_steps.exe failed.
[100%] Compiling...
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe
: build\gfortran_B5883862FD3CD98A\first_steps\app_main.f90.o:main.f90:(.text+0x98): undefined refere
nce to `qplclr_'
collect2.exe: error: ld returned 1 exit status
<ERROR> Compilation failed for object " first_steps.exe "
<ERROR>stopping due to failed compilation
STOP 1