Library Problems

Library Problems

Post by Peter Tod » Fri, 22 Oct 1999 04:00:00



I'm developing a complex C++ app on Linux. I use
automake and autoconf for compilation. In the app
there are many different subdirectories containing
all sorts of classes, functions etc. I have the
makefile's setup to make a library in each
directory. So I would make db/classes/libdb_classes.a
for instance and link that library to another part
of my program.

The problem is now my libraries are starting to
depend on other libraries. For instance
db/classes/libdb_classes.a depends on
shared/classes/libclasses.a When I compile a program
that uses one of those libraries I get errors saying
that there are undefined references in my libraries.

How do I fix this? Is there a better way to do this?
I'm not installing any of the libraries, they are
all staticly linked into the executable. But I
want to keep my multi-level directory structure.

 
 
 

Library Problems

Post by M. David All » Thu, 28 Oct 1999 04:00:00




Quote:> I'm developing a complex C++ app on Linux. I use
> automake and autoconf for compilation. In the app
> there are many different subdirectories containing
> all sorts of classes, functions etc. I have the
> makefile's setup to make a library in each
> directory. So I would make db/classes/libdb_classes.a
> for instance and link that library to another part
> of my program.

Rock on.  :)

Quote:> The problem is now my libraries are starting to
> depend on other libraries. For instance
> db/classes/libdb_classes.a depends on
> shared/classes/libclasses.a When I compile a program
> that uses one of those libraries I get errors saying
> that there are undefined references in my libraries.

Usually what the compiler (or actually, the linker) is trying to tell you
is "Dammit, you didn't link me with the right libraries!!!"

Quote:> How do I fix this? Is there a better way to do this?
> I'm not installing any of the libraries, they are
> all staticly linked into the executable. But I
> want to keep my multi-level directory structure.

Well, building libraries that depend on libraries that haven't been compiled
yet is a *.  You could either bootstrap your way up, by linking with an
older versoin of the library that did compile, then using that to link whatever
you need to, then updating the old version, or you can pick up a good book
on software engineering which will describe ways of not getting around the
problem but rather constructing the software so it doesn't happen in the
first place.

--
David Allen
http://www.veryComputer.com/
----------------------------------------
If you think nobody cares if you're alive, try missing a couple of car
payments.
- Earl Wilson

 
 
 

1. mysterious shared library problem (setuid problem?)

This problem just gets stranger and stranger.  I discovered that my xterm
programs (nxterm and xterm) were setuid root (why are they setuid root, by the
way?  It seems to be standard with the package, but I can't imagine why.)  Once
I get rid of the setuid root bit, the work fine.  But other programs that are
run using setuid seem to have the same problem.  In particular, if I run a
program through at, it barfs for lack of libraries.  Similarly if my httpd
daemon tries to run a cgi script.

Any ideas?
TIA,
Yaron

--
/- Yaron M. Minsky --------------------------------------------\
    H: (315) 423-9907                        O: (607) 255-4934
    109 Comstock Pl. Apt. #3, Syracuse NY      4139 Upson Hall
\------------------- http://www.cs.cornell.edu/home/yminsky/ --/

2. rdist to different directory

3. shared library problem with festival

4. HP LaserJet II /etc/printcap sample

5. Slackware 1.2.0 gcc library problem

6. rpc.ttdbserverd

7. rpm library problem

8. DNS/MX Question

9. c++ library problem

10. Shared library problem while starting X

11. shared libraries problem.

12. Wget shared library problem

13. Re; Fortran Library problem