Thread: about static link

  1. #1
    Registered User
    Join Date
    May 2006

    about static link

    Hello everyone,

    I am using Visual Studio 2003. If I build a static library (.lib), how can I input dependent .dll (other dynamic link libraries) and .lib (other static link libraries)?

    Currently, from project Property Page, there is no "linker" item, which allows us to provide dependent input .dll and .lib files when we use to build regular exe or dll project.

    Could any help please?

    thanks in advance,

  2. #2
    Registered User
    Join Date
    Aug 2005
    You are building a static library and a library cannot have any dependancies. ( because a static library is not linked, it's just a collection of object files ).
    If you want to use that library you have to link to any other libraries or dlls that your lib uses as well.
    Last edited by ZuK; 06-13-2006 at 11:55 AM.

  3. #3
    Registered User
    Join Date
    Aug 2005
    I suppose you could use pragmas to force the compiler to link with other libraries when the static library is finally linked with the application program. See MSDN for the comment pragma.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 23
    Last Post: 07-09-2007, 04:49 AM
  2. Static functions.... why?
    By patricio2626 in forum C++ Programming
    Replies: 4
    Last Post: 04-02-2007, 08:06 PM
  3. Problem with a file parser.
    By Hulag in forum C++ Programming
    Replies: 7
    Last Post: 03-17-2005, 09:54 AM
  4. Undefined Structure in Link List
    By _Cl0wn_ in forum C Programming
    Replies: 1
    Last Post: 03-22-2003, 05:57 PM
  5. Undefined Error
    By peking1983 in forum C++ Programming
    Replies: 1
    Last Post: 03-11-2003, 03:55 PM