Ocaf MFC Wizard

Hi, everyone, I am new to OpenCASCADE. I try to use its MFC Wizard to create a new application. Without any further actions, just compile and link, I get the following errors. Could you tell me what is the problem? Many thanks.

--------------------Configuration: First - Win32 Debug--------------------
Linking...
Creating library Debug/First.lib and object Debug/First.exp
LINK : warning LNK4098: defaultlib "MSVCRTD" conflicts with use of other libs; use /NODEFAULTLIB:library
First.obj : error LNK2001: unresolved external symbol "public: __thiscall TDF_Transaction::TDF_Transaction(class TCollection_AsciiString const &)" (??0TDF_Transaction@@QAE@ABVTCollection_AsciiString@@@Z)
FirstDoc.obj : error LNK2001: unresolved external symbol "public: __thiscall TDF_Transaction::TDF_Transaction(class TCollection_AsciiString const &)" (??0TDF_Transaction@@QAE@ABVTCollection_AsciiString@@@Z)
FirstView.obj : error LNK2001: unresolved external symbol "public: __thiscall TDF_Transaction::TDF_Transaction(class TCollection_AsciiString const &)" (??0TDF_Transaction@@QAE@ABVTCollection_AsciiString@@@Z)
FirstDoc.obj : error LNK2001: unresolved external symbol "public: __thiscall Handle_TDocStd_Document::~Handle_TDocStd_Document(void)" (??1Handle_TDocStd_Document@@QAE@XZ)
FirstView.obj : error LNK2001: unresolved external symbol "public: __thiscall Handle_TDocStd_Document::~Handle_TDocStd_Document(void)" (??1Handle_TDocStd_Document@@QAE@XZ)
FirstDoc.obj : error LNK2001: unresolved external symbol "public: void __thiscall TDocStd_Application::Close(class Handle_TDocStd_Document const &)" (?Close@TDocStd_Application@@QAEXABVHandle_TDocStd_Document@@@Z)
FirstDoc.obj : error LNK2001: unresolved external symbol "public: enum CDF_StoreStatus __thiscall TDocStd_Application::SaveAs(class Handle_TDocStd_Document const &,class TCollection_ExtendedString const &)" (?SaveAs@TDocStd_Application@@QAE?AW4CDF_S
toreStatus@@ABVHandle_TDocStd_Document@@ABVTCollection_ExtendedString@@@Z)
FirstDoc.obj : error LNK2001: unresolved external symbol "public: enum CDF_RetrievableStatus __thiscall TDocStd_Application::Open(class TCollection_ExtendedString const &,class Handle_TDocStd_Document &)" (?Open@TDocStd_Application@@QAE?AW4CDF_Retri
evableStatus@@ABVTCollection_ExtendedString@@AAVHandle_TDocStd_Document@@@Z)
FirstView.obj : error LNK2001: unresolved external symbol "public: unsigned int __thiscall TDF_Label::FindAttribute(class Standard_GUID const &,class Handle_TDF_Attribute &)const " (?FindAttribute@TDF_Label@@QBEIABVStandard_GUID@@AAVHandle_TDF_Attri
bute@@@Z)
FirstView.obj : error LNK2001: unresolved external symbol "public: __thiscall Handle_TDF_Data::~Handle_TDF_Data(void)" (??1Handle_TDF_Data@@QAE@XZ)
FirstView.obj : error LNK2001: unresolved external symbol "public: class Handle_TDF_Data __thiscall TDocStd_Document::GetData(void)const " (?GetData@TDocStd_Document@@QBE?AVHandle_TDF_Data@@XZ)
FirstView.obj : error LNK2001: unresolved external symbol "public: __thiscall TDF_Label::TDF_Label(void)" (??0TDF_Label@@QAE@XZ)
FirstView.obj : error LNK2001: unresolved external symbol "private: __thiscall TDF_Label::TDF_Label(class TDF_LabelNode * const &)" (??0TDF_Label@@AAE@ABQAVTDF_LabelNode@@@Z)
OcafApplication.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall TDocStd_Application::InitDocument(class Handle_TDocStd_Document const &)const " (?InitDocument@TDocStd_Application@@UBEXABVHandle_TDocStd_Document@@@Z)
OcafApplication.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall TDocStd_Application::NewDocument(class TCollection_ExtendedString const &,class Handle_TDocStd_Document &)" (?NewDocument@TDocStd_Application@@UAEXABVTC
ollection_ExtendedString@@AAVHandle_TDocStd_Document@@@Z)
OcafApplication.obj : error LNK2001: unresolved external symbol "public: virtual class Handle_Resource_Manager __thiscall TDocStd_Application::Resources(void)" (?Resources@TDocStd_Application@@UAE?AVHandle_Resource_Manager@@XZ)
OcafApplication.obj : error LNK2001: unresolved external symbol "public: virtual __thiscall TDocStd_Application::~TDocStd_Application(void)" (??1TDocStd_Application@@UAE@XZ)
OcafApplication.obj : error LNK2001: unresolved external symbol "class Handle_Standard_Type & __cdecl TDocStd_Application_Type_(void)" (?TDocStd_Application_Type_@@YAAAVHandle_Standard_Type@@XZ)
OcafApplication.obj : error LNK2001: unresolved external symbol "public: virtual unsigned int __thiscall TDocStd_Application::IsKind(class Handle_Standard_Type const &)const " (?IsKind@TDocStd_Application@@UBEIABVHandle_Standard_Type@@@Z)
OcafApplication.obj : error LNK2001: unresolved external symbol "public: __thiscall Handle_TDocStd_Application::~Handle_TDocStd_Application(void)" (??1Handle_TDocStd_Application@@QAE@XZ)
OcafApplication.obj : error LNK2001: unresolved external symbol "protected: __thiscall TDocStd_Application::TDocStd_Application(void)" (??0TDocStd_Application@@IAE@XZ)
Debug/First.exe : fatal error LNK1120: 18 unresolved externals
Error executing link.exe.

First.exe - 22 error(s), 1 warning(s)

Ntin's picture

This is a common problem.include "TKLCAF.lib" in your LINK library list

shelleycao's picture

hi, in the samples\standard\mfc\10_Ocaf, the Open/Save As for (*.sta) files can not be run properly! It results in crash in windows 2000. what's wrong?
and I build a simple application using MFC wizard, but it can not open&save STA files either.
please help me!
thanks!