Bug #3390

libharu not found (mingw, cmake)

Added by Michael Shestero almost 8 years ago. Updated almost 8 years ago.

Target version:
Start date:
Due date:
% Done:


Estimated time:


I compiled and install libharu-libharu-ec89be4 into d:\libharu

When I cmake-gui to compilee Wt I see:

libharu libraries not found - set HARU_PREFIX
** Disabling PDF support (WPdfImage, WPdfRenderer): requires libharu.
   Indicate the location of your haru library using -DHARU_PREFIX=...

But I indeed set HARU_PREFIX to d:/libharu.

It even set HARU_LIB_RELEASE (libhpdfs.a) automatically.

Note: there are only libhpdfs.a and libhpdf.dll.a but no libhpdfsd.a file in d:\libharu\lib\. There are no other files(!) (such as libharu*) - is it normal?

I actually don't need debug. I tried to copy libhpdfs.a to libhpdfsd.a to fake it, but there was no effect.


Updated by Wim Dumon almost 8 years ago

  • Status changed from New to Feedback

The easiest work-around is probably to edit cmake/WtFindHaru.txt so that it only requires libhpdfs.a. With MSVS, it's important to link debug builds to debug builds of the library, that's why we require both release and debug builds of dependency libraries on Windows. I don't know if mingw has the same requirement.




Updated by Michael Shestero almost 8 years ago

I removed in cmake/WtFindHaru.txt libharu and changed libhpdf to libhpdfs.

Yet my cmake continued report that libharu isn't found.

I discovered this caused by the HARU_SUPPORT_LIBS_FOUND variable, that seems to check m(?), PNG and ZLib libraries.

When I removed "AND HARU_SUPPORT_LIBS_FOUND" from cmake/WtFindHaru.txt, the libharu was "found" by cmake configuration process.

But I've got compilation error:

[  0%] Building CXX object src/CMakeFiles/wt.dir/Wt/WPdfImage.obj
In file included from D:\var\wt-3.3.3\src\Wt\WPdfImage.C:13:0:
D:/var/wt-3.3.3/src/Wt/WPdfImage:17:18: fatal error: hpdf.h: No such file or dir
compilation terminated.
src\CMakeFiles\wt.dir\build.make:7549: recipe for target 'src/CMakeFiles/wt.dir/
Wt/WPdfImage.obj' failed

What is my next steps?

The hpdf.h is in d:\libharu\include directory. How to specify this directory?

Note that HARU_PREFIX is set.

PS I expect next trouble with linker.


Updated by Wim Dumon almost 8 years ago

If you look in CMakeCache.txt in your build directory, does it contain HARU_INCLUDE_DIR? Is it set correctly?




Updated by Michael Shestero almost 8 years ago

Upd: sorry, I just discovered my HARU_INCLUDE_DIR was set to lib mistakenly. Now I'm trying again...


Updated by Michael Shestero almost 8 years ago


I built it.

Note that I had to edit cmake/WtFindHaru.txt to do it.

Also available in: Atom PDF