CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 9 of 9
  1. #1
    Join Date
    Sep 2003
    Posts
    280

    Warning about /NODEFAULTLIB:library

    Hello,everybody:
    I build program,and and show one warning:
    Linking...
    LINK : warning LNK4098: defaultlib "LIBCMT" conflicts with use of other libs; use /NODEFAULTLIB:library
    What does the warning mean??
    Waht 's effect to program???
    Thanks!

  2. #2
    Join Date
    Jan 2004
    Posts
    29
    This may help explain it - at the bottom of the page it talks about what to do if there is a library conflict

    http://support.microsoft.com/default...b;EN-US;186907

  3. #3
    Join Date
    Sep 2003
    Posts
    280
    Quote Originally Posted by JonnoA
    This may help explain it - at the bottom of the page it talks about what to do if there is a library conflict

    http://support.microsoft.com/default...b;EN-US;186907
    Aftering modifying the setting:
    --------------------Configuration: Simple Player - Win32 Release--------------------
    Linking...
    MAIN.OBJ : error LNK2001: unresolved external symbol __beginthread
    MAIN.OBJ : error LNK2001: unresolved external symbol __endthread
    Release/Simple Player.exe : fatal error LNK1120: 2 unresolved externals
    Error executing link.exe.
    What 's happen??
    Thanks!

  4. #4
    Join Date
    May 2000
    Location
    KY, USA
    Posts
    18,652

  5. #5
    Join Date
    Sep 2002
    Location
    Maryland - Fear The Turtle!
    Posts
    7,537
    Quote Originally Posted by Cooker
    Aftering modifying the setting:
    --------------------Configuration: Simple Player - Win32 Release--------------------
    Linking...
    MAIN.OBJ : error LNK2001: unresolved external symbol __beginthread
    MAIN.OBJ : error LNK2001: unresolved external symbol __endthread
    Release/Simple Player.exe : fatal error LNK1120: 2 unresolved externals
    Error executing link.exe.
    What 's happen??
    Thanks!
    Check your settings in the project->settings->general-> using mfc (pick static or shared) change it to one if it is not set and you are using MFC.

  6. #6
    Join Date
    Sep 2003
    Posts
    280
    Quote Originally Posted by Mick
    Check your settings in the project->settings->general-> using mfc (pick static or shared) change it to one if it is not set and you are using MFC.
    The whole project is attached.
    Could someone help me to check???
    Thanks a lot!
    Attached Files Attached Files

  7. #7
    Join Date
    Sep 2002
    Location
    Maryland - Fear The Turtle!
    Posts
    7,537
    remove the ignore library: LIBCMT

    project->settings->link->input.

  8. #8
    Join Date
    Sep 2003
    Posts
    280

    Re: Warning about /NODEFAULTLIB:library

    Quote Originally Posted by JonnoA
    This may help explain it - at the bottom of the page it talks about what to do if there is a library conflict

    http://support.microsoft.com/default...b;EN-US;186907
    If I do that, I get two errors in link time:
    MAIN.OBJ : error LNK2001: unresolved external symbol __beginthread
    MAIN.OBJ : error LNK2001: unresolved external symbol __endthread
    What shall I do?
    Thanks!
    Attached Files Attached Files
    Last edited by Cooker; October 18th, 2004 at 04:09 AM.

  9. #9
    Join Date
    Sep 2002
    Location
    Maryland - Fear The Turtle!
    Posts
    7,537

    Re: Warning about /NODEFAULTLIB:library

    You are mixing CRT's. The debug version of the CRT starts with 'debug' in the IDE


    named wise it will contain a d

    msvcrt.lib
    msvcrtd.lib etc.

    Project settings->c++->code generation->[use runtime library]

    for you debug build either:

    debug multithreaded
    debug multithreaded dll

    for your release build either:

    multithreaded
    multithreaded dll

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