i686-w64-mingw32-g++: error: localtime.o: No such file or directory
|Status:||Closed||Start date:||09 Aug 2015|
|Assignee:||Robin Mills||% Done:|
|Category:||build||Estimated time:||1.00 hour|
I tried to cross-compile Exiv2 using the MinGW-w64 compiler (
--host=i686-w64-mingw32), with static libraries disabled (
But building failed with:
libtool: link: i686-w64-mingw32-g++ -o ../bin/.libs/exiv2 exiv2.o actions.o utils.o localtime.o ./.libs/libexiv2.dll.a -lpsapi -lwldap32 -lws2_32 -L/usr/local/lib i686-w64-mingw32-g++: error: localtime.o: No such file or directory
Apparently that's because
localtime.c was compiled with libtool, unlike the other *.o files that are needed for the exiv2 executable.
localtime.c must be compiled with libtool, because it's part of the library.
The attached two patches seems to fix it. Hopefully they don't break anything else. :)
#3 Updated by Robin Mills almost 3 years ago
- Status changed from Assigned to Resolved
- % Done changed from 0 to 100
- Estimated time changed from 3.00 to 1.00
Thanks for reporting this and providing the patches. I've submitted EXIVCSRC-no-localtime.diff (with a little change) r3984. I prefer the libtool magic build - feels safer to let him perform his weird magic.
This localtime thing is magic at its worst. Something very wrong with the library standardisation process that this ugly little thing is needed (and ditto for src/getopt_win32.c with I believe is only used by Visual Studio).
Our build server (http://exiv2.dyndns.org:8080) has successfully built and run on test suite with your change on Mac/Linux/MinGW/Cygwin (all 64 bit builds by default). I confess that I never cross-compile Exiv2. Perhaps you could perform that build and let me know if you encounter an issue. http://exiv2.dyndns.org:8080/job/Exiv2-trunk/2182/
I'm optimistically going to set the status to 100% Resolved.