config.h must be installed
|Assignee:||Andreas Huggel||% Done:|
Just today I started programming using the library. Before I started, I
naturally built and installed the library.
To cut a really long story short, when I tried to build a program including
exif.hpp, it did not work. g++ spat out heaps of errors and then gave up.
However, when your Makefile built the program in the first place, it was fine.
After some investigation, it became clear that types.hpp, included by
exif.hpp, calls up a "config.h" in the root of where the exiv .tar.gz was
unpacked and ./configure'd. (In my case, /home/daniel/Incoming/exiv).
It also requires "HAVE_CONFIG_H" to be defined to even include the file. If
you do not include the file, then g++ dies with lots of errors (mostly syntax
Basically: the library relies on this config.h, but it is not installed with
the rest of the library header files.
(Reported by Daniel Foote)
To fix this, I copied config.h to /usr/local/include, renamed it to
"exivconfig.h", and modified types.hpp to always include this file. This saves
the need to compile my program with -DHAVE_CONFIG_H, and, allows it to compile
For you to reproduce the output of g++, simply try to compile one of your
utilities. Change into the "src" directory, and then type:
g++ -I. -lexiv2 -o metacopy metacopy.cpp
And it will momentarily die. To "fix" it temporarily change the line to:
g++ -I. -I.. -lexiv2 -DHAVE_CONFIG_H -o metacopy metacopy.cpp
Like I say, I've hacked my install up so that it works and I can get on
writing my program. But I thought you would like to know about this.
(Workaround by Daniel Foote)
#2 Updated by Andreas Huggel almost 14 years ago
In addition, defines should have a library specific prefix, like e.g., EXV_HAVE_CONFIG_H