CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2009
    Posts
    6

    Linking error LNK2019 while building DLL

    Hi,

    I am working on one C++ DLL. That dll is internally using some statically build common.lib. When I am building the DLL, I am getting following linking errors:

    Creating library Release Standard Heap/paecustomactions.lib and object Release Standard Heap/paecustomactions.exp
    common.lib(properocommon.obj) : error LNK2019: unresolved external symbol __imp__mymalloc referenced in function _MIDL_user_allocate@4
    common.lib(properocommon.obj) : error LNK2019: unresolved external symbol __imp__myrealloc referenced in function "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl PROPERO::FormatStringA(char const *,...)" (?FormatStringA@PROPERO@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PBDZZ)
    common.lib(hcheapfix.obj) : error LNK2019: unresolved external symbol __imp__myfree_cond referenced in function _myfree
    common.lib(sysconfig.obj) : error LNK2019: unresolved external symbol __imp__mycalloc referenced in function "public: __thiscall PROPERO::Runnable::Runnable(int,int,unsigned short const *)" (??0Runnable@PROPERO@@QAE@HHPBG@Z)
    common.lib(stackTrace32.obj) : error LNK2001: unresolved external symbol __imp__mycalloc
    ../bin/i386/release/paecustomactions.dll : fatal error LNK1120: 4 unresolved externals

    Can you please guide me to solve this issue?

    Thanks in advance

  2. #2
    Join Date
    Feb 2009
    Location
    India
    Posts
    444

    Re: Linking error LNK2019 while building DLL

    I'm assuming you have a common.h file.
    Try including this file as extern "C".

    Code:
    extern "C"
    {
        #include "common.h"
    }
    «_Superman
    I love work. It gives me something to do between weekends.

    Microsoft MVP (Visual C++)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured