Thread: How do I insert a library in MVC++?

  1. #1
    Registered User FearOfTheDark's Avatar
    Join Date
    Jan 2003
    Posts
    31

    How do I insert a library in MVC++?

    How do I insert a library in MVC++?

    A verry trivial question, but the program is new to me...
    -We're living in a illusion!
    -Ok, if that's what you think!

  2. #2
    I lurk
    Join Date
    Aug 2002
    Posts
    1,361
    What do you mean? Static library? Dynamic library? ... Header file?

  3. #3
    mustang benny bennyandthejets's Avatar
    Join Date
    Jul 2002
    Posts
    1,401
    if the library is in the current working directory of your program, ie, for the debug build, with your source files, or for the release build, with your executable, you can use the #pragma command to load it up. For more information on that, do a search for libraries on this board or search my previous posts for one in a thread about libraries.

    However, I don't like to do it that way because then you have to have a copy of the library in every folder that uses it. For MSVC++, you can add the static library (.lib) in project settings in the link tab. The .lib should be in the Micorsoft Visual Studio\vc98\lib directory, and it's equivalent dynamic library(.dll) should be in a system directory, such as windows\system32.

    Most common windows .dlls have a .lib provided by MSVC++ already.

    So, to add the Common Controls dll to your project, which is necessary for tree views, progress bars, etc, add comctl32.lib to the link section of project settings, include its header (commctrl.h), and away you go.
    [email protected]
    Microsoft Visual Studio .NET 2003 Enterprise Architect
    Windows XP Pro

    Code Tags
    Programming FAQ
    Tutorials

  4. #4
    Registered User
    Join Date
    Sep 2002
    Posts
    1,640
    Code:
    #pragma comment(lib,"yourlib.lib")

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. What's an import library?
    By chiefmonkey in forum C++ Programming
    Replies: 1
    Last Post: 06-19-2009, 05:00 PM
  2. Property Set Library (PSL) - Announcement
    By vultur_gryphus in forum Projects and Job Recruitment
    Replies: 0
    Last Post: 05-29-2008, 06:04 AM
  3. Makefile for a library
    By sirmoreno in forum Linux Programming
    Replies: 5
    Last Post: 06-04-2006, 04:52 AM
  4. very weird .h problem
    By royuco77 in forum C++ Programming
    Replies: 1
    Last Post: 09-11-2005, 07:55 AM
  5. better c string functions
    By samps005 in forum C Programming
    Replies: 8
    Last Post: 11-04-2003, 01:28 PM