Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Making a C-library

Status
Not open for further replies.

huskers

Programmer
Jan 29, 2002
75
US
Hi,

Could anyone tell me how I can make a library in C. I am working on a Unix machine. Any help would be greatly appreciated.

Thanks
 
Huskers:

You want to use the ar command, maintain library command. The man pages have a full description but:

The following command adds the file source.o to the library testlib.a:

ar -r testlib.a source.o

where the -r switch says to replace the object if it already exists in the library else add it.

Regards,


Ed
 
How can I use this commands in a batch file ?

I had a batch file which accepts the current directory
as a parameter and does some thing.

I want the batch file to read the current directory
automatically instead of me passing it explicitly.

How can I do this ?

By the way I am using Windows as OS.



 
Hi:

Sorry, I'm not a windows programmer. Are you sure ar even works under windows?

Regards,


Ed
 
It doesn't. If you're using Visual C++, when you create your new project, you can pick the "Win32 Static Library" project.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top