Results 1 to 6 of 6

Thread: How to make .lib

  1. #1

    Thread Starter
    Ya ya Baby!!!Me is Back
    Join Date
    Jul 2002
    Posts
    362

    How to make .lib

    I have done a search but I never saw in any post how to make a .lib. How can I do it?

    And to use it I have read that I need something with #pragma, is that right?

  2. #2

    Thread Starter
    Ya ya Baby!!!Me is Back
    Join Date
    Jul 2002
    Posts
    362
    humm is this so hard?

  3. #3
    Fanatic Member MoMad's Avatar
    Join Date
    Oct 2000
    Location
    Seattle, WA
    Posts
    625
    No
    probably no one here paying attention.

    Do this:

    MSVC 6 or 7:

    File > New > Static Library

    Then make all your code (classes, functions, bla)... and then compile it, thats all (Batch Build All should build you both debug and release libs... just use the release )

    Also, i would just make a little console app to test it and once it works, just put that into the static library workspace
    :MoMad:
    Nice Sig!

    http://go.to/momad/ Status: Not Ready

  4. #4

    Thread Starter
    Ya ya Baby!!!Me is Back
    Join Date
    Jul 2002
    Posts
    362
    cool
    thank you

  5. #5
    Fanatic Member MoMad's Avatar
    Join Date
    Oct 2000
    Location
    Seattle, WA
    Posts
    625

    Re: How to make .lib

    Originally posted by Daok
    And to use it I have read that I need something with #pragma, is that right?
    You can either add the lib to the project by clicking on Project > Settings > Link > "Object Library Modules" and typing it in the textbox "bla.lib"

    or put this line in your main ".h" file:

    PHP Code:

    #pragma comment(lib, "thelibrary.lib") 
    just change thelibrary to whatever your lib is called, also if you want to have two different versions of your lib (debug and compile), just rename the debug one to "bla"d.lib so that they dont have the same name, and then do this:

    PHP Code:

    #if !defined(_DEBUG)
      // release version
      #pragma comment(lib, "thelibrary.lib")
    #else
      // debug version
      #pragma comment(lib, "thelibraryd.lib")
    #endif 
    Peace!
    :MoMad:
    Nice Sig!

    http://go.to/momad/ Status: Not Ready

  6. #6

    Thread Starter
    Ya ya Baby!!!Me is Back
    Join Date
    Jul 2002
    Posts
    362
    Very cool, tk you

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