如何解决OpenImageDenoise - 在 C++ 中使用预编译头时架构 x86_64 的未定义符号
我正在尝试在我的项目中使用 odin 库 (https://github.com/OpenImageDenoise/oidn/),但无法成功链接它。当我包含库并使用文档中的示例代码时,我的 IDE 不会标记任何错误。但是,在尝试使用 cmake 编译它时,出现以下错误:
Undefined symbols for architecture x86_64:
"_oidnCommitDevice",referenced from:
data_denoise(std::__1::vector<float,std::__1::allocator<float> >&) in main.cpp.o
"_oidnCommitFilter",std::__1::allocator<float> >&) in main.cpp.o
"_oidnExecuteFilter",std::__1::allocator<float> >&) in main.cpp.o
"_oidnGetDeviceError",std::__1::allocator<float> >&) in main.cpp.o
"_oidnNewDevice",std::__1::allocator<float> >&) in main.cpp.o
_main in main.cpp.o
"_oidnNewFilter",std::__1::allocator<float> >&) in main.cpp.o
"_oidnReleaseDevice",std::__1::allocator<float> >&) in main.cpp.o
_main in main.cpp.o
"_oidnReleaseFilter",std::__1::allocator<float> >&) in main.cpp.o
"_oidnSetSharedFilterImage",std::__1::allocator<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)
我不确定是否需要在 cmake 文件中链接库,因为文档中没有与此相关的内容。
解决方法
解决了!我只需要将 dylib 链接到 cmake。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。