cygwin下构建时找不到头文件
我试图在 cygwin (OpenEXR) 下构建某个库,但出现以下错误:
b44ExpLogTable.cpp:52:18: error: half.h: No such file or directory
使用 #include
引用了 half.h
,实际上是我之前成功运行 make/make install
的另一个库的一部分。
问题是 - 当将 #include
与 <>
一起使用时,预处理器期望在哪里找到指定的文件?
(我刚刚在 /usr/local/include/OpenEXR
中找到它,但我不知道为什么预处理器不能)。
更新:我还发现:
Makefile
ILMBASE_CXXFLAGS = -I/usr/local/include/OpenEXR
Makefile.am
INCLUDES = @ILMBASE_CXXFLAGS@ \
-I$(top_builddir) \
-I$(top_srcdir)/config
这实际上降低了我对问题可能是什么的理解。
更新2:因此,通过重新定义makefile中的一些变量,我发现make似乎运行的是$(CXX) $(CXXFLAGS),而不是
,其中 $(CXXCOMPILE)
CXXFLAGS
只是 -g -O2
。好吧,我不知道如果这个组合没有在 makefile 中的任何地方使用,除了 $(CXXCOMPILE)
之外,它如何设法运行 $(CXX) $(CXXFLAGS)
没有运行。我可以将我的 -I
添加到 CXXFLAGS
但我感觉还需要添加更多内容,所以我更愿意找到问题的根本原因。
(我不确定这是超级用户问题还是堆栈溢出问题,因为我在 C++/Linux 方面的开发技能几乎不存在。)
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.)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
其他包含目录通常在 CPPFLAGS 中指定。尝试运行
./configure CPPFLAGS=-I/usr/local/include/OpenEXR
并重新运行make
。Additional include directories are usually specified in
CPPFLAGS
. Try running./configure CPPFLAGS=-I/usr/local/include/OpenEXR
and re-runningmake
.您需要以某种方式将
-I/usr/local/include/OpenEXR
添加到编译器命令行中。这可能是一个简单的事情:You need to somehow get
-I/usr/local/include/OpenEXR
added to the compiler command line. That might be a simple matter of doing: