473,804 Members | 3,030 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1893
kj <so***@987jk.co m.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_Keit h) 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.or g>,
Keith Thompson <ks***@mib.or g> wrote:
kj <so***@987jk.co m.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.or g>,
Keith Thompson <ks***@mib.or g> 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
3318
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 interact with a rich 3D environment. Seem to be 90% of the way there! My problems are related to calculations where the result tends to zero (or another defined limit.) Have loads of cases where this kind of interaction occurs but this one
17
2677
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 TileMap { public:
10
1620
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 modules uses IJG JPEG library. But, another module needs to use *modified* verzion of the library: the application displays images - for that it uses "normal" jpeg-6b library. However, some functionality is required that modifies the jpeg files as...
4
1757
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 able to strike the puck and move in the direction opposite to which it was struck (a simple collision, basically!)
11
2542
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 reference to a different source. My question was: One of my source files uses the library: #include <openssl/md5.h>
4
2021
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 provides me with a standards-compliant way of creating pop-up windows by simply adding a rel="external" to each anchor. The other allows me to have toggled definition lists. When the popupwin.js file is by itself, all anchors with rel="external"...
2
2794
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 writers, so there’s a collision. I tried simply renaming their User class to something else throughout their code (e.g., BlogUser) but as a first pass it didn’t work since the “User” name is hardcoded in many places in their code where the class is...
1
9566
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 help me with this..I want to determine also if the table now is full so as to stop user from entering a key. size of the table=19, Thanx a lot..GodBless ________________________________________________ #include<iostream.h> #include<conio.h> ...
7
5550
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 generally works find but I have trouble when the ball is hitting corners of the box. That is particularly annoying to check especially when levels are very different of each other. This is the function where I check collision with boxes. public...
0
9579
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10571
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10326
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10317
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9143
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7615
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6851
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3815
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.