Project

General

Profile

Success: sharing the process of compiling the latest Exiv2 on Win7 (MinGW) + linking from Qt

Added by Matteo Penasa about 9 years ago

Hi everyone,

I just joined the forum to share my experience of compiling and installing Exiv2 0.23 and linking from Qt.
I hope it might help someone who is still struggling with it.

First of all, here is the information that was very valuable to me:
Exiv2Wiki, how to install on XYZ platform: http://dev.exiv2.org/projects/exiv2/wiki/How_do_I_build_Exiv2_on_the_XYZ_platform
FragrantMemories, compiling Expat: http://kemovitra.blogspot.in/2009/07/mingw-compiling-expat-201.html
FragrantMemories, compiling ZLib: http://kemovitra.blogspot.in/2009/07/mingw-compiling-expat-201.html

And now, the step-by-step instruction for compiling on MinGW and linking from QtCreator.
Note that this process expands the one explained in the Wiki (link above) in a more detailed manner.
Robin is welcome to integrate these instruction in his blog if he feels like it (I guess this is equivalent to a CC BY-NC license?) :)
0) Install MinGW (C-C++ compilers and the Developer Tools with Core Msys), by default this installs in C:\MinGW and this will be assumed in the following.
1) download the expat library code from http://expat.sourceforge.net/ and unzip to C:\MinGW\msys\1.0\home\<yourusernamehere>
2) download the zlib library code from http://zlib.net/ and unzip to C:\MinGW\msys\1.0\home\<yourusernamehere>
3) download the exiv2 code from http://www.exiv2.org/download.html and unzip to C:\MinGW\msys\1.0\home\<yourusernamehere>

4) launch the MinGW shell and, optionally, set the prompt:
cd ~
PS1="\${PWD}> ";

5) compile and install expat
cd expat-2.1.0
./configure
make
make install
cd ..

6) compile and install zlib
cd zlib-1.2.5
make -f win32/Makefile.gcc
cp -iv zlib1.dll /usr/local/bin
cp -iv zconf.h zlib.h /usr/local/include
cp -iv libz.a libz.dll.a /usr/local/lib
cd ..

7) compile and install exiv2
cd exiv2-0.23
./configure --disable-visibility --with-expat=/usr/local --with-zlib=/usr/local
make
make install
cd ..

8) This will install in /usr/local/{bin,include,lib} = C:\MinGW\msys\1.0\local\{bin,include,lib}
Therefore add C:\MinGW\msys\1.0\local\bin to the "path" environment variable.
Furthermore, you can link accordingly by adding following lines at the end of your .pro file in QtCreator:
win32 {
INCLUDEPATH += $$quote(C:/MinGW/msys/1.0/local/include)
LIBS += $$quote(C:/MinGW/msys/1.0/local/lib/libexpat.dll.a)
LIBS += $$quote(C:/MinGW/msys/1.0/local/lib/libz.dll.a)
LIBS += $$quote(C:/MinGW/msys/1.0/local/lib/libexiv2.dll.a)
}

Hope it helps... for any questions please post a follow-up in the forum.
A big "thank you" to the community for this useful library!
matpen


Replies (4)

RE: Success: sharing the process of compiling the latest Exiv2 on Win7 (MinGW) + linking from Qt - Added by Robin Mills about 9 years ago

Matteo

Thanks very much for posting this information. A couple of years ago I got Qt to link with exiv2 on cygwin and wrote the following document: http://clanmills.com/exiv2/qt.shtml I think you've solved Qt/Ming/Exiv2 which I've never considered.

I'll review your notes and merge your discoveries with mine. For sure, we don't want others to suffer the torture we endured. I very much appreciate your contribution by sharing and documenting this. That's the spirit of open-source. Thank You.

Robin

RE: Success: sharing the process of compiling the latest Exiv2 on Win7 (MinGW) + linking from Qt - Added by Matteo Penasa about 9 years ago

My pleasure, Robin,

I was very glad to be able to give a little bit back to the community by writing this.
In fact, the document you mentioned was a real source of inspiration for me.

But let me correct you: you actually already had good instruction for the combination Qt/MinGW/Exiv2... I just expanded with the step by step procedure, changing some minor details which, I think, depend on the new version of the library.
For Cygwin, I would love to try it out, since is more scriptable and confortable to me. I have some good ideas to test: of course, in case of success, I will post here again!

Keep up the good work!
M

RE: Success: sharing the process of compiling the latest Exiv2 on Win7 (MinGW) + linking from Qt - Added by Robin Mills about 9 years ago

Matteo

I've linked your contribution from the "How do I build ..." FAQ:

http://dev.exiv2.org/projects/exiv2/wiki/How_do_I_build_Exiv2_on_the_XYZ_platform

Thanks for sharing your experience with the community. Much appreciated.

Robin

    (1-4/4)