0

I am trying to build a certain library under cygwin (OpenEXR), and I get the following error:

b44ExpLogTable.cpp:52:18: error: half.h: No such file or directory

half.h is referenced using #include <half.h>, and is actually a part of another library I successfully run make/make install on previously.

The question is -- when using #include with <>, where the preprocessor expects to find the specified file?

(I have just found it in /usr/local/include/OpenEXR, but I have no idea why preprocessor cannot).

Update: I have also found:

Makefile

ILMBASE_CXXFLAGS = -I/usr/local/include/OpenEXR

Makefile.am

INCLUDES = @ILMBASE_CXXFLAGS@ \
       -I$(top_builddir)  \
       -I$(top_srcdir)/config

This actually decreased my understanding of what the problem may be.

Update 2: So, by redefining some variables in makefile I found out that instead of $(CXXCOMPILE) make seems to run $(CXX) $(CXXFLAGS), with CXXFLAGS being just -g -O2. Ok, I have no idea how it manages to run $(CXX) $(CXXFLAGS) if this combination in not used anywhere in the makefile except in $(CXXCOMPILE) which is not run. I can add my -I to CXXFLAGS but I have a feeling that a lot more additions will be required, so I would prefer to find a root cause of the problem.

(I am not sure whether it is a Super User or Stack Overflow question, because my developer skills in C++/Linux are almost non-existent.)

Andrey Shchekin
  • 21,101
  • 19
  • 94
  • 162

2 Answers2

1

Additional include directories are usually specified in CPPFLAGS. Try running ./configure CPPFLAGS=-I/usr/local/include/OpenEXR and re-running make.

Jack Kelly
  • 18,264
  • 2
  • 56
  • 81
  • If this is insufficient (more errors are encountered), see this thread: [http://stackoverflow.com/users/1268131/kai-ninomiya](http://stackoverflow.com/users/1268131/kai-ninomiya) – Brad T. Feb 07 '14 at 21:52
0

You need to somehow get -I/usr/local/include/OpenEXR added to the compiler command line. That might be a simple matter of doing:

CFLAGS=-I/usr/local/include/OpenEXR make
caf
  • 233,326
  • 40
  • 323
  • 462
  • Just tried this (and also CPPFLAGS and CXXFLAGS since it seems to be a cpp), but it didn't work -- produces exactly the same error. – Andrey Shchekin Sep 05 '10 at 09:40
  • Just noticed make shows actual command: `g++ -g -O2 b44ExpLogTable.cpp -o b44ExpLogTable`. Not sure if -I should be here as well, but it isn't. – Andrey Shchekin Sep 05 '10 at 09:41
  • @Andrey Shchekin: Yes, that's where you need the `-I` option(s) to appear. Exactly how to do that depends on how the specific project's Makefile works. – caf Sep 05 '10 at 10:09