473,624 Members | 2,165 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1332
"Kaushal Mehta" <ka*******@gmai l.com> wrote in message
news:11******** **************@ f14g2000cwb.goo glegroups.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*******@gmai l.com> wrote in message
news:11******** **************@ f14g2000cwb.goo glegroups.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_fata l and UW_c_client_fat al, 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_fata l and UW_c_client_fat al, 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_fata l and UW_c_client_fat al, 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.c om, 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
8881
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
1120
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 will be sent via a asp/asp.net page to about 10 different databases. The companies which control these databases will receive requests and send XML resultsets back. I have limited XML experience and was wondering if some expert out there can help...
0
2239
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 , Statistics and Accounting, Engineering and Technical Standards and Databank Such as ISO , DIN , BSI ,ASME , ASTM a nd etc. This softwares we can obtain for you with CDs or DVDs. Sorry for not downloa d available. May be in future it will be possible...
5
1896
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", but I still would like to know because I am trying to encapsulate a third-party C-based callback-oriented gui toolkit inside C++ classes and I would like to try something. So say you have: long some_address = some_valid_address;
7
3239
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 library, which is based on GTK. Depending on which libraries I link in, I can have either a GTK1 or GTK2 user interface. I'm finding that the simulation behaves differently depending on whether I link with GTK1 or GTK2.
19
4087
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 the code that implements managing unbound controls on forms given the superior performance of unbound controls in a client/server environment. I can easily understand a newbie using bound controls or someone with a tight deadline. I guess I need...
8
17052
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 default, because I didn't do this in the program), but there is no actual formatting (italics, color, etc.) in the message body, which is passed to from VB.NET to Outlook as an unformatted text String. I want to start applying formatting to the...
0
1379
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 they conform the requirements of a COM Callable Wrapper (CCW).
3
4143
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. Do I need to install some other softwares for using it? Thank you, Amit
0
8234
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8677
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...
1
8335
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
8474
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7158
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
6110
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...
1
2605
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1784
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1482
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.