(quick and easy) lib linking question

This is a discussion on (quick and easy) lib linking question within the C++ Programming forums, part of the General Programming Boards category; I want to access some classes/functions that are stored in a lib file. How do I do that? Do I ...

  1. #1
    Registered User
    Join Date
    May 2003
    Posts
    38

    (quick and easy) lib linking question

    I want to access some classes/functions that are stored in a lib file. How do I do that? Do I just set up my project so that it is linked to the lib file (that didn't seem to work)? and then I can just #include any header from that lib file (just like normal). Or are there additional things I need to do before I can access what is in the lib file?
    -chris
    chris

  2. #2
    the Wizard
    Join Date
    Aug 2004
    Posts
    109
    Just linking the lib file to your project, the way differs from compiler to compiler. And then just include the header file yes
    There's nothing more to it
    -//Marc Poulsen -//MipZhaP

    He sat down, he programmed, he got an error...

  3. #3
    Registered User
    Join Date
    May 2003
    Posts
    38
    so if my lib file is called "LibFile.lib" and there is a class in that lib file named "ClassInLib.h" then I would link my project to the lib file, and then just #include "ClassInLib.h" anytime I wanted to use that class correct? I'm asking these reduntant questions because for some reason this simple taskis not working...
    chris

  4. #4
    Teenage Mutant Ninja Nerd MMD_Lynx's Avatar
    Join Date
    Aug 2004
    Posts
    65
    what compiler are you using?
    I only know it for borland...and i think you have to make a project and have all the headers and files in there.
    Stupid people are useful. You can make them do all the mindless tasks you are too lazy to do yourself.

    Sphynx cats are just bald and wrinkly, like old people, and we don't reject them.

  5. #5
    Registered User
    Join Date
    Sep 2004
    Location
    California
    Posts
    3,246
    Just link to the library, include the header file for the library, and use the classes/functions of the lib normally in your project.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. quick easy question
    By Yarin in forum C++ Programming
    Replies: 3
    Last Post: 01-25-2008, 12:58 PM
  2. another quick n easy question
    By david999 in forum C Programming
    Replies: 2
    Last Post: 11-10-2005, 01:59 PM
  3. quick n easy question
    By david999 in forum C Programming
    Replies: 2
    Last Post: 11-10-2005, 12:53 PM
  4. Very quick, easy question
    By Codefish in forum C++ Programming
    Replies: 10
    Last Post: 07-26-2005, 05:45 PM
  5. Quick Easy Question
    By St0rmTroop3er in forum A Brief History of Cprogramming.com
    Replies: 6
    Last Post: 02-24-2004, 12:08 AM

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