views:

45

answers:

2

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.)

A: 

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
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
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
@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
A: 

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

Jack Kelly