
Mon, 01/24/2005 - 07:02
I am interesting with OCC, and download OCC5.2. after download and install it, I can compile and execute the sample, but when I try to compile an simple program:
-----------------------------------------------------
#ifndef _TDocStd_Application_HeaderFile
#include
#endif
#ifndef _TColStd_SequenceOfExtendedString_HeaderFile
#include
#endif
class TOcaf_Application : public TDocStd_Application
{
public:
TOcaf_Application();
virtual ~TOcaf_Application();
virtual void Formats(TColStd_SequenceOfExtendedString& Formats) ;
Standard_CString ResourcesName() ;
};
--------------------------------------------------
#include "TOcaf_Application.h"
#ifndef _TCollection_ExtendedString_HeaderFile
#include
#endif
#ifndef _Standard_CString_HeaderFile
#include
#endif
TOcaf_Application::TOcaf_Application()
{
}
TOcaf_Application::~TOcaf_Application()
{
}
void TOcaf_Application::Formats(TColStd_SequenceOfExtendedString& Formats)
{
Formats.Append(TCollection_ExtendedString ("my-data-frame"));
Formats.Append(TCollection_ExtendedString ("MDTV-Standard"));
}
Standard_CString TOcaf_Application::ResourcesName()
{
return Standard_CString ("Resources====");
}
--------------------------------------------------
#ifndef _TDocStd_Application_HeaderFile
#include
#endif
#ifndef _Handle_TDocStd_Application_HeaderFile
#include
#endif
#ifndef _TDocStd_Document_HeaderFile
#include
#endif
#ifndef _Handle_TDocStd_Document_HeaderFile
#include
#endif
#include "TOcaf_Application.h"
void main ()
{
Handle ( TDocStd_Application ) myApp = new TOcaf_Application();
Handle ( TDocStd_Document ) myDoc;
myApp->NewDocument ( "NewDocumentFormat", myDoc);
}
--------------------------------------------------------------
Compile by VC6 and there are the following errores:
-------------------Configuration: useOCAF - Win32 Debug--------------------
Compiling...
TOcaf_Application.cpp
Linking...
Creating library Debug/useOCAF.lib and object Debug/useOCAF.exp
TOcaf_Application.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
)
TOcaf_Application.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall TDocStd_Application::NewDocument(class TCollection_ExtendedString const &,class Handle_TDocStd_Document &)" (?NewDocument@TDocStd_Application@@UAEXABV
TCollection_ExtendedString@@AAVHandle_TDocStd_Document@@@Z)
TOcaf_Application.obj : error LNK2001: unresolved external symbol "private: virtual void __thiscall CDF_Application::Activate(class Handle_CDM_Document const &,enum CDF_TypeOfActivation)" (?Activate@CDF_Application@@EAEXABVHandle_CDM_Document@@W4CDF
_TypeOfActivation@@@Z)
TOcaf_Application.obj : error LNK2001: unresolved external symbol "private: virtual int __thiscall CDF_Application::DocumentVersion(class Handle_CDM_MetaData const &)" (?DocumentVersion@CDF_Application@@EAEHABVHandle_CDM_MetaData@@@Z)
TOcaf_Application.obj : error LNK2001: unresolved external symbol "private: virtual class Handle_CDM_Document __thiscall CDF_Application::Retrieve(class Handle_CDM_MetaData const &,unsigned int)" (?Retrieve@CDF_Application@@EAE?AVHandle_CDM_Document
@@ABVHandle_CDM_MetaData@@I@Z)
TOcaf_Application.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall CDM_Application::EndOfUpdate(class Handle_CDM_Document const &,unsigned int,class TCollection_ExtendedString const &)" (?EndOfUpdate@CDM_Application@@
UAEXABVHandle_CDM_Document@@IABVTCollection_ExtendedString@@@Z)
TOcaf_Application.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall CDM_Application::BeginOfUpdate(class Handle_CDM_Document const &)" (?BeginOfUpdate@CDM_Application@@UAEXABVHandle_CDM_Document@@@Z)
TOcaf_Application.obj : error LNK2001: unresolved external symbol "public: virtual class Handle_CDM_MessageDriver __thiscall CDM_Application::MessageDriver(void)" (?MessageDriver@CDM_Application@@UAE?AVHandle_CDM_MessageDriver@@XZ)
TOcaf_Application.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)
TOcaf_Application.obj : error LNK2001: unresolved external symbol "private: virtual void __thiscall Standard_Transient::Initialize(void)" (?Initialize@Standard_Transient@@EAEXXZ)
TOcaf_Application.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall Standard_Transient::ShallowDump(class std::basic_ostream
ic_ostream@DU?$char_traits@D@std@@@std@@@Z)
TOcaf_Application.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall Standard_Transient::HashCode(int)const " (?HashCode@Standard_Transient@@UBEHH@Z)
TOcaf_Application.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)
TOcaf_Application.obj : error LNK2001: unresolved external symbol "public: virtual class Handle_Standard_Type const & __thiscall TDocStd_Application::DynamicType(void)const " (?DynamicType@TDocStd_Application@@UBEABVHandle_Standard_Type@@XZ)
TOcaf_Application.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall Standard_Transient::Delete(void)const " (?Delete@Standard_Transient@@UBEXXZ)
TOcaf_Application.obj : error LNK2001: unresolved external symbol "public: virtual class Handle_Standard_Transient __thiscall Standard_Transient::This(void)const " (?This@Standard_Transient@@UBE?AVHandle_Standard_Transient@@XZ)
TOcaf_Application.obj : error LNK2001: unresolved external symbol "protected: __thiscall TDocStd_Application::TDocStd_Application(void)" (??0TDocStd_Application@@IAE@XZ)
TOcaf_Application.obj : error LNK2001: unresolved external symbol "public: virtual __thiscall TDocStd_Application::~TDocStd_Application(void)" (??1TDocStd_Application@@UAE@XZ)
TOcaf_Application.obj : error LNK2001: unresolved external symbol "public: void __thiscall TColStd_SequenceOfExtendedString::Append(class TCollection_ExtendedString const &)" (?Append@TColStd_SequenceOfExtendedString@@QAEXABVTCollection_ExtendedStri
ng@@@Z)
TOcaf_Application.obj : error LNK2001: unresolved external symbol "public: __thiscall TCollection_ExtendedString::TCollection_ExtendedString(char * const)" (??0TCollection_ExtendedString@@QAE@QAD@Z)
useOCAF.obj : error LNK2001: unresolved external symbol "public: __thiscall TCollection_ExtendedString::TCollection_ExtendedString(char * const)" (??0TCollection_ExtendedString@@QAE@QAD@Z)
TOcaf_Application.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) unsigned int MMgt_Opt" (__imp_?MMgt_Opt@@3IA)
useOCAF.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) unsigned int MMgt_Opt" (__imp_?MMgt_Opt@@3IA)
TOcaf_Application.obj : error LNK2001: unresolved external symbol "public: static void * __cdecl Standard::MAllocate(int)" (?MAllocate@Standard@@SAPAXH@Z)
useOCAF.obj : error LNK2001: unresolved external symbol "public: static void * __cdecl Standard::MAllocate(int)" (?MAllocate@Standard@@SAPAXH@Z)
TOcaf_Application.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) void * * theFreeList" (__imp_?theFreeList@@3PAPAXA)
useOCAF.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) void * * theFreeList" (__imp_?theFreeList@@3PAPAXA)
TOcaf_Application.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) int theFreeListSize" (__imp_?theFreeListSize@@3HA)
.......
useOCAF.obj : error LNK2001: unresolved external symbol "public: __thiscall NCollection_IncAllocator::NCollection_IncAllocator(unsigned int)" (??0NCollection_IncAllocator@@QAE@I@Z)
Debug/useOCAF.exe : fatal error LNK1120: 38 unresolved externals
Error executing link.exe.
useOCAF.exe - 52 error(s), 0 warning(s)
-------------------------------------------------
So I need help.
Tue, 01/25/2005 - 15:43
I am no VC wizard, but sounds you forgot to point to some (OCC?) libs for your app to link with. I suggest you have a look at linking instructions of some working OCC app (OCC samples?), cut&paste that to your app, then edit paths for your system.
Hope this helps, Vio
Wed, 01/26/2005 - 05:25
thanks for your help. I'll try it again.