Thread: Linker warning LNK4006

  1. #1
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001

    Linker warning LNK4006

    I keep getting this when compiling two of my static libs.

    d3d9.lib(d3d9.dll) : warning LNK4006: __NULL_IMPORT_DESCRIPTOR already defined in d3dx9.lib(d3dx9_35.dll); second definition ignored
    d3d9.lib(d3d9.dll) : warning LNK4221: no public symbols found; archive member will be inaccessible

    Visual C++ Concepts: Building a C/C++ Program
    Linker Tools Warning LNK4006

    Error Message
    symbol already defined in object; second definition ignored

    The given symbol, displayed in its decorated form, was multiply defined. When this warning is encountered, symbol will be added twice, but only its first form will be used.

    You can get this warning if you try to merge two import libs into one.

    If you are rebuilding the C run-time library, you can ignore this message.

    To fix by using the following possible solutions
    The given symbol may be a packaged function, created by compiling with /Gy. This symbol was included in more than one file but was changed between compilations. Recompile all files that include the symbol.

    The given symbol may have been defined differently in two member objects in different libraries.

    An absolute may have been defined twice, with a different value in each definition.

    If the error message is received when combining libraries, symbol already exists in the library being added to.
    I cannot for the life of me figure out how to rid myself of this warning or if it is a red flag that could indicate future problems with my libs.

  2. #2
    Registered User
    Join Date
    Oct 2001
    Just a guess: are you linking to your libraries more than once?

  3. #3
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    >> ... when compiling two of my static libs
    You don't need to add any dependencies when creating a static library. If your library uses d3d9.lib, then let the build of the EXE/DLL link it in.


  4. #4
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Ok will do. Thanks.

  5. #5

    Join Date
    May 2005
    Did that fix it?
    I'm not immature, I'm refined in the opposite direction.

  6. #6
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    I'm having XP problems at the moment so I cannot test this out. The moment I get this all fixed I'll sync my project and try it.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 10
    Last Post: 07-10-2008, 03:45 PM
  2. <Gulp>
    By kryptkat in forum Windows Programming
    Replies: 7
    Last Post: 01-14-2006, 01:03 PM
  3. Dikumud
    By maxorator in forum C++ Programming
    Replies: 1
    Last Post: 10-01-2005, 06:39 AM
  4. DLL compiling question
    By Noose in forum Windows Programming
    Replies: 2
    Last Post: 12-16-2004, 07:16 AM
  5. Interface Question
    By smog890 in forum C Programming
    Replies: 11
    Last Post: 06-03-2002, 05:06 PM