5 Replies Latest reply on Jun 3, 2014 12:46 PM by CBikram

    LNK2091 error for OCIObjectGetAttr and OCIObjectSetAttr

    CBikram

      Hello all,

       

      I have a small Windows x64 Console program statically linked to oci.lib (12.1.0.1.0) which was working well so far until I tried to use the APIs OCIObjectGetAttr/OCIObjectSetAttr. Now my program gives the following Linker errors:

      Error19error LNK2019: unresolved external symbol "int __cdecl OCIObjectSetAttr(struct OCIEnv *,struct OCIError *,void *,void *,struct OCIType *,unsigned char const * *,unsigned int const *,unsigned int,unsigned int const *,unsigned int,short,void const *,void const *)" (?OCIObjectSetAttr@@YAHPEAUOCIEnv@@PEAUOCIError@@PEAX2PEAUOCIType@@PEAPEBEPEBII5IFPEBX6@Z) referenced in function "bool __cdecl dump_object(struct OCIEnv *,struct OCIError *,struct OCISvcCtx *,void *,void *,void *)" (?dump_object@@YA_NPEAUOCIEnv@@PEAUOCIError@@PEAUOCISvcCtx@@PEAX33@Z)
      Error20error LNK2019: unresolved external symbol "int __cdecl OCIObjectGetAttr(struct OCIEnv *,struct OCIError *,void *,void *,struct OCIType *,unsigned char const * *,unsigned int const *,unsigned int,unsigned int const *,unsigned int,short *,void * *,void * *,struct OCIType * *)" (?OCIObjectGetAttr@@YAHPEAUOCIEnv@@PEAUOCIError@@PEAX2PEAUOCIType@@PEAPEBEPEBII5IPEAFPEAPEAX7PEAPEAU3@@Z) referenced in function "bool __cdecl dump_object(struct OCIEnv *,struct OCIError *,struct OCISvcCtx *,void *,void *,void *)" (?dump_object@@YA_NPEAUOCIEnv@@PEAUOCIError@@PEAUOCISvcCtx@@PEAX33@Z)

       

      Commenting only those two APIs fixes the linker error. I made sure that nothing in project is changed apart from adding the two OCIObjectGetAttr and OCIObjectSetAttr API calls. Other OCIObject* APIs are linking. dumpbin /exports oci.lib shows that OCIObjectGetAttr and OCIObjectSetAttr are exported from the oci.lib.

       

      What am I missing?

       

      Stuck with this for quite a while. Google/Community search hasn't helped either.

       

      Please help.

       

      Thanks in advance,

      Bikram