how to develop library ( .a and .so files) ! URGENT!!!

Discussion in 'C Programming' started by zoltan, Jan 30, 2006.

  1. zoltan

    zoltan Guest

    Hi all,
    This is REALLY urgent. I need some pointers/ links/suggestions on
    how to develop a library using C. The library needs to be made generic
    afterwards by using C++. Any ideas? The target is to develop a library
    to implement a DNS Query, so I guess it should be a file in .a or .so
    format. Any help will be greatly appreciated. Really urgent. Googling
    didn't help at all. Thanks a lot...

    Regards,

    Timmy Jose.
    zoltan, Jan 30, 2006
    #1
    1. Advertising

  2. zoltan

    Nelu Guest

    zoltan wrote:
    > Hi all,
    > This is REALLY urgent. I need some pointers/ links/suggestions on
    > how to develop a library using C. The library needs to be made generic
    > afterwards by using C++. Any ideas? The target is to develop a library
    > to implement a DNS Query, so I guess it should be a file in .a or .so
    > format. Any help will be greatly appreciated. Really urgent. Googling
    > didn't help at all. Thanks a lot...
    >
    > Regards,
    >
    > Timmy Jose.
    >

    Write functions in a C file then compile the file using -shared
    if you use gcc. The result is a dll (.so).
    The question is OT on c.l.c.


    --
    Ioan - Ciprian Tandau
    tandau _at_ freeshell _dot_ org (hope it's not too late)
    (... and that it still works...)
    Nelu, Jan 30, 2006
    #2
    1. Advertising

  3. zoltan

    zoltan Guest

    Hi Nelu,
    Sorry if the topic was out of place.... But thanks a lot anyway.
    That helped a lot... I guess I'll "man" gcc and get the whole
    documentation... Thankx a bunch
    zoltan, Jan 30, 2006
    #3
  4. zoltan

    Nelu Guest

    zoltan wrote:
    > Hi Nelu,
    > Sorry if the topic was out of place.... But thanks a lot anyway.
    > That helped a lot... I guess I'll "man" gcc and get the whole
    > documentation... Thankx a bunch
    >

    You are welcome.
    Please quote context when replying. I see you are using
    Google groups. This (comp.lang.c) is not a google group
    but an NNTP group that google can access.
    Please remember:
    - don't top post
    - quote enough context so other people can understand
    what you are replying to, even if you are replying to one
    of your posts
    - don't snip the authors of posts when you remove irrelevant
    pieces of text
    I know the default reply link in Google Groups doesn't
    automatically quote the post you're replying to so
    don't use that. Instead use the Reply link available when you
    click on show options.

    Thank you.

    --
    Ioan - Ciprian Tandau
    tandau _at_ freeshell _dot_ org (hope it's not too late)
    (... and that it still works...)
    Nelu, Jan 30, 2006
    #4
  5. "zoltan" <> writes:
    > This is REALLY urgent.


    Then perhaps posting to Usenet wasn't the best way to get information.

    > I need some pointers/ links/suggestions on
    > how to develop a library using C. The library needs to be made generic
    > afterwards by using C++. Any ideas? The target is to develop a library
    > to implement a DNS Query, so I guess it should be a file in .a or .so
    > format. Any help will be greatly appreciated. Really urgent. Googling
    > didn't help at all. Thanks a lot...


    Why do you need to do this, and why is it so urgent? Is this
    homework?

    --
    Keith Thompson (The_Other_Keith) <http://www.ghoti.net/~kst>
    San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
    We must do something. This is something. Therefore, we must do this.
    Keith Thompson, Jan 30, 2006
    #5
  6. zoltan wrote:

    > Googling
    > didn't help at all.


    I can't believe this...

    Cheers

    Vladimir

    --
    Garbage In -- Gospel Out.
    Vladimir S. Oka, Jan 30, 2006
    #6
  7. zoltan

    Malcolm Guest

    "zoltan" <> wrote > This is REALLY urgent. I need
    some pointers/ links/suggestions on
    > how to develop a library using C. The library needs to be made generic
    > afterwards by using C++. Any ideas? The target is to develop a library
    > to implement a DNS Query, so I guess it should be a file in .a or .so
    > format. Any help will be greatly appreciated. Really urgent. Googling
    > didn't help at all. Thanks a lot...
    >


    file mylibrary.c

    void libfoo(void)
    {
    printf("This function does something useful\n");
    }

    file mylibrary2.c
    void libbar(void)
    {
    printf("So does this one\n");
    }

    file test.c

    #include "mylibrary.h"

    int main(void)
    {
    libfoo();
    libbar();
    return 0;
    }
    Now play with your compiler until things work as you want.

    Then write the real library.
    Malcolm, Jan 30, 2006
    #7
  8. zoltan

    zoltan Guest

    Keith Thompson wrote:
    > "zoltan" <> writes:
    > > This is REALLY urgent.

    >
    > Then perhaps posting to Usenet wasn't the best way to get information.
    >
    > > I need some pointers/ links/suggestions on
    > > how to develop a library using C. The library needs to be made generic
    > > afterwards by using C++. Any ideas? The target is to develop a library
    > > to implement a DNS Query, so I guess it should be a file in .a or .so
    > > format. Any help will be greatly appreciated. Really urgent. Googling
    > > didn't help at all. Thanks a lot...

    >
    > Why do you need to do this, and why is it so urgent? Is this
    > homework?
    >
    > --
    > Keith Thompson (The_Other_Keith) <http://www.ghoti.net/~kst>
    > San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
    > We must do something. This is something. Therefore, we must do this.


    Hi,
    This is not homework but something related to my project. One of my
    modules is to develop a generic library for the DNS NAPTR Query and I
    don't have any previous experience in this.
    Regards,
    zoltan, Jan 31, 2006
    #8
  9. zoltan

    Sunil Varma Guest

    zoltan wrote:
    > Keith Thompson wrote:
    > > "zoltan" <> writes:
    > > > This is REALLY urgent.

    > >
    > > Then perhaps posting to Usenet wasn't the best way to get information.
    > >
    > > > I need some pointers/ links/suggestions on
    > > > how to develop a library using C. The library needs to be made generic
    > > > afterwards by using C++. Any ideas? The target is to develop a library
    > > > to implement a DNS Query, so I guess it should be a file in .a or .so
    > > > format. Any help will be greatly appreciated. Really urgent. Googling
    > > > didn't help at all. Thanks a lot...

    > >
    > > Why do you need to do this, and why is it so urgent? Is this
    > > homework?
    > >
    > > --
    > > Keith Thompson (The_Other_Keith) <http://www.ghoti.net/~kst>
    > > San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
    > > We must do something. This is something. Therefore, we must do this.

    >
    > Hi,
    > This is not homework but something related to my project. One of my
    > modules is to develop a generic library for the DNS NAPTR Query and I
    > don't have any previous experience in this.
    > Regards,


    This may be of some help.

    http://users.actcom.co.il/~choo/lupg/tutorials/libraries/unix-c-libraries.html

    Regards
    Sunil Varma, Jan 31, 2006
    #9
  10. > This is not homework but something related to my project. One of my
    >modules is to develop a generic library for the DNS NAPTR Query and I
    >don't have any previous experience in this.


    Code does not have to be in a generic library, or even in a library,
    to function. You can simply write some functions and include
    these functions (in the form of source code file(s)) in the set
    of files compiled for each program. If you need working programs,
    figuring out how to make libraries should not be a source of
    urgency.

    Gordon L. Burditt
    Gordon Burditt, Jan 31, 2006
    #10
  11. zoltan

    zoltan Guest

    Gordon Burditt wrote:
    > > This is not homework but something related to my project. One of my
    > >modules is to develop a generic library for the DNS NAPTR Query and I
    > >don't have any previous experience in this.

    >
    > Code does not have to be in a generic library, or even in a library,
    > to function. You can simply write some functions and include
    > these functions (in the form of source code file(s)) in the set
    > of files compiled for each program. If you need working programs,
    > figuring out how to make libraries should not be a source of
    > urgency.
    >
    > Gordon L. Burditt


    Hi,
    The concept would work great with me but my Manager wants me to
    develop such a library. It is for the sake of the specs given to me
    that I have to develop this library.
    zoltan, Jan 31, 2006
    #11
  12. zoltan

    zoltan Guest

    Sunil Varma wrote:
    > zoltan wrote:
    > > Keith Thompson wrote:
    > > > "zoltan" <> writes:
    > > > > This is REALLY urgent.
    > > >
    > > > Then perhaps posting to Usenet wasn't the best way to get information.
    > > >
    > > > > I need some pointers/ links/suggestions on
    > > > > how to develop a library using C. The library needs to be made generic
    > > > > afterwards by using C++. Any ideas? The target is to develop a library
    > > > > to implement a DNS Query, so I guess it should be a file in .a or .so
    > > > > format. Any help will be greatly appreciated. Really urgent. Googling
    > > > > didn't help at all. Thanks a lot...
    > > >
    > > > Why do you need to do this, and why is it so urgent? Is this
    > > > homework?
    > > >
    > > > --
    > > > Keith Thompson (The_Other_Keith) <http://www.ghoti.net/~kst>
    > > > San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
    > > > We must do something. This is something. Therefore, we must do this.

    > >
    > > Hi,
    > > This is not homework but something related to my project. One of my
    > > modules is to develop a generic library for the DNS NAPTR Query and I
    > > don't have any previous experience in this.
    > > Regards,

    >
    > This may be of some help.
    >
    > http://users.actcom.co.il/~choo/lupg/tutorials/libraries/unix-c-libraries.html
    >
    > Regards


    Hi Sunil,
    Thanks so much for the link. Yes, that's exactly what I wanted. Thanks
    again!
    Regards,

    Timmy.
    zoltan, Jan 31, 2006
    #12
  13. (Gordon Burditt) writes:
    >> This is not homework but something related to my project. One of my
    >>modules is to develop a generic library for the DNS NAPTR Query and I
    >>don't have any previous experience in this.

    >
    > Code does not have to be in a generic library, or even in a library,
    > to function. You can simply write some functions and include
    > these functions (in the form of source code file(s)) in the set
    > of files compiled for each program. If you need working programs,
    > figuring out how to make libraries should not be a source of
    > urgency.
    >
    > Gordon L. Burditt


    Gordon, *please* don't snip attributions. Thanks.

    --
    Keith Thompson (The_Other_Keith) <http://www.ghoti.net/~kst>
    San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
    We must do something. This is something. Therefore, we must do this.
    Keith Thompson, Jan 31, 2006
    #13
  14. zoltan

    CBFalconer Guest

    zoltan wrote:
    > Gordon Burditt wrote:
    >
    >>> This is not homework but something related to my project. One
    >>> of my modules is to develop a generic library for the DNS NAPTR
    >>> Query and I don't have any previous experience in this.

    >>
    >> Code does not have to be in a generic library, or even in a
    >> library, to function. You can simply write some functions and
    >> include these functions (in the form of source code file(s)) in
    >> the set of files compiled for each program. If you need working
    >> programs, figuring out how to make libraries should not be a
    >> source of urgency.

    >
    > The concept would work great with me but my Manager wants me to
    > develop such a library. It is for the sake of the specs given to
    > me that I have to develop this library.


    Argue about it. The time to put things in a library is after they
    have been thoroughly tested and their interface shown viable.
    Especially the interface. In general the standard library
    interfaces have been shown to be useful and viable, apart from
    gets.

    Cart, horse, order, relative, of. Man, mouse, which?

    --
    "The power of the Executive to cast a man into prison without
    formulating any charge known to the law, and particularly to
    deny him the judgement of his peers, is in the highest degree
    odious and is the foundation of all totalitarian government
    whether Nazi or Communist." -- W. Churchill, Nov 21, 1943
    CBFalconer, Jan 31, 2006
    #14
    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.

Share This Page