iCAx开思工具箱

标题: 【求助】关于IID_CATPoint的问题 [打印本页]

作者: ggcua    时间: 2004-9-30 10:35
标题: 【求助】关于IID_CATPoint的问题
用如下语句的时候:
CATPoint* pCATPoint = NULL;  
    if (ListObj && SUCCEEDED(ListObj->QueryInterface(IID_CATPoint, (void**)&pCATPoint)))  
  
出现如下错误:
  
  make: CAAObjectModelerBase.edu\CAAOmbLoadDoc.m intel_a\code\bin\CAAOmbLoadDoc.exe
   Creating library F:\CAASample\.\intel_a\code\bin\CAAOmbLoadDoc.lib and object F:\CAASample\.\intel_a\code\bin\CAAOmbLoadDoc.exp
CAAOmbLoadDoc.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) struct _GUID  IID_CATPoint" (__imp_?IID_CATPoint@@3U_GUID@@A)
F:\CAASample\.\intel_a\code\bin\CAAOmbLoadDoc.exe : fatal error LNK1120: 1 unresolved externals
# make-ERROR: intel_a\code\bin\CAAOmbLoadDoc.exe
  
是不是不能用IID_CATPoint这个const char*呢
作者: acoka    时间: 2004-9-30 11:03
include CATPoint.h
  
imakefile  link with  CATGeometricObjects  
  
identitiyfile +GeometricObjects
  
IID_CATPoint没问题的
作者: ggcua    时间: 2004-9-30 13:12
源文件:
#include "CATSessionServices.h"  
#include "CATDocumentServices.h"     
#include "CATUnicodeString.h"
#include "CATInit.h"        
#include "CATDocument.h"         
#include "CATIContainer.h"
#include "CATPoint.h"
#include <iostream.h>     
  
int main (int argc, char * argv[] )
{  
     char *sessionName = "CAA2_Sample_Session";
   CATSession *pSession = NULL;
   HRESULT rc = ::Create_Session(sessionName,
                               pSession);
   if ((FAILED(rc)) || (NULL == pSession))
   {
     cout << "ERROR in creating session" << endl << flush;
     return 1;
   }
   CATDocument *pDoc = NULL;
   rc = CATDocumentServices::OpenDocument(argv[1],  
                                pDoc);
   if (SUCCEEDED(rc) [$& (NULL != pDoc)) cout << "Document opened OK" << endl << flush]
   else
   {
     return 2;
   }
   CATInit* pInitOnDoc = NULL;
   rc = pDoc->QueryInterface(IID_CATInit,
     (void**) [$pInitOnDoc)]
   if ( FAILED(rc) ) return 3;
  
   CATIContainer *pIRootCont = NULL ;
   
   //call GetRootContainer() to return the root element of the given document
   pIRootCont = (CATIContainer*)pInitOnDoc->GetRootContainer("CATIContainer");
   SEQUENCE(CATBaseUnknown_ptr) ListObj;  
   long NbObj = pIRootCont->ListMembersHere("CATPoint", ListObj);  
   for (int i=0; i < NbObj; i++)  
   {  
     CATPoint* pCATPoint = NULL;  
     if (ListObj && SUCCEEDED(ListObj->QueryInterface(IID_CATPoint, (void**)&pCATPoint)))  
     {   
       pCATPoint->Release();  
       pCATPoint = NULL;  
       ListObj->Release();  
       ListObj = NULL;
     }  
   }  
   rc = CATDocumentServices::Remove (*pDoc);
   if (SUCCEEDED(rc)) cout << "Document removed OK" << endl << flush;
   else
   {
     return 4;
   }
   pDoc = NULL ;
  
   //-------------------
     // Delete session
   //-------------------
  
   rc = ::Delete_Session(sessionName);
   if (SUCCEEDED(rc)) cout << "Session deleted OK" << endl << flush;
   else
   {
     return 5;
   }
      
   return 0;
}
  
IdentityCard.h:
  
// -->Prereq Components Declaration
AddPrereqComponent ("ObjectModelerBase"     , Public);
AddPrereqComponent ("System"                , Public);
AddPrereqComponent ("GeometricObjects"    , Public);
  
Imakefile.mk:
BUILT_OBJECT_TYPE=LOAD MODULE
  
LINK_WITH = CATObjectModelerBase \
             JS0CORBA  
LINK_WITH = CATGeometricObjects \
             JS0CORBA  
  
错误:
  
mkmk-WARNING: CAAObjectModelerBase.edu\CAAOmbLoadDoc.m -> Module [CATCGMGeoMath.m], which is define as an alias, was automatically added in LINK_WITH.
  
  make: CAAObjectModelerBase.edu\CAAOmbLoadDoc.m intel_a\code\bin\CAAOmbLoadDoc.exe
    Creating library F:\CAASample\.\intel_a\code\bin\CAAOmbLoadDoc.lib and object F:\CAASample\.\intel_a\code\bin\CAAOmbLoadDoc.exp
CAAOmbLoadDoc.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) long __cdecl Delete_Session(char *,int,int)" (__imp_?Delete_Session@@YAJPADHH@Z)
CAAOmbLoadDoc.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall _SEQUENCE_CATBaseUnknown_ptr::~_SEQUENCE_CATBaseUnknown_ptr(void)" (__imp_??1_SEQUENCE_CATBaseUnknown_ptr@@UAE@XZ)
CAAOmbLoadDoc.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static long __cdecl CATDocumentServices::Remove(class CATDocument &,short)" (__imp_?Remove@CATDocumentServices@@SAJAAVCATDocument@@F@Z)
CAAOmbLoadDoc.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class CATBaseUnknown * & __thiscall _SEQUENCE_CATBaseUnknown_ptr::operator[](long)" (__imp_??A_SEQUENCE_CATBaseUnknown_ptr@@QAEAAPAVCATBaseUnknown@@J@Z)
CAAOmbLoadDoc.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall _SEQUENCE_CATBaseUnknown_ptr::_SEQUENCE_CATBaseUnknown_ptr(void)" (__imp_??0_SEQUENCE_CATBaseUnknown_ptr@@QAE@XZ)
CAAOmbLoadDoc.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) struct _GUID  IID_CATInit" (__imp_?IID_CATInit@@3U_GUID@@A)
CAAOmbLoadDoc.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static long __cdecl CATDocumentServices::OpenDocument(class CATUnicodeString const &,class CATDocument * &,unsigned char)" (__imp_?OpenDocument@CATDocumentServices@@SAJABVCATUnicodeString@@AAPAVCATDocument@@E@Z)
CAAOmbLoadDoc.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) long __cdecl Create_Session(char *,class CATSession * &)" (__imp_?Create_Session@@YAJPADAAPAVCATSession@@@Z)
F:\CAASample\.\intel_a\code\bin\CAAOmbLoadDoc.exe : fatal error LNK1120: 8 unresolved externals
# make-ERROR: intel_a\code\bin\CAAOmbLoadDoc.exe
作者: ggcua    时间: 2004-9-30 13:29
把Imakefile.mk改成:
  
BUILT_OBJECT_TYPE=LOAD MODULE
  
LINK_WITH = CATObjectModelerBase \ CATGeometricObjects\
            JS0CORBA  
  
编译就成功了,不知道效果如何:
# start step: DataUpdate   at 09/30/2004-13:34:50
# mkmk-ERROR: \ -> This Module was not found in specified Workspace(s).
# mkmk-ERROR: CAAObjectModelerBase.edu\CAAOmbLoadDoc.m -> Module [\] in LINK_WITH is ignored since its type '<BUILT_OBJECT_TYPE not found>' is incompatible with type 'LOAD MODULE'.
# mkmk-WARNING: CAAObjectModelerBase.edu\CAAOmbLoadDoc.m -> Module [CATCGMGeoMath.m], which is define as an alias, was automatically added in LINK_WITH.
# make:  CAAObjectModelerBase.edu\CAAOmbLoadDoc.m\Objects\intel_a\.mkdata.mk
## end   step: DataUpdate   at 09/30/2004-13:34:56
  
make: CAAObjectModelerBase.edu\CAAOmbLoadDoc.m intel_a\code\bin\CAAOmbLoadDoc.exe
作者: acoka    时间: 2004-9-30 13:46
Imakefile.mk:
BUILT_OBJECT_TYPE=LOAD MODULE
  
LINK_WITH = CATObjectModelerBase \
            JS0CORBA
LINK_WITH = CATGeometricObjects \
            JS0CORBA  
  
不要写2个link_with,




欢迎光临 iCAx开思工具箱 (https://t.icax.org/) Powered by Discuz! X3.3