Sorry, we have the same issue here, though less obvious: build itself is fine, however once I tried to build a provided example, it failed with a familiar picture:
10:fortran-xlib-0552aad2dca2ab3267b30a6f5126eb42d7eb2271 svacchanda$ sudo /opt/local/bin/gfortran-mp-12 -I/opt/local/include/ -L/opt/local/lib/ -o window examples/window/window.f90 libfortran-xlib.a -lX11
examples/window/window.f90:32:13:
32 | window = x_create_simple_window(display, root, 0, 0, WIDTH, HEIGHT, 0, black, white)
| 1
Error: Type mismatch in argument 'parent' at (1); passed INTEGER(8) to INTEGER(4)
examples/window/window.f90:32:13:
32 | window = x_create_simple_window(display, root, 0, 0, WIDTH, HEIGHT, 0, black, white)
| 1
Error: Type mismatch in argument 'border' at (1); passed INTEGER(8) to INTEGER(4)
examples/window/window.f90:32:13:
32 | window = x_create_simple_window(display, root, 0, 0, WIDTH, HEIGHT, 0, black, white)
| 1
Error: Type mismatch in argument 'background' at (1); passed INTEGER(8) to INTEGER(4)
examples/window/window.f90:41:59:
41 | call x_set_wm_normal_hints(display, window, size_hints)
| 1
Error: Type mismatch in argument 'w' at (1); passed INTEGER(8) to INTEGER(4)
examples/window/window.f90:44:64:
44 | call x_store_name(display, window, 'Fortran' // c_null_char)
| 1
Error: Type mismatch in argument 'w' at (1); passed INTEGER(8) to INTEGER(4)
examples/window/window.f90:47:9:
47 | gc = x_create_gc(display, window, 0, values)
| 1
Error: Type mismatch in argument 'd' at (1); passed INTEGER(8) to INTEGER(4)
examples/window/window.f90:49:45:
49 | call x_set_background(display, gc, white)
| 1
Error: Type mismatch in argument 'background' at (1); passed INTEGER(8) to INTEGER(4)
examples/window/window.f90:50:45:
50 | call x_set_foreground(display, gc, black)
| 1
Error: Type mismatch in argument 'foreground' at (1); passed INTEGER(8) to INTEGER(4)
examples/window/window.f90:53:38:
53 | call x_map_window(display, window)
| 1
Error: Type mismatch in argument 'w' at (1); passed INTEGER(8) to INTEGER(4)
examples/window/window.f90:54:40:
54 | call x_clear_window(display, window)
| 1
Error: Type mismatch in argument 'w' at (1); passed INTEGER(8) to INTEGER(4)
examples/window/window.f90:61:42:
61 | call x_destroy_window(display, window)
| 1
Error: Type mismatch in argument 'w' at (1); passed INTEGER(8) to INTEGER(4)