0

我在将值分配给包含 OpenEXR 定义的半类型的 Imf::Rgba 结构时遇到问题。似乎存在与从浮点数转换为半数有关的链接器错误。

Linking CXX executable graphics-env
Undefined symbols for architecture x86_64:
  "half::_eLut", referenced from:
      half::half(float) in main.cpp.o
  "half::convert(int)", referenced from:
      half::half(float) in main.cpp.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [graphics-env] Error 1
make[1]: *** [CMakeFiles/graphics-env.dir/all] Error 2
make: *** [all] Error 2

我相信这是 Windows 上的常见问题,需要定义 OPENEXR_DLL。但是,当我在 OS X 上编译时,这不起作用。我尝试链接到 libIlmImf.dylib 和 libIlmImf.a,结果相同。使用的 OpenEXR 版本是 2.2.0,使用 Homebrew 安装。

4

1 回答 1

2

这些符号定义half.hIlmBase.

您应该链接到libHalf.dylib.

于 2015-05-10T16:44:44.350 回答