RE: Problem building an application over SFL
"Colestock, Robert" <[email protected]>
| Newsgroups | gmane.ietf.sfl |
|---|---|
| Message-ID | <[email protected]> |
Gianluca: I apologize ahead of time for what we had to implement here in order to provide SNACC exported classes. The problem you suffer is in how the certain class definitions MUST be EXPORTED from a DLL, but IMPORTED to an application. Unfortunately this problem has become multi-dimensional since the SNACC compiler itself exports definitions, as well as the libCert DLL (and soon the ACL library). In your case, this problem is easily solved, but you must understand the subtle use of these defines. If you look carefully at the DEFINES for the libCertDLL application, you will find the following: LIBCERTDLL_EXPORTS,VDASNACCDLL_API_EXPORTS which in turn define "dllexport" declarations for all classes to be exported. These same include files default the declaration to "dllimport". In your case, you must have one or more of the defintions defined for export OR defined to be ""; THEY MUST BE DEFINED IN THE APPLICATION AS "dllimport" (which basically means the declarations must be removed from the compiler command line in your application). These defines are all you need to remove from your project; be careful to RE-BUILD ALL after changing, the compiler is not too smart about such changes related to remote include files (those included by other include files). The new manual defines this obscure use of defines briefly. There are several project definitions in the SFL that define the declarations as "" for static linking (not DLL linking as is the default for our test utilities). These static definitions are used for applications that wish to make use of the static link features (minimizes DLLs). Bob Colestock VDA. -----Original Message----- From: Gianluca Ramunno [mailto:[email protected]] Sent: Wednesday, June 28, 2000 9:36 AM To: [email protected] Subject: R: Problem building an application over SFL Also, using the same .lib and .dll I compiled CertificateBuilder and AutoHi and both work well. Thank's again Gianluca > -----Messaggio originale----- > Da: > Inviato: 28 June 2000 16:34 > A: '[email protected]' > Oggetto: Problem building an application over SFL > > > Hi all, > I'm trying to build (VC++) a very simple command-line > application which > does (or should do ...) following operations: > > * login & sign > * login & verify > > There is no problem for the login. It works well (verified by > means of debug) > using CSM_AppLogin class (using Free3 CTIL & Crypto++ 3.1). > The problem is signing. When I try to insert instructions > into C++ code for instancing > CSM_MsgToSign class (static instance defining a class > variable or dynamic instance > using a pointer and 'new' keyword), the linker return to me a > lot of errors > > I can't understand what is wrong!!! > I would appreciate any help!!! > Thank's > Gianluca Ramunno > > > ******************************************* > code causing errors: > > CSM_MsgToSign *m_pESSignMsg; //this definition is in a > header file (escmd.h) > CSM_Buffer *p; > p= new CSM_Buffer(DATA_TO_BE_SIGNED_FILENAME); > m_pESSignMsg= (CSM_MsgToSign *) new CSM_MsgToSign(p); > > or > > CSM_MsgToSign m_ESSignMsg; > > > *********************** > Some info about building > > * Win32 Console application (escmd.exe), Debug Multithread > * from header file (escmd.h): > #include "sm_api.h" > #include "sm_AppLogin.h" > * I copied all SFL libraries (.lib and .dll) in a directory > under root dir of my project (setting this > libraries in linker options) > * I set include path in compiler options to all SmimeR1.6 > include directories > > *********************** > Linker error > > > --------------------Configuration: escmd - Win32 > Debug-------------------- > Compiling... > escmd.cpp > Linking... > libCertDLLd.lib(libCertDLLd.dll) : error LNK2005: "public: > virtual __thiscall CSM_OID::~CSM_OID(void)" > (??1CSM_OID@@UAE@XZ) already defined in escmd.obj > msvcirtd.lib(MSVCIRTD.dll) : error LNK2005: "public: class > ostream & __thiscall ostream::operator<<(char const *)" > (??6ostream@@QAEAAV0@PBD@Z) already defined in > libcimtd.lib(ostream.obj) > msvcirtd.lib(MSVCIRTD.dll) : error LNK2005: "public: class > ostream & __thiscall ostream::flush(void)" > (?flush@ostream@@QAEAAV1@XZ) already defined in > libcimtd.lib(ostream.obj) > LINK : warning LNK4049: locally defined symbol "_free" imported > LINK : warning LNK4049: locally defined symbol "_calloc" imported > LINK : warning LNK4049: locally defined symbol "_abort" imported > LINK : warning LNK4049: locally defined symbol "_sprintf" imported > libsmutild.lib(sm_cms.obj) : error LNK2001: unresolved > external symbol __imp__longjmp > libsmutild.lib(sm_ess.obj) : error LNK2001: unresolved > external symbol __imp__longjmp > libsmutild.lib(sm_Attr.obj) : error LNK2001: unresolved > external symbol __imp__strdup > libsmutild.lib(sm_MsgSignerInfo.obj) : error LNK2001: > unresolved external symbol __imp__strdup > OLDNAMES.lib(strdup.obi) : error LNK2001: unresolved external > symbol __imp__strdup > OLDNAMES.lib(strdup.obi) : error LNK2001: unresolved external > symbol __imp___strdup > lib/escmd.exe : fatal error LNK1120: 3 unresolved externals > Error executing link.exe. >