473,397 Members | 1,969 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,397 software developers and data experts.

Library collision

kj

Pardon the dumb question, but how does one link against two libraries
that both define functions foo (for example), having different
meanings and different prototypes?

My linker is complaining of having detected a redefinition of a
function. And, sure enough, looking at the appropriate header
files I see that both libraries define the same function, though
with different meanings and signatures. Since I've never seen this
sort of problem before, I suspect that I'm doing something wrong.

Any help would be much appreciated!

kj
--
NOTE: In my address everything before the first period is backwards;
and the last period, and everything after it, should be discarded.
Nov 15 '05 #1
3 1875
kj <so***@987jk.com.invalid> writes:
Pardon the dumb question, but how does one link against two libraries
that both define functions foo (for example), having different
meanings and different prototypes?

My linker is complaining of having detected a redefinition of a
function. And, sure enough, looking at the appropriate header
files I see that both libraries define the same function, though
with different meanings and signatures. Since I've never seen this
sort of problem before, I suspect that I'm doing something wrong.

Any help would be much appreciated!


There is no portable way to do this other than changing one of the
names (which requires recompiling the library from source).

There *might* be system-specific ways of resolving such conflicts.
Presumably you'd need to specify somehow which "foo" is visible from
where. Or you might be able to do something with the order in which
you specify object files when you invoke the linker, but that's ugly.
Try a system-specific newsgroup for your platform.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Nov 15 '05 #2
In article <ln************@nuthaus.mib.org>,
Keith Thompson <ks***@mib.org> wrote:
kj <so***@987jk.com.invalid> writes:
Pardon the dumb question, but how does one link against two libraries
that both define functions foo (for example), having different
meanings and different prototypes?
There is no portable way to do this other than changing one of the
names (which requires recompiling the library from source).


It goes further than that: there is no portable way of linking
libraries. Anything having to do with libraries is beyond the
scope of the C standard. All that is certain is that there will
be *some* mechanism which provides a way of translating
multiple source files and providing definitions for the standard
library functions -- there isn't even any certainty that there
will be a C library as such. [Sounds strange, but then again C
is a language which doesn't even promise that the standard header
files are in text format...]

--
Any sufficiently old bug becomes a feature.
Nov 15 '05 #3
In article <ln************@nuthaus.mib.org>,
Keith Thompson <ks***@mib.org> wrote:
There is no portable way to do this other than changing one of the
names (which requires recompiling the library from source).


Making libraries isn't portable between C implementations, but assuming
you have tools for handling libraries you may have one that lets you
extract the functions (or files) from the library and re-package them
without the undesired function.

-- Richard
Nov 15 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Dave | last post by:
Hi folks, I am trying to develop a routine that will handle sphere-sphere and sphere-triangle collisions and interactions. My aim is to develop a quake style collision engine where a player can...
17
by: Mark | last post by:
uhhmmm... not really sure how to word this. i cant get get this to compile.. i'm not sure what the proper syntax to do this is.. hopefully it's self explanatory. here's my class: ------ class...
10
by: David Soukal | last post by:
Hello, I have an interesting problem that I'm tackling with. I'm sure there must be some obvious solution... I have this big project. It's composed of several *.lib modules. Now, one of the...
4
by: Brian Basquille | last post by:
Hello all, Well, we've gotten to it: the real meaty area of my Air Hockey game.. Any help or suggestions for the following would be much appreciated. In plain terms: My paddle needs to be...
11
by: Matt Kowalczyk | last post by:
I hope I am posting this to the right newsgroup. I tried submitting this to the autoconf@gnu.org mailing list, but I see no activity. If this is the wrong newsgroup, I would appriciate a...
4
by: Neo Geshel | last post by:
I am experiencing a collision between two scripts, but I cannot find where it is. I am hoping that someone here can help me. I have two external JS files that I call into each web page. One...
2
by: Rolf | last post by:
Hello- I’m integrating blogging software (www.b2evolution.net) into my app and have run into a namespace-collision problem. In my code, I’ve defined a User class, and so have the b2evolution...
1
by: May Amor | last post by:
Helu gurus!!! I have a code below about hashing method with collision resolution...My problem is how to use the collsion resolution again if the hash index though has already a value. Please kinda...
7
by: Humakt | last post by:
This is 2D game where there are breakable boxes in the middle two bats on both sides and one or more balls breaking the boxes. Kind of like a mixup of pong and breakout. Collision detection...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
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
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.