Linking error LNK2001 - "__declspec(dllimport) private: void __thiscall std::basic_string<char,struc

Discussion in 'C++' started by sharmadeep1980@gmail.com, Jul 7, 2006.

  1. Guest

    Hi All,

    I am facing a very unique problem while compling my project in
    "Release" build.
    The project is building in DEBUG mode but giving linking error on
    Release build.
    Here is the error:
    Creating library Release/fnimqcmd.lib and object
    Release/fnimqcmd.exp
    CoIMQCmd.obj : error LNK2001: unresolved external symbol
    "__declspec(dllimport) private: void __thiscall
    std::basic_string<char,struct std::char_traits<char>,class
    std::allocator<char> >::_Tidy(unsigned short)"
    (__imp_?_Tidy@?$basic_string@DU?$char_
    traits@D@std@@V?$allocator@D@2@@std@@AAEXG@Z)
    CoIMQCmd.obj : error LNK2001: unresolved external symbol
    "__declspec(dllimport) private: unsigned short __thiscall
    std::basic_string<char,struct std::char_traits<char>,class
    std::allocator<char> >::_Grow(unsigned int,unsigned short)"
    (__imp_?_Grow@?
    $basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAEGIG@Z)
    Release/fnimqcmd.dll : fatal error LNK1120: 2 unresolved externals
    Error executing link.exe.

    My project is a MFC extension DLL using "Use MFC in shared DLL". I
    started running into this problem when I have used STL::vector in my
    project. Somehow I feel that this is the cause of the problem but not
    able to locate the reasons.

    Furthermore, I am able to compile the project in "Debug"
    confiiguration. In "Release" configuration if we turn off the
    optimization i.e project settings->Optimization-> Disable(Debug) we are
    able to link it successfully.

    Following are some more project settings under C/C++ tab->Code
    generation:-

    Processor->Blend*
    Use run-time library-> Multithreaded DLL(/MD)
    Calling Conventions -> __cdecl*

    My product build is being stucked due to this project so an early
    response would be highly appreciated.

    Thanks in advance.

    Regards
    Deepak
    , Jul 7, 2006
    #1
    1. Advertising

  2. wrote:
    > Hi All,
    >
    > I am facing a very unique problem while compling my project in
    > "Release" build.
    > The project is building in DEBUG mode but giving linking error on
    > Release build.
    > Here is the error:
    > Creating library Release/fnimqcmd.lib and object
    > Release/fnimqcmd.exp
    > CoIMQCmd.obj : error LNK2001: unresolved external symbol
    > "__declspec(dllimport) private: void __thiscall
    > std::basic_string<char,struct std::char_traits<char>,class
    > std::allocator<char> >::_Tidy(unsigned short)"
    > (__imp_?_Tidy@?$basic_string@DU?$char_
    > traits@D@std@@V?$allocator@D@2@@std@@AAEXG@Z)
    > CoIMQCmd.obj : error LNK2001: unresolved external symbol
    > "__declspec(dllimport) private: unsigned short __thiscall
    > std::basic_string<char,struct std::char_traits<char>,class
    > std::allocator<char> >::_Grow(unsigned int,unsigned short)"
    > (__imp_?_Grow@?
    > $basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAEGIG@Z)
    > Release/fnimqcmd.dll : fatal error LNK1120: 2 unresolved externals
    > Error executing link.exe.
    >
    > My project is a MFC extension DLL using "Use MFC in shared DLL". I
    > started running into this problem when I have used STL::vector in my
    > project. Somehow I feel that this is the cause of the problem but not
    > able to locate the reasons.
    >
    > Furthermore, I am able to compile the project in "Debug"
    > confiiguration. In "Release" configuration if we turn off the
    > optimization i.e project settings->Optimization-> Disable(Debug) we are
    > able to link it successfully.
    >
    > Following are some more project settings under C/C++ tab->Code
    > generation:-
    >
    > Processor->Blend*
    > Use run-time library-> Multithreaded DLL(/MD)
    > Calling Conventions -> __cdecl*
    >
    > My product build is being stucked due to this project so an early
    > response would be highly appreciated.
    >
    > Thanks in advance.
    >
    > Regards
    > Deepak


    Hi Deepak, this is not an MFC Group. You can get better answers in

    microsoft.public.vc.mfc (you have already posted)

    how ever, settings for debug mode and release mode are different.

    you would have added a .lib to link in the settings in debug mode.

    add the same .lib file in the settings of release mode (in the link
    tab).

    Plz do not post queries regarding OS, IDEs issues.

    -- Murali Krishna
    Murali Krishna, Jul 7, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    3
    Views:
    408
    Ben Bacarisse
    Feb 11, 2006
  2. Replies:
    1
    Views:
    511
    Ivan Vecerina
    Feb 11, 2006
  3. eberesche
    Replies:
    5
    Views:
    492
    eberesche
    Sep 24, 2006
  4. 2005
    Replies:
    2
    Views:
    436
    Salt_Peter
    Oct 25, 2006
  5. ahong
    Replies:
    0
    Views:
    1,200
    ahong
    Apr 2, 2009
Loading...

Share This Page