Build on ubuntu 22.04 with mingw fails with INT32 conflict definition
Hi.
I am trying to cross-compile for windows (w64) with libjpeg-v9f.
Build error:
[ 37%] Building CXX object CMakeFiles/poppler.dir/poppler/ImageEmbeddingUtils.cc.obj
In file included from /usr/share/mingw-w64/include/winnt.h:150,
from /usr/share/mingw-w64/include/minwindef.h:163,
from /usr/share/mingw-w64/include/windef.h:9,
from /tmp/build-windows/libs/poppler/src/poppler_external-build/poppler/poppler-config.h:133,
from /tmp/build-windows/libs/poppler/src/poppler_external/poppler/Error.h:32,
from /tmp/build-windows/libs/poppler/src/poppler_external/poppler/Object.h:45,
from /tmp/build-windows/libs/poppler/src/poppler_external/poppler/ImageEmbeddingUtils.cc:27:
/usr/share/mingw-w64/include/basetsd.h:31:22: error: conflicting declaration ‘typedef int INT32’
31 | typedef signed int INT32,*PINT32;
| ^~~~~
In file included from /usr/x86_64-w64-mingw32/include/jpeglib.h:27,
from /tmp/build-windows/libs/poppler/src/poppler_external/poppler/ImageEmbeddingUtils.cc:17:
/usr/x86_64-w64-mingw32/include/jmorecfg.h:165:14: note: previous declaration as ‘typedef long int INT32’
165 | typedef long INT32;
| ^~~~~
cmake config used:
-DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}
-DCMAKE_BUILD_TYPE=release
-DCMAKE_INSTALL_PREFIX=${CMAKE_CURRENT_BINARY_DIR}/${TARGET_NAME}
-DENABLE_BOOST=OFF
-DBUILD_SHARED_LIBS=OFF
-DBUILD_CPP_TESTS=OFF
-DBUILD_GTK_TESTS=OFF
-DBUILD_MANUAL_TESTS=OFF
-DBUILD_QT5_TESTS=OFF
-DBUILD_QT6_TESTS=OFF
-DENABLE_CPP=OFF
-DENABLE_QT5=OFF
-DENABLE_QT6=ON
-DENABLE_ZLIB=OFF
-DENABLE_GLIB=OFF
-DENABLE_GOBJECT_INTROSPECTION=OFF
-DENABLE_LIBCURL=OFF
-DENABLE_LIBOPENJPEG=none
-DENABLE_UTILS=OFF
-DENABLE_DCTDECODER=libjpeg
-DWITH_PNG=ON
-DWITH_TIFF=OFF
-DWITH_NSS3=OFF
Tried with poppler versions 21.12.00
and 24.02.00
.
By adding #include <poppler-config.h>
to top of file ImageEmbeddingUtils.cc
solved the build issue.
Thank you.