使用 vs2017 的 c++ 中的 OpenCascade link 错误

OpenCascade link error in c++ using vs2017

我是 Open Cascade.After 使用 cmake 构建 occt-7.3.0-vc14-64 的新手,没有错误,我在包含目录中添加了 inc/ 并在库目录中添加了 win64/vc14/libd/ ,然后在 main.cpp 中只添加了 "include"。但是在点击调试按钮后,我得到了 link 如下错误:

Error   LNK2019 unresolved external symbol "public: __cdecl 
Standard_OutOfMemory::Standard_OutOfMemory(char const * const)" (?? 
0Standard_OutOfMemory@@QEAA@QEBD@Z) referenced in function "public: 
void __cdecl Standard_OutOfMemory::`default constructor closure'(void)" 
(??_FStandard_OutOfMemory@@QEAAXXZ)

还应该做什么? 感谢您的帮助。

此错误是找不到包含 Standard_OutOfMemory.

的库

Standard_OutOfMemoryTKernel.dll 中的 class,您应该将 TKernel.lib 添加到项目的 Additional Dependencies,如下图所示: