about static link

This is a discussion on about static link within the C++ Programming forums, part of the General Programming Boards category; Hello everyone, I am using Visual Studio 2003. If I build a static library (.lib), how can I input dependent ...

  1. #1
    Registered User
    Join Date
    May 2006
    Posts
    1,579

    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,
    George

  2. #2
    ZuK
    ZuK is offline
    Registered User
    Join Date
    Aug 2005
    Location
    Austria
    Posts
    1,990
    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.
    Kurt
    Last edited by ZuK; 06-13-2006 at 11:55 AM.

  3. #3
    Registered User
    Join Date
    Aug 2005
    Posts
    1,267
    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, 08:54 AM
  4. Undefined Structure in Link List
    By _Cl0wn_ in forum C Programming
    Replies: 1
    Last Post: 03-22-2003, 04:57 PM
  5. Undefined Error
    By peking1983 in forum C++ Programming
    Replies: 1
    Last Post: 03-11-2003, 02:55 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21