Bug #26294 library name conflict between MySQL 4.x, 5.0 and Qt 3.3
Submitted: 12 Feb 2007 20:38 Modified: 5 May 2008 18:57
Reporter: James Van Bokkelen Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: C API (client library) Severity:S2 (Serious)
Version:5.0.40-BK, 5.0.27, 4.1 OS:FreeBSD (FreeBSD 6.2)
Assigned to: Jim Winstead CPU Architecture:Any

[12 Feb 2007 20:38] James Van Bokkelen
Description:
When attempting to link my application using the 5.0.27 package for FreeBSD
6.2-RELEASE from freebsd.org, and a Qt v3.3.6 library built from source, I
get a "multiple definition of `init_time'" error from 'g++ -o ....'.
Yours is in my_time.o, theirs comes from libmng/libmng_chunk_prc.c

How to repeat:
Link any program that uses both libqt-mt.a from Qt v3.x (non-threaded versions
not tested) and libmysqlclient.a from v4.1 or later.  This has been observed
on Windows and FreeBSD, but I expect it would also occur on Linux or any other
platform where Qt and MySQL are both available.

Suggested fix:
Add a library- or product-specific prefix to internal function names.
[13 Feb 2007 11:49] Sveta Smirnova
Thank you for the report.

I can not repeat it with dummy file and receipt you provided. Please provide example script and compilation string you use.
[19 Feb 2007 9:37] Sveta Smirnova
Thank you for the comment.

I still can not repeat the error.

And error you get is "/usr/bin/ld: Warning: size of symbol `init_time' changed from 109 in /usr/local/lib/mysql/libmysqlclient.a(my_time.o) to 107 in /usr/local/lib/mysql/libmysqlclient.a(my_time.o)" It doesn't show init_time' was defined in libmng_chunk_prc.c

Please try to repeat problem with simple C file and if you can send us build string and that C file.
[20 Mar 2007 0:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
[12 Apr 2007 15:14] Valeriy Kravchuk
Verified by code review. We still have init_time() in my_time.c. 

It should better be called my_init_time(), to prevent problems like this one.
[26 Jan 2008 0:16] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/41275

ChangeSet@1.2565, 2008-01-25 16:12:03-08:00, jimw@rama.(none) +4 -0
  Rename init_time() to my_init_time() to avoid collision with other
  libraries (particularly libmng). (Bug #26294)
[28 Jan 2008 20:51] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/41327

ChangeSet@1.2565, 2008-01-28 12:49:47-08:00, jimw@rama.(none) +5 -0
  Rename init_time() to my_init_time() to avoid collision with other
  libraries (particularly libmng). (Bug #26294)
[3 Apr 2008 15:32] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/44872

ChangeSet@1.2598, 2008-04-03 11:32:00-04:00, cmiller@zippy.cornsilk.net +5 -0
  Bug#26294: library name conflict between MySQL 4.x, 5.0 and Qt 3.3
  
  When linking with some external programs, "multiple definition 
  of `init_time'"
  
  Rename init_time() to my_init_time() to avoid collision with other
  libraries (particularly libmng).
[3 Apr 2008 17:43] Chad MILLER
Queued to 5.0, 5.1, 6.0 -build trees.
[1 May 2008 10:05] Bugs System
Pushed into 5.1.25-rc
[1 May 2008 10:07] Bugs System
Pushed into 6.0.6-alpha
[1 May 2008 19:13] Bugs System
Pushed into 5.0.62
[5 May 2008 18:57] Paul DuBois
Noted in 5.0.62, 5.1.25, 6.0.6 changelogs.

The internal init_time() library function was renamed to
my_init_time() to avoid conflicts with external libraries.
[3 Jun 2008 9:26] Sveta Smirnova
Bug exists in version 4.1 See also duplicate bug #37154

Bug #37154 contains patch for version 4.1
[9 Jun 2008 8:21] Bolek Tekielski
Are there any changes to have this issue fixed in upcoming, 4.1.25 release ?
[9 Jun 2008 16:53] Sveta Smirnova
Bolek,

active support for MySQL 4.1 ended at 2006-12-31. Now is only extended support available. See how it can affect bug fixing at http://www.mysql.com/about/legal/lifecycle/#faq