Exiv2 / exiv2

Image metadata library and tools
http://www.exiv2.org/
Other
924 stars 278 forks source link

MinGW 32 bits : linking failure with mkgmtime() #473

Closed cgilles closed 5 years ago

cgilles commented 6 years ago

This problem do no appear with Exiv2 0.26 in 32 or 64 bits target for MinGW. But i remember that i already report this problem with older version of Exiv2 directly to Andreas to support MinGW.

With Exiv2 0.27, the MinGW 32 bits target do not link at end :

[ 19%] Built target xmp [ 44%] Built target exiv2lib_int [ 45%] Linking CXX shared library ../bin/libexiv2.dll CMakeFiles/exiv2lib.dir/objects.a(crwimage_int.cpp.obj): In function mkgmtime': /mnt/data/GIT/6.x/project/bundles/mxe/build.win32/usr/i686-w64-mingw32.shared/include/time.h:229: undefined reference to_mkgmtime32' collect2: error: ld returned 1 exit status

This link error do not depend of one configuration option passed to cmake. The linking rules at end used by cmake are mostly the same between 0.26 and 0.27 (dixit "export VERBOSE=1").

In fact there is a rule with timegm() function present in 0.26 and removed to 0.27 which break the MinGW compatibility. With 0.27 :

If i add back localtime.c, restore timegm.h and patch src/CMakeLists.txt to compile localtime.c, this fix the linking problem. See the patch attached, but it's not perfect, as Exiv2 0.26 has some rules to compile localtime.c :

modify source lists to suit environment

IF(NOT HAVE_TIMEGM ) SET( LIBEXIV2_SRC ${LIBEXIV2_SRC} localtime.c ) SET( EXIV2_SRC ${EXIV2_SRC} localtime.c ) SET( PATHTEST_SRC ${PATHTEST_SRC} localtime.c ) ENDIF( NOT HAVE_TIMEGM )

The patch add localtime.c as well to compile libexiv2, so some tunes need to be done to complete the job.

Exiv2-0.27-mingw-timegm.patch.txt

cgilles commented 6 years ago

About MinGW 64 bits, this patch is also compatible. So not problem to use in both 32 and 64 bits.

piponazo commented 6 years ago

The changes related to the timegm function were done in #431 and #413. I probably did not check these changes with MinGW.

I'll take a look to this and probably I'll try to spend some time adding a MinGW to Appveyor to not reach these situations again in the future.

clanmills commented 6 years ago

There is something wrong with MinGW and MSVC time handling and it's detected by the test suite! It's OK on Cygwin, MacOS-X and Linux.

It's detected in data/conversions.sh with the command:

    TZ=GMT-8 runTest exiv2 -iX v.jpg

The report is:

537 rmills@rmillsmm-w7:~/gnu/github/exiv2/exiv2/test $ EXIV2_BINDIR="${PWD}/../build/bin" ./conversions.sh
Files /home/rmills/gnu/github/exiv2/exiv2/test/tmp/conversions.out and /home/rmills/gnu/github/exiv2/exiv2/test/data/conversions.out differ
165c165
< Exif.Image.DateTime                          Ascii      20  2015:04:17 19:10:22
---
> Exif.Image.DateTime                          Ascii      20  2015:04:18 02:10:22
538 rmills@rmillsmm-w7:~/gnu/github/exiv2/exiv2/test $609 rmills@rmillsmbp:~/gnu/github/exiv2/exiv2/test $ 

I have a little script to reproduce this in the terminal:

C:\Users\rmills\gnu\github\exiv2\exiv2\test>cat foo.sh
cp                                      data/exiv2-empty.jpg       empty-jpg
../build/bin/exiv2 -eX --verbose --force                           empty.jpg
../build/bin/exiv2 -M'set Xmp.xmp.ModifyDate 2015-04-17T18:10:22Z' empty.xmp
cat                                                                empty.xmp
TZ=GMT-8 ../build/bin/exiv2 -iX --verbose --force                  empty.jpg
../build/bin/exiv2 -pa --grep date/i                               empty.jpg

It's really difficult to debug this issue for several reasons: 1) I don't know how to debug on MinGW and can't get the Xcode 10.0 debugger to work on Exiv2. Xcode 10 was released by Apple on 17 September 2018. 2) The labyrinth of code to the convertor is very obscure. It goes into the XMPsdk code and then into various time functions.

Just to add to the current misery, MacOS-X Mojave update has broken my local area network. Can't get anything to work on the network at the moment. The webserver is also 100% broken.

clanmills commented 6 years ago

@cgilles Thank you very much for all the input you are providing on v0.27. It's very helpful indeed to get all this feedback. v0.27 will be much stronger thanks to your efforts. Thank You very much.

I've looked at your patch. I will investigate restoring src/localtime.c and src/gmtime for MinGW and MSVC today. As a team, we hoped to remove all "C" code from the code base - however it looks as though it will have to be retained for MSVC and MinGW.

I expect you'll see that we made progress last night with ExifTags::groupList() #465. We're puzzled that the sample code won't compile that API and @piponazo hopes to investigate that mystery today. Thank you for the reference to the digiKam code that uses that API. I cut'n'pasted that into samples/taglist.cpp. Thanks very much.

piponazo commented 6 years ago

@cgilles could you document here exactly the steps you followed to compile exiv2 with MinGW 32 bits, and the versions of the tools used? I just tried in my machine with MSYS2 + MinGW 32 bits (gcc-7.2) and I could compile the complete project (library, exiv2 app and samples) without any linking issue.

cgilles commented 6 years ago

Whole digiKam windows bundle is compiled, linked, and packaged under... Linux, not windows. We use MXE.cc environnement, which is in fact MinGW in background.

https://mxe.cc/

When i said that all windows binaries (.dll, .exe, .lib, etc...), i want said "all", from scratch.There is no Windows stuff in this room, only pingouin on the banquise.

So, no extra dll, no virus risk, faster compilation, easy scripting/tests with bash, no need a windows compiler (slow and complex to configure). I use this way to deploy 2 huge c/c++ frameworks in my office to control a nuclear reactor with real time acquisition units. The framework must run under Linux and under windows. There is no Windows machine to compile the windows target.

We do the same for digikam of course, and the complexity is in higher level as MXE must cross compile :

The whole process is automatized in 4 bash scripts and take around 2h30 to obtain the setup.exe at end (i7 8 cores, 32 Gb RAM, SSD) All the source code is here :

https://github.com/KDE/digikam/tree/master/project/bundles/mxe

We have 2 windows targets : 32 and 64 bits, compiled separately in 2 different target directories, and which give 2 setup.exe.

The installer are available here if you want to see the result under Windows :

https://files.kde.org/digikam/

So, while this huge MXE cross-compiling stage, only Exiv2 has this kind of linking problem. Strange no ?

Gilles Caulier

Le sam. 13 oct. 2018 à 08:55, Luis Díaz Más notifications@github.com a écrit :

@cgilles https://github.com/cgilles could you document here exactly the steps you followed to compile exiv2 with MinGW 32 bits, and the versions of the tools used? I just tried in my machine with MSYS2 + MinGW 32 bits (gcc-7.2) and I could compile the complete project (library, exiv2 app and samples) without any linking issue.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Exiv2/exiv2/issues/473#issuecomment-429516908, or mute the thread https://github.com/notifications/unsubscribe-auth/ACd9ePKAqQGeYRwK-r8tuRRJgvjf5GdTks5ukY5KgaJpZM4XWwPu .

cgilles commented 6 years ago

To be able to reproduce the dysfunction, i prepare 2 scripts, based on my digiKam work to :

1- prepare the MXE env. 2- configure Exiv2 source code with MXE and CMake.

Be patient, i just check if all is ready on my computer before to share the scripts. To respond to your previous question about the GCC version used in MXE, see below :

[gilles@localhost exiv2.mxe]$ ll total 12 -rwxr-xr-x 1 gilles gilles 3358 oct. 13 13:49 bootstrap-exiv2.mxe -rwxr-xr-x 1 gilles gilles 4992 oct. 13 13:51 build-mxe.sh [gilles@localhost exiv2.mxe]$ pwd /home/gilles/Téléchargements/exiv2.mxe [gilles@localhost exiv2.mxe]$ ./build-mxe.sh build-mxe.sh : build a bundle MXE install with Exiv2 dependencies.

Target Windows architecture: 32 bits. CPU Cores to use : 7 Clonage dans '/home/gilles/Téléchargements/exiv2.mxe/build.win32'...

---------- Updating MXE Déjà à jour.

---------- Building Exiv2 low level dependencies with MXE [create settings.mk] [check reqs] [download] binutils-2.28.tar.bz2 [nonet lib] /mnt/data2/download/exiv2.mxe/build.win32/usr/x86_64-pc-linux-gnu/lib/nonetwork.so
[git-log] a063f9b3 darwin: don't build i386 nonet lib [build] mxe-conf i686-w64-mingw32.shared [done] mxe-conf i686-w64-mingw32.shared 12 KiB 0m2.368s [build] binutils i686-w64-mingw32.shared [done] binutils i686-w64-mingw32.shared 462128 KiB 0m53.991s [download] mingw-w64-v5.0.4.tar.bz2 [build] mingw-w64 i686-w64-mingw32.shared [done] mingw-w64 i686-w64-mingw32.shared 16 KiB 0m2.276s [download] gmp-6.1.2.tar.xz [build] mxe-conf x86_64-pc-linux-gnu [done] mxe-conf x86_64-pc-linux-gnu 12 KiB 0m2.393s [build] gmp x86_64-pc-linux-gnu [done] gmp x86_64-pc-linux-gnu 29908 KiB 0m35.403s [download] isl-0.15.tar.bz2 [build] isl x86_64-pc-linux-gnu [done] isl x86_64-pc-linux-gnu 40956 KiB 0m23.922s [download] mpfr-3.1.5.tar.xz [build] mpfr x86_64-pc-linux-gnu [done] mpfr x86_64-pc-linux-gnu 15276 KiB 0m20.332s [download] mpc-1.1.0.tar.gz [build] mpc x86_64-pc-linux-gnu [done] mpc x86_64-pc-linux-gnu 6428 KiB 0m7.250s [download] gcc-5.5.0.tar.xz [build] gcc i686-w64-mingw32.shared [done] gcc i686-w64-mingw32.shared 2823540 KiB 8m41.247s [download] cmake-3.10.0.tar.gz [build] cmake x86_64-pc-linux-gnu [done] cmake x86_64-pc-linux-gnu 384420 KiB 3m25.541s [build] cmake-conf x86_64-pc-linux-gnu [done] cmake-conf x86_64-pc-linux-gnu 12 KiB 0m2.285s [build] cmake-conf i686-w64-mingw32.shared [done] cmake-conf i686-w64-mingw32.shared 12 KiB 0m2.305s [download] pkgconf-da179fd.tar.gz [download] libtool-2.4.4.tar.gz [build] pkgconf x86_64-pc-linux-gnu [done] pkgconf x86_64-pc-linux-gnu 1516 KiB 0m3.977s [build] pkgconf i686-w64-mingw32.shared [done] pkgconf i686-w64-mingw32.shared 424 KiB 0m2.555s [meta] cc i686-w64-mingw32.shared [download] libiconv-1.15.tar.gz [build] libiconv i686-w64-mingw32.shared [done] libiconv i686-w64-mingw32.shared 26668 KiB 0m18.701s [build] libiconv x86_64-pc-linux-gnu [done] libiconv x86_64-pc-linux-gnu 33312 KiB 0m22.751s [download] gettext-0.19.8.1.tar.gz [build] gettext x86_64-pc-linux-gnu

Gilles Caulier

cgilles commented 6 years ago

Note : MXE must work well under all Linux host. Here i use Mageia6 (based on RH). I my office, we use CentoOS 6 and 7 host VM. I know that MXE work under openSuse, as Maik Qualmaan (the second lead contributor working on digiKam work with this distro). We never use Ubuntu, as this Linux is just a waste of time to mime Windows stuff... I already tried to use it in my office to compile 3rd party code written explicitly under ubuntu, and we become completely krazy very quickly. This OS is unstable and not dedicated to develop. Do not ask me something about ubuntu, i hate...

cgilles commented 6 years ago

Voilà, the MXE env is ready to use to cross compile Exiv2 on my Linux : [gilles@localhost exiv2.mxe]$ ll total 12 -rwxr-xr-x 1 gilles gilles 3358 oct. 13 13:49 bootstrap-exiv2.mxe -rwxr-xr-x 1 gilles gilles 4992 oct. 13 13:51 build-mxe.sh [gilles@localhost exiv2.mxe]$ pwd /home/gilles/Téléchargements/exiv2.mxe [gilles@localhost exiv2.mxe]$ ./build-mxe.sh build-mxe.sh : build a bundle MXE install with Exiv2 dependencies.

Target Windows architecture: 32 bits. CPU Cores to use : 7 Clonage dans '/home/gilles/Téléchargements/exiv2.mxe/build.win32'...

---------- Updating MXE Déjà à jour.

---------- Building Exiv2 low level dependencies with MXE [create settings.mk] [check reqs] [download] binutils-2.28.tar.bz2 [nonet lib] /mnt/data2/download/exiv2.mxe/build.win32/usr/x86_64-pc-linux-gnu/lib/nonetwork.so
[git-log] a063f9b3 darwin: don't build i386 nonet lib [build] mxe-conf i686-w64-mingw32.shared [done] mxe-conf i686-w64-mingw32.shared 12 KiB 0m2.368s [build] binutils i686-w64-mingw32.shared [done] binutils i686-w64-mingw32.shared 462128 KiB 0m53.991s [download] mingw-w64-v5.0.4.tar.bz2 [build] mingw-w64 i686-w64-mingw32.shared [done] mingw-w64 i686-w64-mingw32.shared 16 KiB 0m2.276s [download] gmp-6.1.2.tar.xz [build] mxe-conf x86_64-pc-linux-gnu [done] mxe-conf x86_64-pc-linux-gnu 12 KiB 0m2.393s [build] gmp x86_64-pc-linux-gnu [done] gmp x86_64-pc-linux-gnu 29908 KiB 0m35.403s [download] isl-0.15.tar.bz2 [build] isl x86_64-pc-linux-gnu [done] isl x86_64-pc-linux-gnu 40956 KiB 0m23.922s [download] mpfr-3.1.5.tar.xz [build] mpfr x86_64-pc-linux-gnu [done] mpfr x86_64-pc-linux-gnu 15276 KiB 0m20.332s [download] mpc-1.1.0.tar.gz [build] mpc x86_64-pc-linux-gnu [done] mpc x86_64-pc-linux-gnu 6428 KiB 0m7.250s [download] gcc-5.5.0.tar.xz [build] gcc i686-w64-mingw32.shared [done] gcc i686-w64-mingw32.shared 2823540 KiB 8m41.247s [download] cmake-3.10.0.tar.gz [build] cmake x86_64-pc-linux-gnu [done] cmake x86_64-pc-linux-gnu 384420 KiB 3m25.541s [build] cmake-conf x86_64-pc-linux-gnu [done] cmake-conf x86_64-pc-linux-gnu 12 KiB 0m2.285s [build] cmake-conf i686-w64-mingw32.shared [done] cmake-conf i686-w64-mingw32.shared 12 KiB 0m2.305s [download] pkgconf-da179fd.tar.gz [download] libtool-2.4.4.tar.gz [build] pkgconf x86_64-pc-linux-gnu [done] pkgconf x86_64-pc-linux-gnu 1516 KiB 0m3.977s [build] pkgconf i686-w64-mingw32.shared [done] pkgconf i686-w64-mingw32.shared 424 KiB 0m2.555s [meta] cc i686-w64-mingw32.shared [download] libiconv-1.15.tar.gz [build] libiconv i686-w64-mingw32.shared [done] libiconv i686-w64-mingw32.shared 26668 KiB 0m18.701s [build] libiconv x86_64-pc-linux-gnu [done] libiconv x86_64-pc-linux-gnu 33312 KiB 0m22.751s [download] gettext-0.19.8.1.tar.gz [build] gettext x86_64-pc-linux-gnu [done] gettext x86_64-pc-linux-gnu 174400 KiB 1m30.392s [build] gettext i686-w64-mingw32.shared [done] gettext i686-w64-mingw32.shared 112076 KiB 0m19.095s [download] xz-5.2.4.tar.gz [build] xz i686-w64-mingw32.shared [done] xz i686-w64-mingw32.shared 10452 KiB 0m9.072s [download] zlib-1.2.11.tar.xz [build] zlib i686-w64-mingw32.shared [done] zlib i686-w64-mingw32.shared 3960 KiB 0m3.138s [download] libxml2-2.9.4.tar.gz [build] libxml2 i686-w64-mingw32.shared [done] libxml2 i686-w64-mingw32.shared 64520 KiB 0m16.574s [download] libgpg-error-1.32.tar.bz2 [build] libgpg_error i686-w64-mingw32.shared [done] libgpg_error i686-w64-mingw32.shared 8932 KiB 0m8.680s [download] libgcrypt-1.8.3.tar.bz2 [build] autotools x86_64-pc-linux-gnu [done] autotools x86_64-pc-linux-gnu 328 KiB 0m4.266s [build] libgcrypt i686-w64-mingw32.shared [done] libgcrypt i686-w64-mingw32.shared 33124 KiB 0m25.783s [download] libxslt-1.1.29.tar.gz [build] libxslt i686-w64-mingw32.shared [done] libxslt i686-w64-mingw32.shared 33808 KiB 0m15.203s [download] libpng-1.6.35.tar.xz [build] libpng i686-w64-mingw32.shared [done] libpng i686-w64-mingw32.shared 12364 KiB 0m6.798s [download] expat-2.2.6.tar.bz2 [build] expat i686-w64-mingw32.shared [done] expat i686-w64-mingw32.shared 6520 KiB 0m8.853s [build] zlib x86_64-pc-linux-gnu [done] zlib x86_64-pc-linux-gnu 3932 KiB 0m3.281s [download] mman-win32-b7ec370.tar.gz [build] mman-win32 i686-w64-mingw32.shared [done] mman-win32 i686-w64-mingw32.shared 700 KiB 0m3.105s [build] pthreads i686-w64-mingw32.shared [done] pthreads i686-w64-mingw32.shared 1016 KiB 0m4.197s

Elaspsed time for script execution : 0 hours 21 minutes 59 seconds [gilles@localhost exiv2.mxe]$

As you can see, it take 22 minutes to build, no more.

[gilles@localhost exiv2.mxe]$ uname -a Linux localhost 4.9.43-desktop-1.mga6 #1 SMP Sun Aug 13 15:52:35 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux [gilles@localhost exiv2.mxe]$

The script to init MXE is attached build-mxe.sh.txt

cgilles commented 6 years ago

The MXE 32 was compiled here :

[gilles@localhost exiv2.mxe]$ ll total 20 -rwxr-xr-x 1 gilles gilles 3358 oct. 13 13:49 bootstrap-exiv2.mxe.txt -rwxr-xr-x 1 gilles gilles 4992 oct. 13 13:51 build-mxe.sh.txt drwxr-xr-x 12 gilles gilles 4096 oct. 13 14:14 build.win32/ drwxr-xr-x 2 gilles gilles 4096 oct. 13 13:52 logs/ [gilles@localhost exiv2.mxe]$ tree -L 1 build.win32 build.win32 ├── docs ├── ext ├── LICENSE.md ├── log ├── Makefile ├── mxe.github.mk ├── mxe.patch.mk ├── mxe.updates.mk ├── pkg ├── plugins ├── README.md ├── settings.mk ├── src ├── tools └── usr

8 directories, 7 files

the build.win32 sub directories is a Linux like. The most important place are : build.win32/log : all log file about MXE package installed build.win32/usr/i686-w64-mingw32.shared/ : all cross compiled binaries are there. The rest of build.win32 are linux based binaries, used to croos compile.

Gilles Caulier

cgilles commented 6 years ago

Now it's time to cross compile Exiv2 with MXE. In fact you will see that with cmake, it's very simple :

1/ Checkout a fresh copy of Exiv2 from github :

[gilles@localhost exiv2.mxe]$ pwd /home/gilles/Téléchargements/exiv2.mxe [gilles@localhost exiv2.mxe]$ git clone https://github.com/Exiv2/exiv2.git Clonage dans 'exiv2'... remote: Enumerating objects: 184, done. remote: Counting objects: 100% (184/184), done. remote: Compressing objects: 100% (104/104), done. remote: Total 37186 (delta 97), reused 141 (delta 76), pack-reused 37002 Réception d'objets: 100% (37186/37186), 85.95 MiB | 2.37 MiB/s, fait. Résolution des deltas: 100% (27758/27758), fait. [gilles@localhost exiv2.mxe]$ ll total 24 -rwxr-xr-x 1 gilles gilles 3358 oct. 13 13:49 bootstrap-exiv2.mxe.txt -rwxr-xr-x 1 gilles gilles 4992 oct. 13 13:51 build-mxe.sh.txt drwxr-xr-x 12 gilles gilles 4096 oct. 13 14:14 build.win32/ drwxr-xr-x 15 gilles gilles 4096 oct. 13 14:28 exiv2/ drwxr-xr-x 2 gilles gilles 4096 oct. 13 13:52 logs/ [gilles@localhost exiv2.mxe]$

2/ use my 2nd bootstrap script to place on root level of Exiv2 sub directory (script is attached) :

[gilles@localhost exiv2.mxe]$ pwd /home/gilles/Téléchargements/exiv2.mxe [gilles@localhost exiv2.mxe]$ ll total 24 -rwxr-xr-x 1 gilles gilles 3358 oct. 13 13:49 bootstrap-exiv2.mxe.txt -rwxr-xr-x 1 gilles gilles 4992 oct. 13 13:51 build-mxe.sh.txt drwxr-xr-x 12 gilles gilles 4096 oct. 13 14:14 build.win32/ drwxr-xr-x 15 gilles gilles 4096 oct. 13 14:28 exiv2/ drwxr-xr-x 2 gilles gilles 4096 oct. 13 13:52 logs/ [gilles@localhost build.win32]$ cd build.win32 && pwd && cd.. /home/gilles/Téléchargements/exiv2.mxe/build.win32 [gilles@localhost exiv2.mxe]$ cp bootstrap-exiv2.mxe.txt exiv2/bootstrap-exiv2.mxe.sh [gilles@localhost exiv2.mxe]$ cd exiv2 [gilles@localhost exiv2]$ ./bootstrap-exiv2.mxe.sh /home/gilles/Téléchargements/exiv2.mxe/build.win32 MXE target : 32 bits shared Installing to /home/gilles/Téléchargements/exiv2.mxe/build.win32 for target i686-w64-mingw32.shared with build mode RelWithDebInfo and configure options -DBUILD_SHARED_LIBS=ON \ -DEXIV2_ENABLE_XMP=ON \ -DEXIV2_ENABLE_EXTERNAL_XMP=OFF \ -DEXIV2_ENABLE_PNG=ON \ -DEXIV2_ENABLE_NLS=ON \ -DEXIV2_ENABLE_PRINTUCS2=ON \ -DEXIV2_ENABLE_LENSDATA=ON \ -DEXIV2_ENABLE_VIDEO=OFF \ -DEXIV2_ENABLE_WEBREADY=OFF \ -DEXIV2_ENABLE_DYNAMIC_RUNTIME=OFF \ -DEXIV2_ENABLE_CURL=OFF \ -DEXIV2_ENABLE_SSH=OFF \ -DEXIV2_BUILD_SAMPLES=OFF \ -DEXIV2_BUILD_PO=OFF \ -DEXIV2_BUILD_EXIV2_COMMAND=ON \ -DEXIV2_BUILD_UNIT_TESTS=OFF \ -DEXIV2_BUILD_DOC=OFF \ -DEXIV2_TEAM_EXTRA_WARNINGS=OFF \ -DEXIV2_TEAM_WARNINGS_AS_ERRORS=OFF \ -DEXIV2_TEAM_USE_SANITIZERS=OFF \ -DEXIV2_ENABLE_WIN_UNICODE=OFF == Using MXE wrapper: /mnt/data2/download/exiv2.mxe/build.win32/usr/bin/i686-w64-mingw32.shared-cmake

cgilles commented 6 years ago

Rectified shell scripts to confire fine Exiv2 with MXE. It miss regex install in previous script.

build-mxe.sh.txt bootstrap-exiv2.mxe.txt

Now the configuration is fine : [gilles@localhost exiv2]$ ./bootstrap-exiv2.mxe.sh /home/gilles/Téléchargements/exiv2.mxe/build.win32 MXE target : 32 bits shared Installing to /home/gilles/Téléchargements/exiv2.mxe/build.win32 for target i686-w64-mingw32.shared with build mode RelWithDebInfo and configure options -DBUILD_SHARED_LIBS=ON \ -DEXIV2_ENABLE_XMP=ON \ -DEXIV2_ENABLE_EXTERNAL_XMP=OFF \ -DEXIV2_ENABLE_PNG=ON \ -DEXIV2_ENABLE_NLS=ON \ -DEXIV2_ENABLE_PRINTUCS2=ON \ -DEXIV2_ENABLE_LENSDATA=ON \ -DEXIV2_ENABLE_VIDEO=OFF \ -DEXIV2_ENABLE_WEBREADY=OFF \ -DEXIV2_ENABLE_DYNAMIC_RUNTIME=OFF \ -DEXIV2_ENABLE_CURL=OFF \ -DEXIV2_ENABLE_SSH=OFF \ -DEXIV2_BUILD_SAMPLES=OFF \ -DEXIV2_BUILD_PO=OFF \ -DEXIV2_BUILD_EXIV2_COMMAND=ON \ -DEXIV2_BUILD_UNIT_TESTS=OFF \ -DEXIV2_BUILD_DOC=OFF \ -DEXIV2_TEAM_EXTRA_WARNINGS=OFF \ -DEXIV2_TEAM_WARNINGS_AS_ERRORS=OFF \ -DEXIV2_TEAM_USE_SANITIZERS=OFF \ -DEXIV2_ENABLE_WIN_UNICODE=OFF == Using MXE wrapper: /mnt/data2/download/exiv2.mxe/build.win32/usr/bin/i686-w64-mingw32.shared-cmake

-- Build files have been written to: /home/gilles/Téléchargements/exiv2.mxe/exiv2/build [gilles@localhost exiv2]$

cgilles commented 6 years ago

To compil, to go exiv2/build and run make as usual :

[gilles@localhost build]$ make Scanning dependencies of target xmp [ 1%] Building CXX object xmpsdk/CMakeFiles/xmp.dir/src/ExpatAdapter.cpp.obj [ 2%] Building CXX object xmpsdk/CMakeFiles/xmp.dir/src/MD5.cpp.obj [ 3%] Building CXX object xmpsdk/CMakeFiles/xmp.dir/src/ParseRDF.cpp.obj [ 4%] Building CXX object xmpsdk/CMakeFiles/xmp.dir/src/UnicodeConversions.cpp.obj [ 5%] Building CXX object xmpsdk/CMakeFiles/xmp.dir/src/WXMPIterator.cpp.obj [ 6%] Building CXX object xmpsdk/CMakeFiles/xmp.dir/src/WXMPMeta.cpp.obj [ 7%] Building CXX object xmpsdk/CMakeFiles/xmp.dir/src/WXMPUtils.cpp.obj [ 8%] Building CXX object xmpsdk/CMakeFiles/xmp.dir/src/XML_Node.cpp.obj [ 10%] Building CXX object xmpsdk/CMakeFiles/xmp.dir/src/XMPCore_Impl.cpp.obj [ 11%] Building CXX object xmpsdk/CMakeFiles/xmp.dir/src/XMPIterator.cpp.obj [ 12%] Building CXX object xmpsdk/CMakeFiles/xmp.dir/src/XMPMeta-GetSet.cpp.obj [ 13%] Building CXX object xmpsdk/CMakeFiles/xmp.dir/src/XMPMeta-Parse.cpp.obj [ 14%] Building CXX object xmpsdk/CMakeFiles/xmp.dir/src/XMPMeta-Serialize.cpp.obj [ 15%] Building CXX object xmpsdk/CMakeFiles/xmp.dir/src/XMPMeta.cpp.obj [ 16%] Building CXX object xmpsdk/CMakeFiles/xmp.dir/src/XMPUtils-FileInfo.cpp.obj [ 17%] Building CXX object xmpsdk/CMakeFiles/xmp.dir/src/XMPUtils.cpp.obj [ 19%] Linking CXX static library ../lib/libxmp.a [ 19%] Built target xmp Scanning dependencies of target exiv2lib_int [ 20%] Building CXX object src/CMakeFiles/exiv2lib_int.dir/canonmn_int.cpp.obj [ 21%] Building CXX object src/CMakeFiles/exiv2lib_int.dir/casiomn_int.cpp.obj [ 22%] Building CXX object src/CMakeFiles/exiv2lib_int.dir/cr2header_int.cpp.obj [ 23%] Building CXX object src/CMakeFiles/exiv2lib_int.dir/crwimage_int.cpp.obj [ 24%] Building CXX object src/CMakeFiles/exiv2lib_int.dir/fujimn_int.cpp.obj [ 25%] Building CXX object src/CMakeFiles/exiv2lib_int.dir/image_int.cpp.obj [ 26%] Building CXX object src/CMakeFiles/exiv2lib_int.dir/makernote_int.cpp.obj [ 28%] Building CXX object src/CMakeFiles/exiv2lib_int.dir/minoltamn_int.cpp.obj [ 29%] Building CXX object src/CMakeFiles/exiv2lib_int.dir/nikonmn_int.cpp.obj [ 30%] Building CXX object src/CMakeFiles/exiv2lib_int.dir/olympusmn_int.cpp.obj [ 31%] Building CXX object src/CMakeFiles/exiv2lib_int.dir/orfimage_int.cpp.obj [ 32%] Building CXX object src/CMakeFiles/exiv2lib_int.dir/panasonicmn_int.cpp.obj [ 33%] Building CXX object src/CMakeFiles/exiv2lib_int.dir/pentaxmn_int.cpp.obj [ 34%] Building CXX object src/CMakeFiles/exiv2lib_int.dir/rw2image_int.cpp.obj [ 35%] Building CXX object src/CMakeFiles/exiv2lib_int.dir/samsungmn_int.cpp.obj [ 37%] Building CXX object src/CMakeFiles/exiv2lib_int.dir/sigmamn_int.cpp.obj [ 38%] Building CXX object src/CMakeFiles/exiv2lib_int.dir/sonymn_int.cpp.obj [ 39%] Building CXX object src/CMakeFiles/exiv2lib_int.dir/tags_int.cpp.obj [ 40%] Building CXX object src/CMakeFiles/exiv2lib_int.dir/tiffcomposite_int.cpp.obj [ 41%] Building CXX object src/CMakeFiles/exiv2lib_int.dir/tiffimage_int.cpp.obj [ 42%] Building CXX object src/CMakeFiles/exiv2lib_int.dir/tiffvisitor_int.cpp.obj [ 43%] Building CXX object src/CMakeFiles/exiv2lib_int.dir/helper_functions.cpp.obj [ 44%] Building CXX object src/CMakeFiles/exiv2lib_int.dir/pngchunk_int.cpp.obj [ 44%] Built target exiv2lib_int Scanning dependencies of target exiv2lib [ 46%] Building CXX object src/CMakeFiles/exiv2lib.dir/asfvideo.cpp.obj [ 47%] Building CXX object src/CMakeFiles/exiv2lib.dir/basicio.cpp.obj [ 48%] Building CXX object src/CMakeFiles/exiv2lib.dir/bigtiffimage.cpp.obj [ 49%] Building CXX object src/CMakeFiles/exiv2lib.dir/bmpimage.cpp.obj [ 50%] Building CXX object src/CMakeFiles/exiv2lib.dir/convert.cpp.obj /home/gilles/Téléchargements/exiv2.mxe/exiv2/src/convert.cpp:1510:10: warning: 'bool {anonymous}::convertStringCharsetWindows(std::__cxx11::string&, const char, const char)' defined but not used [-Wunused-function] bool convertStringCharsetWindows(std::string& str, const char from, const char to) ^ [ 51%] Building CXX object src/CMakeFiles/exiv2lib.dir/cr2image.cpp.obj [ 52%] Building CXX object src/CMakeFiles/exiv2lib.dir/crwimage.cpp.obj [ 53%] Building CXX object src/CMakeFiles/exiv2lib.dir/datasets.cpp.obj [ 55%] Building CXX object src/CMakeFiles/exiv2lib.dir/easyaccess.cpp.obj [ 56%] Building CXX object src/CMakeFiles/exiv2lib.dir/epsimage.cpp.obj [ 57%] Building CXX object src/CMakeFiles/exiv2lib.dir/error.cpp.obj [ 58%] Building CXX object src/CMakeFiles/exiv2lib.dir/exif.cpp.obj [ 59%] Building CXX object src/CMakeFiles/exiv2lib.dir/futils.cpp.obj [ 60%] Building CXX object src/CMakeFiles/exiv2lib.dir/gifimage.cpp.obj [ 61%] Building CXX object src/CMakeFiles/exiv2lib.dir/http.cpp.obj [ 62%] Building CXX object src/CMakeFiles/exiv2lib.dir/image.cpp.obj [ 64%] Building CXX object src/CMakeFiles/exiv2lib.dir/ini.cpp.obj [ 65%] Building CXX object src/CMakeFiles/exiv2lib.dir/iptc.cpp.obj [ 66%] Building CXX object src/CMakeFiles/exiv2lib.dir/jp2image.cpp.obj [ 67%] Building CXX object src/CMakeFiles/exiv2lib.dir/jpgimage.cpp.obj [ 68%] Building CXX object src/CMakeFiles/exiv2lib.dir/matroskavideo.cpp.obj [ 69%] Building CXX object src/CMakeFiles/exiv2lib.dir/metadatum.cpp.obj [ 70%] Building CXX object src/CMakeFiles/exiv2lib.dir/mrwimage.cpp.obj [ 71%] Building CXX object src/CMakeFiles/exiv2lib.dir/orfimage.cpp.obj [ 73%] Building CXX object src/CMakeFiles/exiv2lib.dir/pgfimage.cpp.obj [ 74%] Building CXX object src/CMakeFiles/exiv2lib.dir/preview.cpp.obj [ 75%] Building CXX object src/CMakeFiles/exiv2lib.dir/properties.cpp.obj [ 76%] Building CXX object src/CMakeFiles/exiv2lib.dir/psdimage.cpp.obj [ 77%] Building CXX object src/CMakeFiles/exiv2lib.dir/quicktimevideo.cpp.obj [ 78%] Building CXX object src/CMakeFiles/exiv2lib.dir/rafimage.cpp.obj [ 79%] Building CXX object src/CMakeFiles/exiv2lib.dir/riffvideo.cpp.obj [ 80%] Building CXX object src/CMakeFiles/exiv2lib.dir/rw2image.cpp.obj [ 82%] Building CXX object src/CMakeFiles/exiv2lib.dir/tags.cpp.obj [ 83%] Building CXX object src/CMakeFiles/exiv2lib.dir/tgaimage.cpp.obj [ 84%] Building CXX object src/CMakeFiles/exiv2lib.dir/tiffimage.cpp.obj [ 85%] Building CXX object src/CMakeFiles/exiv2lib.dir/types.cpp.obj [ 86%] Building CXX object src/CMakeFiles/exiv2lib.dir/utilsvideo.cpp.obj [ 87%] Building CXX object src/CMakeFiles/exiv2lib.dir/value.cpp.obj [ 88%] Building CXX object src/CMakeFiles/exiv2lib.dir/version.cpp.obj [ 89%] Building CXX object src/CMakeFiles/exiv2lib.dir/webpimage.cpp.obj [ 91%] Building CXX object src/CMakeFiles/exiv2lib.dir/xmp.cpp.obj [ 92%] Building CXX object src/CMakeFiles/exiv2lib.dir/xmpsidecar.cpp.obj [ 93%] Building CXX object src/CMakeFiles/exiv2lib.dir/pngimage.cpp.obj [ 94%] Linking CXX shared library ../bin/libexiv2.dll CMakeFiles/exiv2lib.dir/objects.a(crwimage_int.cpp.obj): In function mkgmtime': /mnt/data2/download/exiv2.mxe/build.win32/usr/i686-w64-mingw32.shared/include/time.h:229: undefined reference to_mkgmtime32' collect2: error: ld returned 1 exit status src/CMakeFiles/exiv2lib.dir/build.make:1283 : la recette pour la cible « bin/libexiv2.dll » a échouée make[2]: [bin/libexiv2.dll] Erreur 1 CMakeFiles/Makefile2:214 : la recette pour la cible « src/CMakeFiles/exiv2lib.dir/all » a échouée make[1]: [src/CMakeFiles/exiv2lib.dir/all] Erreur 2 Makefile:151 : la recette pour la cible « all » a échouée make: *** [all] Erreur 2

Gilles Caulier

cgilles commented 6 years ago

Note : if you want to test to 64 bits target cross compiled, just change the settings MXE_ARCHBITS=32 to 64 in buil-mxe.sh.txt file.

You can re-run the script and a new build.win64 will be created for this target. Both 32 and 64 bits can be compiled at the same place, there is no risk to mix both :

[gilles@localhost exiv2.mxe]$ ./build-mxe.sh.txt build-mxe.sh : build a bundle MXE install with Exiv2 dependencies.

Target Windows architecture: 64 bits. CPU Cores to use : 7 Clonage dans '/home/gilles/Téléchargements/exiv2.mxe/build.win64'...

---------- Updating MXE Déjà à jour.

---------- Building Exiv2 low level dependencies with MXE [create settings.mk] [check reqs] [download] binutils-2.28.tar.bz2 [nonet lib] /mnt/data2/download/exiv2.mxe/build.win64/usr/x86_64-pc-linux-gnu/lib/nonetwork.so
[git-log] a063f9b3 darwin: don't build i386 nonet lib [build] mxe-conf x86_64-w64-mingw32.shared [done] mxe-conf x86_64-w64-mingw32.shared 12 KiB 0m2.234s [build] binutils x86_64-w64-mingw32.shared [done] binutils x86_64-w64-mingw32.shared 485436 KiB 0m42.914s [download] mingw-w64-v5.0.4.tar.bz2 [build] mingw-w64 x86_64-w64-mingw32.shared [done] mingw-w64 x86_64-w64-mingw32.shared 16 KiB 0m2.312s [download] gmp-6.1.2.tar.xz [build] mxe-conf x86_64-pc-linux-gnu [done] mxe-conf x86_64-pc-linux-gnu 12 KiB 0m2.303s [build] gmp x86_64-pc-linux-gnu [done] gmp x86_64-pc-linux-gnu 29908 KiB 0m25.922s [download] isl-0.15.tar.bz2 [build] isl x86_64-pc-linux-gnu [done] isl x86_64-pc-linux-gnu 40956 KiB 0m17.694s [download] mpfr-3.1.5.tar.xz [build] mpfr x86_64-pc-linux-gnu [done] mpfr x86_64-pc-linux-gnu 15276 KiB 0m15.906s [download] mpc-1.1.0.tar.gz [build] mpc x86_64-pc-linux-gnu [done] mpc x86_64-pc-linux-gnu 6428 KiB 0m6.989s [download] gcc-5.5.0.tar.xz [build] gcc x86_64-w64-mingw32.shared [done] gcc x86_64-w64-mingw32.shared 2910556 KiB 7m10.004s [download] cmake-3.10.0.tar.gz [build] cmake x86_64-pc-linux-gnu [done] cmake x86_64-pc-linux-gnu 384432 KiB 2m26.644s [build] cmake-conf x86_64-pc-linux-gnu [done] cmake-conf x86_64-pc-linux-gnu 12 KiB 0m2.233s [build] cmake-conf x86_64-w64-mingw32.shared [done] cmake-conf x86_64-w64-mingw32.shared 12 KiB 0m2.226s [download] pkgconf-da179fd.tar.gz [download] libtool-2.4.4.tar.gz [build] pkgconf x86_64-pc-linux-gnu [done] pkgconf x86_64-pc-linux-gnu 1516 KiB 0m3.670s [build] pkgconf x86_64-w64-mingw32.shared [done] pkgconf x86_64-w64-mingw32.shared 424 KiB 0m2.217s [meta] cc x86_64-w64-mingw32.shared [download] mingw-libgnurx-2.6.1-src.tar.gz [build] libgnurx x86_64-w64-mingw32.shared [done] libgnurx x86_64-w64-mingw32.shared 1296 KiB 0m3.902s [download] libiconv-1.15.tar.gz [build] libiconv x86_64-w64-mingw32.shared [done] libiconv x86_64-w64-mingw32.shared 27100 KiB 0m16.497s [build] libiconv x86_64-pc-linux-gnu [done] libiconv x86_64-pc-linux-gnu 33312 KiB 0m22.224s [download] gettext-0.19.8.1.tar.gz [build] gettext x86_64-pc-linux-gnu [done] gettext x86_64-pc-linux-gnu 174396 KiB 1m24.327s [build] gettext x86_64-w64-mingw32.shared [done] gettext x86_64-w64-mingw32.shared 112324 KiB 0m20.417s [download] xz-5.2.4.tar.gz [build] xz x86_64-w64-mingw32.shared [done] xz x86_64-w64-mingw32.shared 10808 KiB 0m8.638s [download] zlib-1.2.11.tar.xz [build] zlib x86_64-w64-mingw32.shared [done] zlib x86_64-w64-mingw32.shared 3980 KiB 0m2.974s [download] libxml2-2.9.4.tar.gz [build] libxml2 x86_64-w64-mingw32.shared [done] libxml2 x86_64-w64-mingw32.shared 67024 KiB 0m15.463s [download] libgpg-error-1.32.tar.bz2 [build] libgpg_error x86_64-w64-mingw32.shared [done] libgpg_error x86_64-w64-mingw32.shared 9416 KiB 0m8.771s [download] libgcrypt-1.8.3.tar.bz2 [build] autotools x86_64-pc-linux-gnu [done] autotools x86_64-pc-linux-gnu 328 KiB 0m4.166s [build] libgcrypt x86_64-w64-mingw32.shared [done] libgcrypt x86_64-w64-mingw32.shared 39184 KiB 0m41.456s [download] libxslt-1.1.29.tar.gz [build] libxslt x86_64-w64-mingw32.shared [done] libxslt x86_64-w64-mingw32.shared 34740 KiB 0m12.071s [download] libpng-1.6.35.tar.xz [build] libpng x86_64-w64-mingw32.shared [done] libpng x86_64-w64-mingw32.shared 13004 KiB 0m6.947s [download] expat-2.2.6.tar.bz2 [build] expat x86_64-w64-mingw32.shared [done] expat x86_64-w64-mingw32.shared 7104 KiB 0m7.906s [build] zlib x86_64-pc-linux-gnu [done] zlib x86_64-pc-linux-gnu 3932 KiB 0m2.787s [download] mman-win32-b7ec370.tar.gz [build] mman-win32 x86_64-w64-mingw32.shared [done] mman-win32 x86_64-w64-mingw32.shared 812 KiB 0m3.222s [build] pthreads x86_64-w64-mingw32.shared [done] pthreads x86_64-w64-mingw32.shared 1180 KiB 0m3.652s

Elaspsed time for script execution : 0 hours 18 minutes 49 seconds

[gilles@localhost exiv2.mxe]$ [gilles@localhost exiv2]$ ./bootstrap-exiv2.mxe.sh /home/gilles/Téléchargements/exiv2.mxe/build.win64 MXE target : 64 bits shared Installing to /home/gilles/Téléchargements/exiv2.mxe/build.win64 for target x86_64-w64-mingw32.shared with build mode RelWithDebInfo and configure options -DBUILD_SHARED_LIBS=ON \ -DEXIV2_ENABLE_XMP=ON \ -DEXIV2_ENABLE_EXTERNAL_XMP=OFF \ -DEXIV2_ENABLE_PNG=ON \ -DEXIV2_ENABLE_NLS=ON \ -DEXIV2_ENABLE_PRINTUCS2=ON \ -DEXIV2_ENABLE_LENSDATA=ON \ -DEXIV2_ENABLE_VIDEO=OFF \ -DEXIV2_ENABLE_WEBREADY=OFF \ -DEXIV2_ENABLE_DYNAMIC_RUNTIME=OFF \ -DEXIV2_ENABLE_CURL=OFF \ -DEXIV2_ENABLE_SSH=OFF \ -DEXIV2_BUILD_SAMPLES=OFF \ -DEXIV2_BUILD_PO=OFF \ -DEXIV2_BUILD_EXIV2_COMMAND=ON \ -DEXIV2_BUILD_UNIT_TESTS=OFF \ -DEXIV2_BUILD_DOC=OFF \ -DEXIV2_TEAM_EXTRA_WARNINGS=OFF \ -DEXIV2_TEAM_WARNINGS_AS_ERRORS=OFF \ -DEXIV2_TEAM_USE_SANITIZERS=OFF \ -DEXIV2_ENABLE_WIN_UNICODE=OFF == Using MXE wrapper: /mnt/data2/download/exiv2.mxe/build.win64/usr/bin/x86_64-w64-mingw32.shared-cmake

-- Build files have been written to: /home/gilles/Téléchargements/exiv2.mxe/exiv2/build [gilles@localhost exiv2]$ cd build [gilles@localhost build]$ make Scanning dependencies of target xmp [ 1%] Building CXX object xmpsdk/CMakeFiles/xmp.dir/src/ExpatAdapter.cpp.obj [ 2%] Building CXX object xmpsdk/CMakeFiles/xmp.dir/src/MD5.cpp.obj [ 3%] Building CXX object xmpsdk/CMakeFiles/xmp.dir/src/ParseRDF.cpp.obj [ 4%] Building CXX object xmpsdk/CMakeFiles/xmp.dir/src/UnicodeConversions.cpp.obj [ 5%] Building CXX object xmpsdk/CMakeFiles/xmp.dir/src/WXMPIterator.cpp.obj [ 6%] Building CXX object xmpsdk/CMakeFiles/xmp.dir/src/WXMPMeta.cpp.obj [ 7%] Building CXX object xmpsdk/CMakeFiles/xmp.dir/src/WXMPUtils.cpp.obj [ 8%] Building CXX object xmpsdk/CMakeFiles/xmp.dir/src/XML_Node.cpp.obj [ 10%] Building CXX object xmpsdk/CMakeFiles/xmp.dir/src/XMPCore_Impl.cpp.obj [ 11%] Building CXX object xmpsdk/CMakeFiles/xmp.dir/src/XMPIterator.cpp.obj [ 12%] Building CXX object xmpsdk/CMakeFiles/xmp.dir/src/XMPMeta-GetSet.cpp.obj [ 13%] Building CXX object xmpsdk/CMakeFiles/xmp.dir/src/XMPMeta-Parse.cpp.obj ...

clanmills commented 6 years ago

@cgilles Thanks for all this input. I've never succeeded in getting anything to cross-compile. And I can't remember exactly what MXE is (I know it's an Intel faster cpu technology)

Is there an action here for me? Our buildserver builds MinGW/msys2 in 64 bits. Should I be adding 32bits to the build matrix? Should I be building/testing something concerning MXE?

cgilles commented 6 years ago

Few month ago, I ask to digikam users if 32 bits support can be dropped. The response has been ver negative.

As all the rest of d’imam bundle compile fine in 32 bits, there is no specific reason to not support 32 bits with exiv2

For the rc1 there is no problem as in the bundles I apply my patches.

We can ask to mdr to known the solution to this problem, in case of this problem has been already seen in another project

Le sam. 13 oct. 2018 à 17:23, Robin Mills notifications@github.com a écrit :

@cgilles https://github.com/cgilles Thanks for all this input. I've never succeeded in getting anything to cross-compile. And I can't remember exactly what MXE is (I know it's an Intel faster cpu technology)

Is there an action here for me? Our buildserver builds MinGW/msys2 in 64 bits. Should I be adding 32bits to the build matrix? Should I be building/testing something concerning MXE?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Exiv2/exiv2/issues/473#issuecomment-429550424, or mute the thread https://github.com/notifications/unsubscribe-auth/ACd9eGPg2Ht1BIKn73McYr6--o3M-A7aks5ukgVtgaJpZM4XWwPu .

-- Send with Gmail Mobile

piponazo commented 6 years ago

Wow that's more information than I expected @cgilles :stuck_out_tongue: . I will try to cross-compile from my ubuntu machine to see if I experience this issue. I would like to understand what's the root of this problem.

@clanmills I will take care of this issue.

piponazo commented 6 years ago

I was able to reproduce this on Ubuntu by using the default mingw package. In fact, I am getting other undefined references:

src/CMakeFiles/exiv2lib_int.dir/crwimage_int.cpp.obj:crwimage_int.cpp:(.text+0x7481): undefined reference to `_mkgmtime32'
src/CMakeFiles/exiv2lib_int.dir/pngchunk_int.cpp.obj:pngchunk_int.cpp:(.text+0xe1): undefined reference to `compress2'
src/CMakeFiles/exiv2lib_int.dir/pngchunk_int.cpp.obj:pngchunk_int.cpp:(.text+0x7dd): undefined reference to `crc32'
src/CMakeFiles/exiv2lib_int.dir/pngchunk_int.cpp.obj:pngchunk_int.cpp:(.text+0x7f3): undefined reference to `crc32'
src/CMakeFiles/exiv2lib_int.dir/pngchunk_int.cpp.obj:pngchunk_int.cpp:(.text+0x10ba): undefined reference to `crc32'
src/CMakeFiles/exiv2lib_int.dir/pngchunk_int.cpp.obj:pngchunk_int.cpp:(.text+0x10d0): undefined reference to `crc32'
src/CMakeFiles/exiv2lib_int.dir/pngchunk_int.cpp.obj:pngchunk_int.cpp:(.text+0x41d4): undefined reference to `uncompress'

After googling a bit about this, it seems to be a bug in MinGW 32 bits: https://sourceforge.net/p/mingw-w64/bugs/473/

The strange thing is that I could not reproduce it under Windows + MinGW 32 bits.

Therefore, I'll add back the localtime.c file, and include it only when using MinGW.

clanmills commented 6 years ago

@piponazo Those undefined functions (compress, crc32 and uncompress) are entry points in zlib (http://www.zlib.net).

cgilles commented 6 years ago

More interesting info with code before to re-introduce localtime.c :

[ 91%] Building CXX object src/CMakeFiles/exiv2lib.dir/xmp.cpp.obj [ 92%] Building CXX object src/CMakeFiles/exiv2lib.dir/xmpsidecar.cpp.obj [ 93%] Building CXX object src/CMakeFiles/exiv2lib.dir/pngimage.cpp.obj [ 94%] Linking CXX shared library ../bin/libexiv2.dll CMakeFiles/exiv2lib.dir/objects.a(crwimage_int.cpp.obj): In function mkgmtime': /mnt/data2/download/exiv2.mxe/build.win32/usr/i686-w64-mingw32.shared/include/time.h:229: undefined reference to_mkgmtime32' collect2: error: ld returned 1 exit status src/CMakeFiles/exiv2lib.dir/build.make:1283 : la recette pour la cible « bin/libexiv2.dll » a échouée make[2]: *** [bin/libexiv2.dll] Erreur 1

[ 91%] Building CXX object src/CMakeFiles/exiv2lib.dir/xmp.cpp.obj [ 92%] Building CXX object src/CMakeFiles/exiv2lib.dir/xmpsidecar.cpp.obj [ 93%] Building CXX object src/CMakeFiles/exiv2lib.dir/pngimage.cpp.obj [ 94%] Linking CXX shared library ../bin/libexiv2.dll [ 94%] Built target exiv2lib [ 95%] Building CXX object src/CMakeFiles/exiv2.dir/exiv2.cpp.obj [ 96%] Building CXX object src/CMakeFiles/exiv2.dir/actions.cpp.obj [ 97%] Building CXX object src/CMakeFiles/exiv2.dir/getopt.cpp.obj [ 98%] Building CXX object src/CMakeFiles/exiv2.dir/utils.cpp.obj [100%] Linking CXX executable ../bin/exiv2.exe [100%] Built target exiv2

So yes, it's certainly a bug in MinGW 32 bits which do not export the mkgmtime symbols.

cgilles commented 6 years ago

DOWNSTREAM bug from MXE :

https://github.com/mxe/mxe/issues/2227

Gilles Caulier

clanmills commented 6 years ago

I've discovered that the CMake variable MINGW is not defined on msys2 32 bit. We should be using MSYS.

@cgilles I'm adding support for MinGW/msys2 32 bit to the buildserver and will publish both 32 and 64 bit builds with RC1.

@cgilles I don't have time at the moment to work on MXE 32 bit. Please submit a PR and ask @piponazo and @clanmills to review/approve.

piponazo commented 6 years ago

@clanmills I think this issue does not occur when compiling on Windows + MSYS2 + MINGW, but only when cross-compiling from Linux to Windows with MinGW.

Therefore I think the solution implemented in #482 should be fine. At the moment I am waiting for some feedback from @cgilles, to know if that solution works for him. Let's keep the conversation there, and if there is something missing I would be happy to adapt the PR.

piponazo commented 5 years ago

@cgilles This should be fixed in the branch 0.27. I'll close this issue now. Please, let us know if you have any problem.

By the way, @clanmills told me that you were not very happy with the library name change. I'll deal also with this issue (#498)

cgilles commented 5 years ago

Next week i will rebuild the whole digiKam AppImage bundles including last code from Exiv2 from git/master and if problems appear, i will report. Gilles Caulier

Le sam. 27 oct. 2018 à 15:03, Luis Díaz Más notifications@github.com a écrit :

@cgilles https://github.com/cgilles This should be fixed in the branch 0.27. I'll close this issue now. Please, let us know if you have any problem.

By the way, @clanmills https://github.com/clanmills told me that you were not very happy with the library name change. I'll deal also with this issue (#498 https://github.com/Exiv2/exiv2/issues/498)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Exiv2/exiv2/issues/473#issuecomment-433618480, or mute the thread https://github.com/notifications/unsubscribe-auth/ACd9eOpNXuD3Ury7iMNlWctgdHCbEm_1ks5upFmXgaJpZM4XWwPu .