cygwin下构建时找不到头文件

发布于 2024-09-17 22:25:17 字数 1142 浏览 4 评论 0原文

我试图在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

宁愿没拥抱 2024-09-24 22:25:17

其他包含目录通常在 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-running make.

在巴黎塔顶看东京樱花 2024-09-24 22:25:17

您需要以某种方式将 -I/usr/local/include/OpenEXR 添加到编译器命令行中。这可能是一个简单的事情:

CFLAGS=-I/usr/local/include/OpenEXR make

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
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文