CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2005
    Posts
    33

    Exclamation How to make library files

    Hello friends,


    I have an application in which i will have to convert all the classes into lib files. I don't have any idea regd this. Can someone give me an idea how to make lib files.

    thanks in advance,
    varsha

  2. #2
    Join Date
    Jan 2004
    Location
    Bangalore
    Posts
    53

    Re: How to make library files

    Hi,
    I am assuming that, you are writing your program using vc++.

    Open Visual C++

    Select File->new->Project

    Select Win32 static library under project tab.

    You will be provided with a cpp file.
    In that CPP file write your function which you want to create as a lib file.

    Include that cpp file in your calling program, copy lib file locally or give path in the calling program's project setting-> link->object/library modules.

  3. #3
    Join Date
    Jan 2002
    Location
    Scaro, UK
    Posts
    5,940

    Re: How to make library files

    Actually you can do this :

    (1) Open the exe/dll project.
    (2) Right click top node in solution explorer/file view and go new/project/Win32 project/static library.
    (3) A new library project will be created and added to your workspace/solution.
    (4) Go to exe/dll project, right click and dependencies...
    (5) Check the box for your new library.

    There you go ! You'll have to create a .h with all your exported classes in your library project and #include it into your executable but everything should be fine from that point onwards.

    You can then share your library with other executables by right clicking on their solutions in solution explorer and going add/existing project. Then set the check box in their dependencies.

    Darwen.
    www.pinvoker.com - PInvoker - the .NET PInvoke Interface Exporter for C++ Dlls.

  4. #4
    Join Date
    Oct 2002
    Location
    Timisoara, Romania
    Posts
    14,360

    Re: How to make library files

    Quote Originally Posted by varsha5in
    I have an application in which i will have to convert all the classes into lib files. I don't have any idea regd this. Can someone give me an idea how to make lib files.

    thanks in advance,
    varsha
    What kind of classes? Are they MFC based or not? Did you read that article I was talking about?
    Marius Bancila
    Home Page
    My CodeGuru articles

    I do not offer technical support via PM or e-mail. Please use vbBulletin codes.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured