RE: How to link to static libraries
"Colestock, Robert" <[email protected]> Thu, 24 Oct 2002 08:00:10 -0400
| Newsgroups | gmane.ietf.sfl |
|---|---|
| Message-ID | <[email protected]> |
Vlad: Sorry, but all references to any static library must be static in all projects in order to pull this off. (i.e. you should only need to statically compile libCtilMgr and SNACC includes for CML; libCtilMgr and SNACC includes also for the ACL if you leave CML and ACL libs dynamic). You would either have to re-build the CML and ACL with static SNACC references AND/OR make the entire CML and ACL projects static as well. This is not as easy as I had at first thought it would be. These projects have not been kept up-to-date; I am surprised that you were able to successfully build the SFL libs. You are certainly welcome to build new CML and ACL projects, follow the pattern for libCertSTATIC for the internal SNACC API overrides. The unresolved SNACC references are a worry, you are probably linking to an older SNACC binary, not matching the SFL compiled includes. None of these libraries have been tested for release 2.1 (they are not part of the smp.dsw). We do not directly support static links to our libraries. If you REALLY MUST have these libraries, I can talk to John to see if we will continue to support for static libraries. If he approves, I can spend some time to re-build/re-link an application and send you a snapshot of our next release; it will take a couple of weeks. Bob Colestock -----Original Message----- From: Vlad Vetiul [mailto:[email protected]] Sent: Wednesday, October 23, 2002 4:03 AM To: [email protected] Subject: How to link to static libraries Hi All! I tried to build my own DLL using static SFL libraries in MSVS6 (with SP4). I added to project following static libs: smime/smime/lib/libsmdSTATIC.lib smime/smime/lib/libCertSTATIC.lib smime/smime/lib/libCtilMgrSTATIC.lib smime/SMPDist/esnacc/c++/lib/cppasn1_static.lib smime/cml/lib/cmlasnSTATIC.lib and non-static libs: smime/SMPDist/cml/lib/srlapi.lib smime/SMPDist/cml/lib/cmapi.lib ldap/lib/nsldap32v50.lib Linker reports warnings and errors, here some of them: LINK : warning LNK4049: locally defined symbol ""public: virtual __thiscall SNACC::AsnOid::~AsnOid(void)" (??1AsnOid@SNACC@@UAE@XZ)" imported LINK : warning LNK4049: locally defined symbol ""public: class CTIL::CSM_CtilInst * __thiscall CTIL::CSM_CtilMgr::AddLogin(char *,char *)" (?AddLogin@CSM_CtilMgr@CTIL@@QAEPAVCSM_CtilInst@2@PAD0@Z)" imported LINK : warning LNK4049: locally defined symbol ""public: __thiscall SNACC::AsnOid::AsnOid(char const *)" (??0AsnOid@SNACC@@QAE@PBD@Z)" imported LINK : warning LNK4049: locally defined symbol ""public: __thiscall CTIL::CSM_CtilMgr::CSM_CtilMgr(void)" (??0CSM_CtilMgr@CTIL@@QAE@XZ)" imported LINK : warning LNK4049: locally defined symbol ""public: __thiscall CTIL::CSM_CtilMgr::~CSM_CtilMgr(void)" (??1CSM_CtilMgr@CTIL@@QAE@XZ)" imported LINK : warning LNK4049: locally defined symbol ""public: void __thiscall CTIL::CSM_CtilMgr::UseAll(void)" (?UseAll@CSM_CtilMgr@CTIL@@QAEXXZ)" imported ... cmlasnSTATIC.lib(SelectedAttributeTypes.obj) : error LNK2001: unresolved external symbol "public: virtual unsigned int __thiscall SNACC::AsnString::BEnc(class SNACC::AsnBuf &)" (?BEnc@AsnString@SNACC@@UAEIAAVAsnBuf@2@@Z) cmlasnSTATIC.lib(PKIX.obj) : error LNK2001: unresolved external symbol "public: virtual unsigned int __thiscall SNACC::AsnString::BEnc(class SNACC::AsnBuf &)" (?BEnc@AsnString@SNACC@@UAEIAAVAsnBuf@2@@Z) ... libCertSTATIC.lib(sm_GenName.obj) : error LNK2001: unresolved external symbol "public: virtual unsigned int __thiscall SNACC::AsnString::BEnc(class SNACC::AsnBuf &)" (?BEnc@AsnString@SNACC@@UAEIAAVAsnBuf@2@@Z) cmlasnSTATIC.lib(AuthenticationFramework.obj) : error LNK2001: unresolved external symbol "public: virtual unsigned int __thiscall SNACC::AsnString::BEnc(class SNACC::AsnBuf &)" (?BEnc@AsnString@SNACC@@UAEIAAVAsnBuf@2@@Z) cmlasnSTATIC.lib(sdn702.obj) : error LNK2001: unresolved external symbol "public: virtual unsigned int __thiscall SNACC::AsnString::BEnc(class SNACC::AsnBuf &)" (?BEnc@AsnString@SNACC@@UAEIAAVAsnBuf@2@@Z) libsmdSTATIC.lib(sm_cms.obj) : error LNK2001: unresolved external symbol "public: virtual unsigned int __thiscall SNACC::AsnString::BEnc(class SNACC::AsnBuf &)" (?BEnc@AsnString@SNACC@@UAEIAAVAsnBuf@2@@Z) ... cmlasnSTATIC.lib(CM_Certificate.obj) : error LNK2001: unresolved external symbol _CM_FreeCert cmlasnSTATIC.lib(CM_Certificate.obj) : error LNK2001: unresolved external symbol _CMASN_FreePubKeyContents cmlasnSTATIC.lib(CM_Certificate.obj) : error LNK2001: unresolved external symbol _gDSA_KEA_OID cmlasnSTATIC.lib(CM_Certificate.obj) : error LNK2001: unresolved external symbol _gRSA_OID cmlasnSTATIC.lib(CM_Certificate.obj) : error LNK2001: unresolved external symbol _gOIW_DSA ... With LIBCTILMGRDLL_API="",SNACCDLL_API="",VDASNACCDLL_API="",EXPORT_GENSNACC= "",CMLASN_API="" defined these errors don't go away. Can somebody tell me how to build an application with these static libraries used? Thank you. -- DISCLAIMER: Any e-mail messages from the National Bank of Moldova are sent in good faith, but shall not be binding nor construed as constituting any obligation on the part of the Bank. The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. If you received this in error, please contact the sender and delete the material from any computer.