[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Dynamic linking (how?)
On Tue, 23 Mar 1999, eran wrote:
> I need help with dynamic linking:
> I have many .o files that I created as shared, but I am having problems
> linking them ot one libraray:
> I do ar ruv libtest.a ob1.o ob2.o
i think you're confusing 'dynamic linking' with 'static linking'.
> but when I compile&link programs that use this library, these programs
> arenot linked to this library, but to the o files.
this depends on what arguments you supply to the linker. naturally, if
you'll supply it with a '-L. -ltest' AFTER the program's object files, and
NOT the names of these object files, you'll achive your goal.
> How do I link all of the o files to a library, so I don't need
> the o files anymore ?
just don't use the object files on the linker's command line.
i'd sugges that you take a look at
http://www.actcom.co.il/~choo/lupg/tutorials/libraries/unix-c-libraries.html
it might answer your questions.
you might also want to read a little about makefiles (see the link to the
tutorials page there, and then the makefiles tutorail).
guy