0

I am a newbie to Open Cascade.After building occt-7.3.0-vc14-64 with cmake with no error, i added inc/ in Include Directories and added win64/vc14/libd/ in Library Directories, then added only "include" in main.cpp. But after clicked debug button, i got link error as following:

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)

What else should have be done? Thanks for any help.

Trick
  • 23
  • 5
  • Possible duplicate of [What is an undefined reference/unresolved external symbol error and how do I fix it?](https://stackoverflow.com/questions/12573816/what-is-an-undefined-reference-unresolved-external-symbol-error-and-how-do-i-fix) – Passer By Nov 20 '18 at 03:10

1 Answers1

2

This error is that can't find lib that contain Standard_OutOfMemory.

Standard_OutOfMemory is a class in TKernel.dll, you should add TKernel.lib to project's Additional Dependencies, like on the image below:

enter image description here

J-Alex
  • 6,881
  • 10
  • 46
  • 64
Ryan Zhou
  • 78
  • 8
  • Thanks, it works.BTW, how to find out that Standard_OutOfMemory is a class in TKernel.dll? – Trick Feb 20 '19 at 08:15
  • Just search this class by name under source code folder, or it is very easy to search via visual studio – Ryan Zhou Feb 25 '19 at 14:26