473,326 Members | 2,110 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,326 software developers and data experts.

Using two different third party softwares ... function multiplpy-defined error

Hello,

I am using two third party softwares, cyrus IMAP and UW c-client and
both of them are defining a function fatal with different signature.
Here is the error
"ld: fatal: symbol `fatal' is multiply-defined:
(file SunOS-sparc-5.8/imapd.o type=FUNC; file
/thirdParty/cclient/c-client/libc-client.a(osdep.o) type=FUNC);"

The signatures are
void fatal(const char *s, int code)
and
void fatal (char *string)

Its been used all over the place so changing the name does not sound
like a good idea.

Can you guys help me resolve this?. Thanks. Kaushal.

Nov 14 '05 #1
6 1322
"Kaushal Mehta" <ka*******@gmail.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
Hello,

I am using two third party softwares, cyrus IMAP and UW c-client and
both of them are defining a function fatal with different signature.
Here is the error
"ld: fatal: symbol `fatal' is multiply-defined:
(file SunOS-sparc-5.8/imapd.o type=FUNC; file
/thirdParty/cclient/c-client/libc-client.a(osdep.o) type=FUNC);"

The signatures are
void fatal(const char *s, int code)
and
void fatal (char *string)

Its been used all over the place so changing the name does not sound
like a good idea.


You have a name collision. One of them must change, if
you want access to both functions from the same scope(s).

-Mike
Nov 14 '05 #2
Mike Wahler wrote:
"Kaushal Mehta" <ka*******@gmail.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
Hello,

I am using two third party softwares, cyrus IMAP and UW c-client and
both of them are defining a function fatal with different signature.
Here is the error
"ld: fatal: symbol `fatal' is multiply-defined:
(file SunOS-sparc-5.8/imapd.o type=FUNC; file
/thirdParty/cclient/c-client/libc-client.a(osdep.o) type=FUNC);"

The signatures are
void fatal(const char *s, int code)
and
void fatal (char *string)

Its been used all over the place so changing the name does not sound
like a good idea.


You have a name collision. One of them must change, if
you want access to both functions from the same scope(s).


The nasty thing is that this often happens with functions which
should not be visible outside of the library. Some genius comes
up with "Oh, let's die with 'fatal'" and -- oh wonder -- it so
happens that someone else has the same idea.
IMO, a library should work with prefixes for functions and variables
with external linkage which should not be visible outside of the
library. The C89 limits are not very helpful in this case, though...

<OT>
@OP: If fatal is _always_ called from inside the libraries,
you can force the libraries to not show this symbol to the
outside. If you use gcc, you can have a look into the gcc.gnu.help
archives of the last two months; AFAIR this problem has been
addressed there.
</OT>

If you have access to the source, you can easily use a good
editor or a combination of find and sed (*) to replace fatal
by cyrus_IMAP_fatal and UW_c_client_fatal, respectively,
and just build the whole thing again.
If you do not have access to the source code, then you have to
ask for a change of the symbol name.
Cheers
Michael
_____________________
<OT>
(*) Example for the bash:

for FILE in `find $MYROOT -type f -exec grep -l fatal {} \;`; do
sed 's/\<fatal/another_fatal/g' $FILE > $FILE.new
mv -f $FILE.new $FILE
done

Set MYROOT to the directory containing the source code.
Make a copy of $MYROOT.
Try the above.
This is not foolproof but should do nicely in most cases.
--
E-Mail: Mine is a gmx dot de address.

Nov 14 '05 #3
On Wed, 22 Dec 2004 20:58:57 +0100, Michael Mair wrote:

....
If you have access to the source, you can easily use a good
editor or a combination of find and sed (*) to replace fatal
by cyrus_IMAP_fatal and UW_c_client_fatal, respectively,
and just build the whole thing again.


Another possibility could be to redefine the name in one of the
packages using a macro. Most compilers allow you to define macros on the
command line. If you did it that way you wouldn't even have to modify the
source code, just the build script.

Lawrence
Nov 14 '05 #4


Lawrence Kirby wrote:
On Wed, 22 Dec 2004 20:58:57 +0100, Michael Mair wrote:

...

If you have access to the source, you can easily use a good
editor or a combination of find and sed (*) to replace fatal
by cyrus_IMAP_fatal and UW_c_client_fatal, respectively,
and just build the whole thing again.

Another possibility could be to redefine the name in one of the
packages using a macro. Most compilers allow you to define macros on the
command line. If you did it that way you wouldn't even have to modify the
source code, just the build script.


.... the obvious... thanks for pointing it out :-)

--
E-Mail: Mine is a gmx dot de address.

Nov 14 '05 #5
Thanks to everybody for their inputs, I changed makefile and redefined
fatal in cclient and c_client_fatal using the -D option. Thanks again
to everybody.

Nov 14 '05 #6
Kaushal Mehta wrote:

Thanks to everybody for their inputs, I changed makefile and
redefined fatal in cclient and c_client_fatal using the -D
option. Thanks again to everybody.


We have no idea what you are talking about. Suitable context
quotes are needed, and preserving the original subject might help
also. See the sig below for a way to avoid the worst of Googles
usenet posting bugs.

--
"If you want to post a followup via groups.google.com, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers." - Keith Thompson
Nov 14 '05 #7

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

Similar topics

8
by: wenmang | last post by:
Hi, We have the 3rd party libraries written in C. And, in every header file from 3rd party, it has the include guarde: #ifdef __cplusplus #define extern "C" { : APIs... : } #endif
0
by: Vivek Mehta | last post by:
Hi, I am currently working on a project which requires that our web based application should allow end user to search on various parts and their availability in different regions. Http requests...
0
by: BRUCE WILLIS via DotNetMonster.com | last post by:
Hello architectural, engineer and technical users! We can offer you new regi stered CAD/CAM/CAE softwares: Survey , GIS , Rock , Soil and Water, Industri al and Control Project, Mathematics ,...
5
by: Eric Lilja | last post by:
Using a macro, can I change what type an object is being cast to? I know, the initial respone to question might be an instinctive "ugly, don't even think about it!" or "don't use macros at all",...
7
by: Chris Gordon-Smith | last post by:
I have a simulation program that calls the rand() function at various points while it executes. For the user interface that displays statistics etc. while the program runs, I use the Lazarus GUI...
19
by: James Fortune | last post by:
I have a lot of respect for David Fenton and Allen Browne, but I don't understand why people who know how to write code to completely replace a front end do not write something that will automate...
8
by: John Brock | last post by:
I am currently using a VB.NET program to send out e-mails with plain text bodies (plus one attachment). The emails are being received as Rich Text messages (probably just my personal Outlook...
0
by: tsmith | last post by:
Hi Can somebody help me, please! I'm trying to use a third-party .NET forms control in an unmanaged COM-aware application (MFC). I have no problem doing this with normal .net controls, as...
3
by: amitsoni.1984 | last post by:
Hi, I wanted to solve some linear programming problems and I was trying to use IMSL C libraries. But I couldn't get how to use it. I don't know where to write the codes and how to execute them....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.