I am working with a pyramided tiff file. However, OpenCV
does not support pyramided tiff files and so I am attempting to use libtiff 4.0.3
to extract the layer/directory/resolution that I need and then pass it to OpenCV
for processing.
I include as follows:
#include "tiffio.h"
#include "opencv2/highgui/highgui.hpp"
But doing so gives me the following in types_c.h
:
typedef int64_t int64;
Typedef redefinition with different types ('int64_t(aka 'long long') vs 'long')
It appears int64_t is being defined differently by each of the 2 libraries.
I have used homebrew
to install both libraries and so I'd prefer not to have to edit those libraries since that will cause problems with getting updates, being a pain for future developers on my team, etc.
Is there a way I can use both libraries without modifiying them?
Since both libraries "polute" global namespace with definitions (and you see, how important is to have proper namespaces in third party libraries) there is no way to include both to the global namespace. You have include one of them wrapped in an user defined namespace like this:
namespace libtiff {
#include "tiffio.h"
}
#include "opencv2/highgui/highgui.hpp"
That will solve compilation issue although I am not sure if this solution is convenient for use, as you will have to use libtiff members using libtif:: prefix,
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With