Thread: How to work with a .LIB in C++ (IDE:Visual Studio 6)

  1. #1
    Registered User
    Join Date
    Jul 2005
    Posts
    45

    Exclamation How to work with a .LIB in C++ (IDE:Visual Studio 6)

    Hi all, I'm again here to ask help or informations!
    I have to create a wrapper for a .lib using Visual Studio 6.
    I have to do this cause the source of the lib use templates and Visual Studio 6 isn't able to manage them, and I can't use another IDE.

    Here the questions:
    1) I have the library created in Visual studio 2005, I haven't documentation about it, so what can I do?
    2) How can I create a wrapper in C++ for it using Visual Studio 6? (the most important passes)
    3) If I'll find the source, I have to read/study it to be able to create the wrapper?
    4) In my C++ wrapper, I have to create methods that have the same names of the methods library?
    i.e.:
    in the library I have: GetImages(int x, int y);
    if i want to use this method in my C++ wrapper, have to call: .....->GetImages(x,y);

    but HOW can I use the library??

    For example I open the project properties and in the "Linking" tab (or where??) I have to add: mylib.lib!
    We assume that in this .lib I have a method called: isFlat();

    What do I have to write in my .cpp file to use that method??

  2. #2
    Officially An Architect brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,396
    Quote Originally Posted by Arkanos View Post
    What do I have to write in my .cpp file to use that method??
    You have to #include the appropriate header file(s) for the library. If you don't have the header files, the library is useless.

    And as far as I know, VC++ 6.0 can handle templates, but the support is out of date and possibly buggy.

  3. #3
    semi-colon generator ChaosEngine's Avatar
    Join Date
    Sep 2005
    Location
    Chch, NZ
    Posts
    597
    you're going to have to post some code examples. templates are generally just included as source, you can't really "wrap" them in a lib (unless you instantiate every template you'll need and wrap that, which kinda defeats the purpose of having a template in the first place)
    "I saw a sign that said 'Drink Canada Dry', so I started"
    -- Brendan Behan

    Free Compiler: Visual C++ 2005 Express
    If you program in C++, you need Boost. You should also know how to use the Standard Library (STL). Want to make games? After reading this, I don't like WxWidgets anymore. Want to add some scripting to your App?

  4. #4
    Registered User
    Join Date
    Jul 2005
    Posts
    45
    I asked a wrong question, sorry!!
    I have the source of .lib (now) but Visual Studio 6 can't manage it, because it has some problems to work with some templates.
    I have to create a wrapper for that .lib, so both will be included in another project and can be used by the users.
    Is it possible? How?
    Last edited by Arkanos; 03-30-2007 at 12:15 PM.

  5. #5
    Registered User
    Join Date
    Jul 2005
    Posts
    45
    Some hints??

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. problem
    By ExDHaos in forum C++ Programming
    Replies: 12
    Last Post: 05-22-2009, 04:50 AM
  2. load gif into program
    By willc0de4food in forum Windows Programming
    Replies: 14
    Last Post: 01-11-2006, 10:43 AM
  3. One error left! Plz help, me=noob
    By rrum in forum C++ Programming
    Replies: 7
    Last Post: 12-01-2005, 01:09 AM
  4. Need Help On a Simple Bank Program
    By oobootsy1 in forum C# Programming
    Replies: 9
    Last Post: 08-08-2005, 10:51 AM
  5. Learning OpenGL
    By HQSneaker in forum C++ Programming
    Replies: 7
    Last Post: 08-06-2004, 08:57 AM