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", referenced from:
data_denoise(std::__1::vector<float, std::__1::allocator<float> >&) in main.cpp.o
"_oidnExecuteFilter", referenced from:
data_denoise(std::__1::vector<float, std::__1::allocator<float> >&) in main.cpp.o
"_oidnGetDeviceError", referenced from:
data_denoise(std::__1::vector<float, std::__1::allocator<float> >&) in main.cpp.o
"_oidnNewDevice", referenced from:
data_denoise(std::__1::vector<float, std::__1::allocator<float> >&) in main.cpp.o
_main in main.cpp.o
"_oidnNewFilter", referenced from:
data_denoise(std::__1::vector<float, std::__1::allocator<float> >&) in main.cpp.o
"_oidnReleaseDevice", referenced from:
data_denoise(std::__1::vector<float, std::__1::allocator<float> >&) in main.cpp.o
_main in main.cpp.o
"_oidnReleaseFilter", referenced from:
data_denoise(std::__1::vector<float, std::__1::allocator<float> >&) in main.cpp.o
"_oidnSetSharedFilterImage", referenced from:
data_denoise(std::__1::vector<float, 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联系起来。

最新更新