3

我正在尝试用 cygwin 编译 OpenEXR,但我遇到了麻烦。

到目前为止我所做的:

cd ilmbase-X.X.X
./configure
make
make install
make check

我需要这个,因为它是 OpenEXR 需要它。它运行正常,并在 /usr/local 中创建了三个文件夹bininclude\OpenEXRlib.

然后我继续 OpenEXR,这就是我所做的:

cd openexr-X.X.X
./configure

一切运行正常,但是当我这样做make时,出现以下错误:

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

虽然我不知道为什么会发生这种情况,但我可以通过这样做来解决它:

./configure CPPFLAGS=-I/usr/local/include/OpenEXR

但是,当我遇到make另一个错误时,我被困在这里:

/usr/local/include/OpenEXR/half.h:511: undefined reference to `half::_toFloat'
/usr/local/include/OpenEXR/half.h:511: undefined reference to `half::_toFloat'
/usr/local/include/OpenEXR/half.h:481: undefined reference to `half::_eLut'
/usr/local/include/OpenEXR/half.h:511: undefined reference to `half::_toFloat'
/usr/local/include/OpenEXR/half.h:511: undefined reference to `half::_toFloat'
/usr/local/include/OpenEXR/half.h:481: undefined reference to `half::_eLut'
/usr/local/include/OpenEXR/half.h:499: undefined reference to `half::convert(int)'
/usr/local/include/OpenEXR/half.h:481: undefined reference to `half::_eLut'
/usr/local/include/OpenEXR/half.h:499: undefined reference to `half::convert(int)'
/usr/local/include/OpenEXR/half.h:499: undefined reference to `half::convert(int)'
collect2: ld returned 1 exit status
<builtin>: recipe for target `b44ExpLogTable' failed
make[1]: *** [b44ExpLogTable] Error 1
make[1]: Leaving directory `/home/Andre/openexr-1.6.1/IlmImf'
Makefile:313: recipe for target `all-recursive' failed
make: *** [all-recursive] Error 1

这会发生在任何人身上吗?我已经用谷歌搜索了很多,但找不到解决方案。我希望有人能帮帮忙。

4

1 回答 1

6

我知道这有点旧,但它帮助我弄清楚了-I开关。

一旦我明白了,我想出了你问题的答案。您提供的是包含文件,而不是库本身,因此undefined reference. 采用:

./configure CPPFLAGS="-I/usr/local/include/OpenEXR -L/usr/local/bin -lHalf-6"

-L提供库搜索目录,同时-l提供链接到程序的库。-lHalf-6表示文件/usr/local/bin/cygHalf-6.dll

我无法告诉你为什么图书馆在它所在的位置,但它就是。

您可能还会遇到 memset 的另一个问题,此处已解决:http: //lists.gnu.org/archive/html/openexr-user/2011-07/msg00002.html

于 2012-03-14T05:58:44.387 回答