473,408 Members | 1,788 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

How to call different functions with the same name

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
1 4949
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Bruce W...1 | last post by:
I'm a PHP newbie coming from experience with ASP.NET. I want to have a separate PHP file to support each HTML PHP page. This would be the equivalent of an ASP.NET code-behind file but using PHP....
10
by: Carramba | last post by:
hi! I don't have eny code to chare, this is just teoretical question. usualy you have for looks like <form method="POST" action="some_php_script.php"> namn: <input type="text" name="name"...
5
by: Sue | last post by:
After finishing up my first quarter JavaScript on 12/12/03, I decided to improve character checking on my project. In my project I only had to do very basic validation. Therefore, I only had one...
6
by: surrealtrauma | last post by:
i have a trouble about that: i want to ask user to enter the employee data (employee no., name, worked hour, etc.), but i dont know how to sort the data related to a particular employee as a...
4
by: Ganesh Kundapur | last post by:
Hi all, suppose i have 100 functions such as f1, f2,...f100 in a single file including main. If i pass arguement to main such as $a.out f1 main should call appropriate functions. I can do this...
26
by: Adam Warner | last post by:
Hello all, I'm very new to C but I have a number of years of Common Lisp programming experience. I'm trying to figure out ways of translating higher order concepts such as closures into C. The...
22
by: falk.von.roetel | last post by:
Hello, I have the problem to call a c++ funtion in a C project. I have a header file from the cpp file. In the header file the function is decleared "int GetHostIPAddresses(ini i);". I inlcude...
2
by: dolphin | last post by:
What is the different between c++ call convention and c call convention?Can some give some examples?
6
by: RandomElle | last post by:
Hi there I'm hoping someone can help me out with the use of the Eval function. I am using Access2003 under WinXP Pro. I can successfully use the Eval function and get it to call any function with...
275
by: Astley Le Jasper | last post by:
Sorry for the numpty question ... How do you find the reference name of an object? So if i have this bob = modulename.objectname() how do i find that the name is 'bob'
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.