Anyony encountered this kind of problem??

John Emmas
2006-07-28
2013-04-29
  • John Emmas
    John Emmas
    2006-07-28

    I haven't built my AAF libs & DLL's for about 2 -3 months but I tried building today (Windows SDK) and I got a whole host of linker errors like these:-

    afxcwd.lib(afxmem.obj) : error LNK2005: "void * __cdecl operator new(unsigned int)" (??2@YAPAXI@Z) already defined in Impl.lib(ImplAAFContext.obj)
    uafxcwd.lib(afxmem.obj) : warning LNK4006: "void * __cdecl operator new(unsigned int)" (??2@YAPAXI@Z) already defined in Impl.lib(ImplAAFContext.obj); second definition ignored
       Creating library ../../Debug/RefImpl/CPPCOAPI.lib and object ../../Debug/RefImpl/CPPCOAPI.exp
    LINK : warning LNK4049: locally defined symbol ""void * __cdecl operator new(unsigned int,int,char const *,int)" (??2@YAPAXIHPBDH@Z)" imported
    Impl.lib(ImplAAFPluginManager.obj) : error LNK2001: unresolved external symbol _AAFFindLibrary
    Impl.lib(ImplAAFObject.obj) : error LNK2001: unresolved external symbol __imp___free_dbg
    Impl.lib(ImplAAFObject.obj) : error LNK2001: unresolved external symbol __imp___malloc_dbg
    Impl.lib(ImplAAFPluginFile.obj) : error LNK2001: unresolved external symbol _AAFFindSymbol
    Impl.lib(ImplAAFPluginFile.obj) : error LNK2001: unresolved external symbol _AAFLoadLibrary
    Impl.lib(ImplAAFPluginFile.obj) : error LNK2001: unresolved external symbol _AAFUnloadLibrary
    uafxcwd.lib(afxmem.obj) : error LNK2001: unresolved external symbol __free_dbg
    uafxcwd.lib(afxmem.obj) : error LNK2001: unresolved external symbol __malloc_dbg
    uafxcwd.lib(afxmem.obj) : error LNK2001: unresolved external symbol __CrtSetAllocHook
    uafxcwd.lib(afxmem.obj) : error LNK2001: unresolved external symbol __CrtSetDbgFlag

    I'm pretty certain I haven't touched any AAF code for at least 6 months so I can't understand why it won't link any more. Everything seems to compile okay. The above erros are from my Debug build. My Release build reports the same unresolved external symbols but it doesn't report those first problems about 'operator new'. Has anyone else ever encountered a problem like this?

     
    • John Emmas
      John Emmas
      2006-07-29

      Just a thought.... after a good night's sleep I decided to turn off precompiled headers and do a full rebuild on the MakeSDK branch. I now get the following errors which are identical in both Debug and Release builds....

      Impl.lib(ImplAAFPluginManager.obj) : error LNK2001: unresolved external symbol _AAFFindLibrary
      Impl.lib(ImplAAFPluginFile.obj) : error LNK2001: unresolved external symbol _AAFFindSymbol
      Impl.lib(ImplAAFPluginFile.obj) : error LNK2001: unresolved external symbol _AAFLoadLibrary
      Impl.lib(ImplAAFPluginFile.obj) : error LNK2001: unresolved external symbol _AAFUnloadLibrary
      uafxcw.lib(appcore.obj) : error LNK2001: unresolved external symbol ___wargv
      uafxcw.lib(appcore.obj) : error LNK2001: unresolved external symbol ___argc

      I'm a bit worried about the last 2 errors but the first 4 seem fixable. I assume that I might have a DEF file that's out of date. Can somebody let me know if those missing symbols (AAFFindLibrary, AAFFindSymbol, AAFLoadLibrary and AAFUnloadLibrary) are supposed to be declared in one of the DEF files (e.g. AAFCOM.DEF or AAFPluginCom.def) ?

      The missing symbols don't appear in any of my DEF files so I assume that something is out of date at my end. Thanks in advance.

       
      • John Emmas
        John Emmas
        2006-07-29

        Having opened up my various DSP project files (Visual Studio 6.0) and having removed anything that contains the dreaded letters "afx" I'm now left with the following 4 unresolved externals in both Debug & Release builds:-

        Impl.lib(ImplAAFPluginManager.obj) : error LNK2001: unresolved external symbol _AAFFindLibrary
        Impl.lib(ImplAAFPluginFile.obj) : error LNK2001: unresolved external symbol _AAFFindSymbol
        Impl.lib(ImplAAFPluginFile.obj) : error LNK2001: unresolved external symbol _AAFLoadLibrary
        Impl.lib(ImplAAFPluginFile.obj) : error LNK2001: unresolved external symbol _AAFUnloadLibrary

        Can anyone suggest a possible reason why my linker can't find these symbols? I'm struggling a bit with these last four.

         
    • Tim Bingham
      Tim Bingham
      2006-07-31

      On Windows the file ref-impl/aaflib/aaflibwin32.cpp must be a member of both the AAFLIB and Impl projects.

      Tim.

       
      • John Emmas
        John Emmas
        2006-08-01

        Thanks for the help Tim. As it happened, that file was included in both branches but you pointed me in the right direction.... I looked at a backup copy and noticed that the very first line in the file was #include "aaflib.h". Somehow, that line had got removed during my last CVS update. This meant that OS_WINDOWS wasn't defined at the time that the file was compiled. Therefore the entire contents of aaflibwin32.cpp were never being compiled!!

        I've replaced the #include and everything works fine now. Thanks again.