automake
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

C programs using C++ libraries


From: Billy Biggs
Subject: C programs using C++ libraries
Date: Tue, 9 Dec 2003 13:29:00 -0600
User-agent: Mutt/1.5.4i

  I have a C program that uses a library which internally uses C++, but
exposes a C API.  I have a user who experiences linking problems about
missing standard C++ stuff, fixed by using "g++" to link.  I am looking
for help in understanding this and what the correct solution is.

  This has been discussed before on this list [1] and solutions given.
I could build a dummy.cc to force C++ linking, I could use my own
program_LINK, or I could do some magic with setting CCLD or similar.

  I have a few questions, please let me know if there is a better forum
for them:

  1. Why does my program need to be linked with a C++ compiler in some
     cases and not in others?  Shared libraries should bring in their
     own dependencies, or libtool should find them, no?  Is something
     broken with how the library is built?

  2. I use libtool (but I do not understand why I use it).  Is the
     following correct for my program_LINK command if I use libtool:

     program_LINK = $(LIBTOOL) --mode=link $(CXX) $(AM_CFLAGS) $(CFLAGS) \
        $(AM_LDFLAGS) $(LDFLAGS) -o $@

  3. Who defines CXXLD and how?  I have seen this variable referenced,
     it looks like I should use it above (to match CCLD), but nothing
     seems to define it.  Is it obsolete?

  Thanks for your help,
  -Billy

  [1] http://mail.gnu.org/archive/html/automake/2002-11/msg00046.html





reply via email to

[Prev in Thread] Current Thread [Next in Thread]