[SOLVED] Error compiling lablgtk3 on opam-2.2.0~beta1 (Windows/mingw)

I am trying to proceed with opam-2.2.0~beta1 the same way than Diskuv and compile lablgtk3.

Here I have the following error:

# (cd _build/default && C:\Users\frede\AppData\Local\opam\default\bin\ocamlmklib.opt.exe -g -o src/cairo_stubs src/cairo_stubs.o -ldopt -LC:/gtk/bin/../lib -ldopt -lfreetype -ldopt -LC:/gtk/bin/../lib -ldopt -lzlib1 -ldopt -llibpng16 -ldopt -lharfbuzz -ldopt -LC:/gtk/bin/../lib -ldopt -lglib-2.0 -ldopt -lintl -ldopt -LC:/gtk/bin/../lib -ldopt -lfontconfig -ldopt -lfreetype -ldopt -LC:/gtk/bin/.[...]
# ** Fatal error: Cannot find file "-lfreetype"

My understanding is that -lfreetype should search a freetype.lib, and -LC:/gtk/bin/../lib should have made the file found (freetype.lib is actualy in this directory).

EDIT: I have found the culprit… the mingw toolchain search libname.lib files and not simply name.lib files. Now with a lot of symlinks, it works. :slight_smile:

I guess that the source of the issue is pkg-config which comes from a MSVC compliant directory which doesn’t match mingw conventions.

1 Like