Package Details: mingw-w64-freeimage 3.18.0-1

Git Clone URL: https://aur.archlinux.org/mingw-w64-freeimage.git (read-only, click to copy)
Package Base: mingw-w64-freeimage
Description: Library project for developers who would like to support popular graphics image formats (mingw-w64)
Upstream URL: http://freeimage.sourceforge.net/
Licenses: GPL, custom:FIPL
Submitter: ekpyron
Maintainer: xantares
Last Packager: xantares
Votes: 4
Popularity: 0.000000
First Submitted: 2012-08-14 05:32 (UTC)
Last Updated: 2022-02-12 19:01 (UTC)

Latest Comments

1 2 Next › Last »

gbroeckaert commented on 2022-02-11 21:51 (UTC) (edited on 2022-02-11 21:53 (UTC) by gbroeckaert)

Hello,

The build with x86_64-w64-mingw32-gcc (GCC) 11.2.0 fails. This is the diff I used in the pkgbuild to fix to compilation error for unknown symbols M_PI and M_SQRT1_2. This caused by the -std=c++14 compile option.

diff --git a/PKGBUILD b/PKGBUILD
index cca8e57..7fa3c0a 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -24,7 +24,7 @@ prepare() {
sed -i "s|IMPORTLIB = \$(TARGET).lib|IMPORTLIB = \$(TARGET).dll.a|g" Makefile.mingw
sed -i 's/#include "..\\x86\\x86.h"/#include "..\/x86\/x86.h"/' Source/LibJXR/image/sys/strcodec.h
rm Source/LibJXR/common/include/guiddef.h
-  sed -i "s,WIN32_CFLAGS =,WIN32_CFLAGS = -fpermissive -D__MINGW64_TOOLCHAIN__," Makefile.mingw
+  sed -i "s,WIN32_CFLAGS =,WIN32_CFLAGS = -fpermissive -D__MINGW64_TOOLCHAIN__ -D_USE_MATH_DEFINES," Makefile.mingw
sed -i "58iWIN32_CXXFLAGS += -std=c++14" Makefile.mingw
sed -i -e "s,#ifdef __GNUC__,#ifdef WHATEVER," -e "s,_MSC_VER,WINVER," Source/OpenEXR/IlmImf/ImfSystemSpecific.h
}

xantares commented on 2019-12-08 12:09 (UTC)

hello,

the import lib is unusable partly because you build the static and shared lib in the same folder and different defines are needed to export the symbols

I could successfully link with the .dll.a with the following diff:

also the patch from community to unbundle libs is interesting because it could speed up the build

diff --git a/PKGBUILD b/PKGBUILD
index acde8f1..92502e6 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -31,9 +31,9 @@ prepare() {
 build() {
   for _arch in ${_architectures}; do
     rm -rf FreeImage-${_arch}
-    cp -r FreeImage FreeImage-${_arch}
-    pushd FreeImage-${_arch}
-    make \
+    cp -r FreeImage FreeImage-${_arch}-static
+    pushd FreeImage-${_arch}-static
+    make libFreeImage.a \
       CC=${_arch}-gcc \
       CXX=${_arch}-g++ \
       LD=${_arch}-g++ \
@@ -41,8 +41,12 @@ build() {
       AR=${_arch}-ar \
       DLLTOOL=${_arch}-dlltool \
       FREEIMAGE_LIBRARY_TYPE="STATIC" \
+      LDFLAGS="-static" \
       -f Makefile.mingw
-    make \
+    popd
+    cp -r FreeImage FreeImage-${_arch}
+    pushd FreeImage-${_arch}
+    make FreeImage.dll \
       CC=${_arch}-gcc \
       CXX=${_arch}-g++ \
       LD=${_arch}-g++ \
@@ -50,6 +54,7 @@ build() {
       AR=${_arch}-ar \
       DLLTOOL=${_arch}-dlltool \
       FREEIMAGE_LIBRARY_TYPE="SHARED" \
+      LDFLAGS="-shared -Wl,--out-implib,libFreeImage.dll.a" \
       -f Makefile.mingw
     popd
   done  
@@ -58,12 +63,13 @@ build() {

 package() {
   for _arch in ${_architectures}; do
-    cd ${srcdir}/FreeImage-${_arch}
     install -d "${pkgdir}"/usr/${_arch}/{lib,bin,include}
-    install -m755 Dist/FreeImage.dll "${pkgdir}"/usr/${_arch}/bin/
-    install -m644 Dist/FreeImage.dll.a "${pkgdir}"/usr/${_arch}/lib/libFreeImage.dll.a
-    install -m644 Dist/libFreeImage.a "${pkgdir}"/usr/${_arch}/lib/
-    install -m644 Dist/FreeImage.h   "${pkgdir}"/usr/${_arch}/include/
+    cd ${srcdir}/FreeImage-${_arch}-static
+    install -m644 libFreeImage.a "${pkgdir}"/usr/${_arch}/lib/
+    cd ${srcdir}/FreeImage-${_arch}
+    install -m755 FreeImage.dll "${pkgdir}"/usr/${_arch}/bin/
+    install -m644 FreeImage.dll.a "${pkgdir}"/usr/${_arch}/lib/libFreeImage.dll.a
+    install -m644 Source/FreeImage.h   "${pkgdir}"/usr/${_arch}/include/
     ${_arch}-strip --strip-unneeded "$pkgdir"/usr/${_arch}/bin/*.dll
     ${_arch}-strip -g "$pkgdir"/usr/${_arch}/lib/*.a
   done

xantares commented on 2017-02-25 09:46 (UTC)

hello, I need a patch. ps: I think the values shouldn't exceed the char range in the first place, what you're doing is just accepting them and truncate from the int to char range.

thebunnyrules commented on 2017-02-25 01:30 (UTC)

Fix can be found here: https://sourceforge.net/p/freeimage/bugs/267/

thebunnyrules commented on 2017-02-24 08:05 (UTC)

I'm getting this error during build. Anyone has any ideas how to fix this? ==================================== ------------------------------------ Source/LibRawLite/./internal/dcraw_common.cpp: In member function ‘void LibRaw::vng_interpolate()’: Source/LibRawLite/./internal/dcraw_common.cpp:3964:3: error: narrowing conversion of ‘128’ from ‘int’ to ‘signed char’ inside { } [-Wnarrowing] }, chood[] = { -1,-1, -1,0, -1,+1, 0,+1, +1,+1, +1,0, +1,-1, 0,-1 }; ^ Source/LibRawLite/./internal/dcraw_common.cpp:3964:3: error: narrowing conversion of ‘136’ from ‘int’ to ‘signed char’ inside { } [-Wnarrowing] Source/LibRawLite/./internal/dcraw_common.cpp:3964:3: error: narrowing conversion of ‘128’ from ‘int’ to ‘signed char’ inside { } [-Wnarrowing] Source/LibRawLite/./internal/dcraw_common.cpp:3964:3: error: narrowing conversion of ‘136’ from ‘int’ to ‘signed char’ inside { } [-Wnarrowing] Source/LibRawLite/./internal/dcraw_common.cpp:3964:3: error: narrowing conversion of ‘128’ from ‘int’ to ‘signed char’ inside { } [-Wnarrowing] Source/LibRawLite/./internal/dcraw_common.cpp:3964:3: error: narrowing conversion of ‘136’ from ‘int’ to ‘signed char’ inside { } [-Wnarrowing] Source/LibRawLite/./internal/dcraw_common.cpp: In member function ‘void LibRaw::adobe_coeff(const char*, const char*)’: Source/LibRawLite/./internal/dcraw_common.cpp:7269:3: error: narrowing conversion of ‘65535’ from ‘int’ to ‘short int’ inside { } [-Wnarrowing] }; ^ Source/LibRawLite/./internal/dcraw_common.cpp:7269:3: error: narrowing conversion of ‘65535’ from ‘int’ to ‘short int’ inside { } [-Wnarrowing] make: *** [Makefile.mingw:107: Source/LibRawLite/./internal/dcraw_common.o] Error 1 ==> ERROR: A failure occurred in build(). Aborting...

Schala commented on 2015-03-30 03:49 (UTC)

Thanks, but I'm getting an odd error and the only thing makepkg says is it happens in package()

ekpyron commented on 2013-12-13 21:55 (UTC)

@Schala Sorry for the late response, but you're right, the PKGBUILD now renames FreeImage.dll.a to libFreeImage.dll.a.

Schala commented on 2013-11-28 01:58 (UTC)

Should be libFreeImage.dll.a, not FreeImage.dll.a

xantares commented on 2013-11-15 10:26 (UTC)

mingw-w64-crt should be listed as depends instead of mingw-w64-gcc which should be added to makedepends