C++ Libraries

Discussion in 'C++' started by Kieran Simpson, Jul 3, 2003.

  1. I have written a set of C++ classes that I would like to compile into a
    library file, that then can be linked into other projects so I can use those
    classes. The only thing is that I am not to sure how make the classes into
    a library, and then how to consequently link them into my other projects.
    Can anybody point me in the right direction please. I want to statically
    link them so that the code is compiled into the app, because I don't want to
    mess with DLL's

    Thanks
    Kieran Simpson, Jul 3, 2003
    #1
    1. Advertising

  2. "Kieran Simpson" <> wrote in message
    news:_2QMa.80$a%...
    > I have written a set of C++ classes that I would like to compile into a
    > library file, that then can be linked into other projects so I can use

    those
    > classes. The only thing is that I am not to sure how make the classes

    into
    > a library, and then how to consequently link them into my other projects.
    > Can anybody point me in the right direction please. I want to statically
    > link them so that the code is compiled into the app, because I don't want

    to
    > mess with DLL's
    >


    Actually this is platform specific.

    I can talk about Windows platform though -
    Write your functions, compile the source files to object files. Then
    instead of linking, use lib.exe to create a library file.

    --
    With best wishes,
    J. Schafer
    Josephine Schafer, Jul 3, 2003
    #2
    1. Advertising

  3. Kieran Simpson

    Dhruv Guest

    On Thu, 03 Jul 2003 16:29:08 +1000, Kieran Simpson wrote:

    > I have written a set of C++ classes that I would like to compile into a
    > library file, that then can be linked into other projects so I can use those
    > classes. The only thing is that I am not to sure how make the classes into
    > a library, and then how to consequently link them into my other projects.
    > Can anybody point me in the right direction please. I want to statically
    > link them so that the code is compiled into the app, because I don't want to
    > mess with DLL's
    >
    > Thanks


    Only compile the file, do not link it. Then, link the object files (.obj
    on windows, or .o on UNIX), and you have the binary ready. You will have
    to put the declarations in the headers (.h files), while definitions in
    the .cpp files and compile those .cpp files.

    -Dhruv.
    Dhruv, Jul 3, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Roberto Rocco
    Replies:
    0
    Views:
    384
    Roberto Rocco
    Aug 22, 2004
  2. Cablito

    Protect my class Libraries, can I?

    Cablito, Sep 20, 2004, in forum: ASP .Net
    Replies:
    4
    Views:
    465
    Rakesh Rajan
    Sep 27, 2004
  3. David Bishop

    Re: ModelSim 5.7 and xilinx libraries

    David Bishop, Jun 28, 2003, in forum: VHDL
    Replies:
    1
    Views:
    2,178
    Tim Hubberstey
    Jun 28, 2003
  4. Karsten Wutzke
    Replies:
    21
    Views:
    907
    Roedy Green
    Jun 29, 2007
  5. Sriram Srinivasan
    Replies:
    13
    Views:
    550
    Benjamin Kaplan
    Nov 12, 2009
Loading...

Share This Page