libvips / build-win64-mxe

76 stars 15 forks source link

linking to vips failed on Windows with msys64 #60

Closed aisnote closed 1 week ago

aisnote commented 6 months ago

failed with vips version: 8.14.

I used govips like: // #cgo pkg-config: vips

There is no this issue on 8.10.

C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lgio-2.0: No such file or directory C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lintl: No such file or directory C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lgmodule-2.0: No such file or directory C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lintl: No such file or directory C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lintl: No such file or directory

vips.pc.

prefix=/data/mxe/usr/x86_64-w64-mingw32.static.posix.web includedir=${prefix}/include libdir=${prefix}/lib

Name: vips Description: Image processing library Version: 8.14.5 Requires: glib-2.0 >= 2.40, gio-2.0, gobject-2.0 Requires.private: expat, zlib >= 0.4, libarchive >= 3.0.0, imagequant, cgif >= 0.2.0, libexif >= 0.6, libjpeg, spng >= 0.7, libwebp >= 0.6, libwebpmux >= 0.6, libwebpdemux >= 0.6, pangocairo >= 1.32.6, pangoft2 >= 1.32.6, fontconfig, libtiff-4, librsvg-2.0 >= 2.40.3, cairo >= 1.2, lcms2, orc-0.4 >= 0.4.11, libheif >= 1.4.0 Libs: -L${libdir} -lvips Libs.private: -lm -lintl Cflags: -I${includedir}

lovell commented 6 months ago

This looks like multiple, conflicting versions of vips on the same machine. Please ensure all previous versions are removed, plus you'll probably need to rebuild govips from source (but please note we cannot help with govips).

kleisauke commented 6 months ago

See: https://github.com/libvips/build-win64-mxe/issues/63#issuecomment-2043325440.

kleisauke commented 6 months ago

Alternatively, I think these relocatable pkg-config files would work for the -static variant:

vips.pc:

prefix=${pcfiledir}/../..
libdir=${prefix}/lib
includedir=${prefix}/include

Name: vips
Description: Image processing library
Version: 8.15.2
Libs: -L${libdir} -lvips
Cflags: -I${includedir} -I${includedir}/glib-2.0 -I${libdir}/glib-2.0/include -mms-bitfields

vips-cpp.pc:

prefix=${pcfiledir}/../..
libdir=${prefix}/lib
includedir=${prefix}/include

Name: vips-cpp
Description: C++ API for vips8 image processing library
Version: 8.15.2
Requires: vips
Libs: -L${libdir} -lvips-cpp
Cflags: -I${includedir}
kleisauke commented 1 week ago

I hope this information helped. Please feel free to re-open if questions remain.