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

How to call different functions with the same name

P: n/a
Hi Gurus,

I have two libraries, called libA and libB and I will create a driver
placed between them, look like following:
libA
|
driver
|
libB
There is a function reference in libA, named foo, so I should
implement it in driver.
But libB has also a function called foo implemented, and I can't let
libA call the foo in libB directly.
Since I compiled by GCC, I try to weaken the foo in libB and provide a
global foo in driver to be linked with libA.
The question is: to implement foo in driver, I have to call the foo in
libB for its functional, how can I do this???
I tried alias, but it doesn't work. libA always called the foo in libB
instead which in driver.

Any suggestion?
Nov 11 '08 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On Mon, 10 Nov 2008 18:34:09 -0800 (PST), lanser <La******@gmail.com>
wrote in comp.lang.c:
Hi Gurus,

I have two libraries, called libA and libB and I will create a driver
placed between them, look like following:
libA
|
driver
|
libB
There is a function reference in libA, named foo, so I should
implement it in driver.
But libB has also a function called foo implemented, and I can't let
libA call the foo in libB directly.
Since I compiled by GCC, I try to weaken the foo in libB and provide a
global foo in driver to be linked with libA.
The question is: to implement foo in driver, I have to call the foo in
libB for its functional, how can I do this???
I tried alias, but it doesn't work. libA always called the foo in libB
instead which in driver.

Any suggestion?
There is nothing in the C language that allows two functions with
external linkage to exist in the same program. gcc might offer
something that can do what you want, but it is a non-standard
extension and not part of the language.

So try asking in one of the gnu.gcc.* groups.

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://c-faq.com/
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++
http://www.club.cc.cmu.edu/~ajo/docs/FAQ-acllc.html
Nov 11 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.