Mail Archives: djgpp/1997/04/02/06:47:09
Skye (s_c AT geocities DOT com) wrote:
> Jordi Vida=F1a Caball=E9 wrote:
> > When trying
> > to link, ld says "no such file or directory (ENOENT)". I've written the=
> > library name
> > with suffix .a, without it, with and without the path before it's name =
> and =
> =2E.......
> Here's an example of what works for me (in c++):
> the lib is: libtest.h, libtest.cc
> gcc -c libtest.cc -o libtest.a
> [copy libtest.a file to djgpp\lib dir]
> the program is: prog.cc [includes libtest.h]
> gcc -c prog.cc -o prog.o
> gxx -o prog.exe prog.o -ltest
> [run prog.exe and it should work]
> Name your lib:
> "lib"[your name]".a"
> It works for me but I don't know why yet.? Eli? DJ?
This method works, but only with a single-file. Your "library file" is
simply an object file that gets linked with the program. For a true
library consiting of multiple object files, use the 'ar' command. To
figure out how:
info ar
--
Beautiful Savior Evangelical Lutheran Church - av568 AT rgfn DOT epcc DOT edu
We have what you need-- A Savior!
- Raw text -