How to create a library in C++

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • curiously enough
    New Member
    • Aug 2008
    • 79

    #1

    How to create a library in C++

    How do I create my own library in C++?
  • Banfa
    Recognized Expert Expert
    • Feb 2006
    • 9067

    #2
    That depends entirely on the platform you are using.

    Comment

    • weaknessforcats
      Recognized Expert Expert
      • Mar 2007
      • 9214

      #3
      In the case of Windows where you might be using Visual Studio.NET, you create a WIN32 project and whenthe wizard appears, select Application Settings. In that dialog, check static library. Then click Finish.

      Your project build result will be a .lib file.

      Comment

      • curiously enough
        New Member
        • Aug 2008
        • 79

        #4
        Originally posted by weaknessforcats
        In the case of Windows where you might be using Visual Studio.NET, you create a WIN32 project and whenthe wizard appears, select Application Settings. In that dialog, check static library. Then click Finish.

        Your project build result will be a .lib file.
        I'm sorry, I haven't a clue what you're talking about. All I want is to create a library in C++ V5.02. If you know how can you explain it step by step?
        And I am using windows.

        Comment

        • Banfa
          Recognized Expert Expert
          • Feb 2006
          • 9067

          #5
          Do you mean Visual C++ v5.02 ? (Or may be Borland C++ v5.02). There are no google hits on Microsoft C++ V5.02.

          In the case of Visual C++ it is as weaknessforcats stated, when you create a project you need to look for the "static library" project type, then you will create a project that produces a library (.lib)

          If you are using the command line then there is a switch to the linker that instructs it to create a library (.lib) rather than an executable, for your version I believe you should be using either the command lines
          link32 -lib <arguments>

          or
          lib32 <arguments>

          Since Visual Studio 2005 this has become
          lib <arguments>

          Comment

          Working...