By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,305 Members | 1,657 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,305 IT Pros & Developers. It's quick & easy.

Linking with Static Libraries (linux)

P: n/a
Hello,

I've 2 static libraries (let's say libx.a and liby.a) and an executable
(let's call it exe). exe only makes calls to liby.a but liby.a makes calls
implemented in libx.a

In my Makefile.am files for liby.a I added liby_a_LIBADD = $(path_to_libx.a)
and in the Makefile.am I added a exe_LDADD = $(path_to_libx_a)
$(path_to_liby_a)

Nevertheless I still get Link-errors for the functions called in libx from
liby...
Jul 23 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
"Herr Fieldmarshall" <xj******@hotmail.com> wrote in message
news:ct**********@snic.vub.ac.be...
Hello,

I've 2 static libraries (let's say libx.a and liby.a) and an executable
(let's call it exe). exe only makes calls to liby.a but liby.a makes calls
implemented in libx.a

In my Makefile.am files for liby.a I added liby_a_LIBADD = $(path_to_libx.a) and in the Makefile.am I added a exe_LDADD = $(path_to_libx_a)
$(path_to_liby_a)

Nevertheless I still get Link-errors for the functions called in libx from
liby...


And this has what exactly to do with the C++ language?

Try asking in a ng for your compiler.
Jul 23 '05 #2

P: n/a
Euhm, compilation issues...
"Lionel B" <me@privacy.net> wrote in message
news:35*************@individual.net...
"Herr Fieldmarshall" <xj******@hotmail.com> wrote in message
news:ct**********@snic.vub.ac.be...
Hello,

I've 2 static libraries (let's say libx.a and liby.a) and an executable
(let's call it exe). exe only makes calls to liby.a but liby.a makes
calls
implemented in libx.a

In my Makefile.am files for liby.a I added liby_a_LIBADD =

$(path_to_libx.a)
and in the Makefile.am I added a exe_LDADD = $(path_to_libx_a)
$(path_to_liby_a)

Nevertheless I still get Link-errors for the functions called in libx
from
liby...


And this has what exactly to do with the C++ language?

Try asking in a ng for your compiler.

Jul 23 '05 #3

P: n/a
Turn the lib order around.
exe_LDADD = $(path_to_liby_a) $(path_to_libx_a)

Jul 23 '05 #4

P: n/a
(top-post re-arranged)

"Herr Fieldmarshall" <xj******@hotmail.com> wrote in message
news:ct**********@snic.vub.ac.be...
"Lionel B" <me@privacy.net> wrote in message
news:35*************@individual.net...
"Herr Fieldmarshall" <xj******@hotmail.com> wrote in message
news:ct**********@snic.vub.ac.be...
Hello,

I've 2 static libraries (let's say libx.a and liby.a) and an executable
(let's call it exe). exe only makes calls to liby.a but liby.a makes
calls
implemented in libx.a

In my Makefile.am files for liby.a I added liby_a_LIBADD =

$(path_to_libx.a)
and in the Makefile.am I added a exe_LDADD = $(path_to_libx_a)
$(path_to_liby_a)

Nevertheless I still get Link-errors for the functions called in libx
from
liby...


And this has what exactly to do with the C++ language?

Try asking in a ng for your compiler.


Euhm, compilation issues...


.... are off-topic here. See the FAQ for this ng, specifically:
http://www.parashift.com/c++-faq-lit...t.html#faq-5.9 The key
phrase is: "Only post to comp.lang.c++ if your question is about the C++
language itself". Your question has nothing to do with the C++ *language*
and everything to do with (compiler/platform-specific) compilation/linkage
issues.
Jul 23 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.