openexr icon indicating copy to clipboard operation
openexr copied to clipboard

ImfHeader.h:22:10: fatal error: ImathVec.h: No such file or directory

Open sboehmann opened this issue 3 years ago • 4 comments

I am trying to update from 2.5.6 to 3.0.4. OpenEXR 3.0.4 builds, but my application no longer does. The error is:

.../include/OpenEXR/ImfHeader.h:22:10: fatal error: ImathVec.h: No such file or directory
   22 | #include "ImathVec.h"
      |          ^~~~~~~~~~~~

The reason is that I don't have <prefix>/include/OpenEXR and <prefix>/include/Imath in my include paths, only <prefix>/include.

sboehmann avatar Jun 06 '21 20:06 sboehmann

Imath provides both <prefix>/include/ and <prefix>/include/Imath as include directories, so it should be able to see the header

simogasp avatar Jun 17 '22 20:06 simogasp

Yes, the fully qualified #include <Project/header.h> is always preferred in any context, IMHO.

lgritz avatar Jun 18 '22 00:06 lgritz

Is this ever going to be fixed? Including without the Imath/ prefix does not work with VS2022 and vcpkg manifest mode. I have to fix up the header files whenever they are refreshed. If there's a better way or a way to include the Imath into the project's include directories I'd love to know. I've tried relative paths etc. but no luck.

ianmasters avatar Jul 23 '23 00:07 ianmasters

Per @lgritz's comment, a PR implementing this change would be welcome.

meshula avatar Jul 23 '23 01:07 meshula