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

Z

zoltan

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.
 
N

Nelu

zoltan said:
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.
 
Z

zoltan

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
 
N

Nelu

zoltan said:
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.
 
K

Keith Thompson

zoltan said:
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?
 
M

Malcolm

zoltan said:
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.
 
Z

zoltan

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


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

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,
 
G

Gordon Burditt

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
 
Z

zoltan

Gordon said:
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.
 
K

Keith Thompson

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.
 
C

CBFalconer

zoltan said:
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,053
Latest member
BrodieSola

Latest Threads

Top