Bug #60358 mysql-workbench 5.2.32/33 does not compile: error: template with C linkage
Submitted: 6 Mar 2011 8:02 Modified: 18 May 2011 2:00
Reporter: Hans de Graaff Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench Severity:S1 (Critical)
Version:5.2.33 OS:Linux (Gentoo Linux)
Assigned to: CPU Architecture:Any
Tags: Contribution

[6 Mar 2011 8:02] Hans de Graaff
Description:
Trying to compile mysql-workbench 5.2.32 on Gentoo Linux with gcc 4.4.5 results in the following errors (excerpt):

file_utilities.cpp: In constructor 'base::LockFile::LockFile(const std::string&)':
file_utilities.cpp:204: warning: ignoring return value of 'int ftruncate(int, __off_t)', declared with attribute warn_unused_result
file_utilities.cpp: In constructor 'base::LockFile::LockFile(const std::string&)':
file_utilities.cpp:204: warning: ignoring return value of 'int ftruncate(int, __off_t)', declared with attribute warn_unused_result
file_utilities.cpp: In constructor 'base::LockFile::LockFile(const std::string&)':
file_utilities.cpp:204: warning: ignoring return value of 'int ftruncate(int, __off_t)', declared with attribute warn_unused_result
mv -f .deps/threaded_timer.Tpo .deps/threaded_timer.Plo
In file included from /usr/lib/gcc/x86_64-pc-linux-gnu/4.4.5/include/g++-v4/string:41,
                 from /usr/include/unicode/std_string.h:39,
                 from /usr/include/unicode/unistr.h:31,
                 from /usr/include/unicode/strenum.h:14,
                 from /usr/include/unicode/uenum.h:24,
                 from /usr/include/unicode/ucnv.h:51,
                 from /usr/include/libxml2/libxml/encoding.h:31,
                 from /usr/include/libxml2/libxml/parser.h:807,
                 from /usr/include/libxml2/libxml/globals.h:18,
                 from /usr/include/libxml2/libxml/threads.h:35,
                 from /usr/include/libxml2/libxml/xmlmemory.h:218,
                 from /usr/include/libxml2/libxml/tree.h:1248,
                 from base/xml_util_functions.h:31,
                 from xml_util_functions.cpp:43:
/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.5/include/g++-v4/bits/stringfwd.h:44: error: template with C linkage
/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.5/include/g++-v4/bits/stringfwd.h:47: error: template with C linkage
/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.5/include/g++-v4/bits/stringfwd.h:50: error: template with C linkage
/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.5/include/g++-v4/bits/stringfwd.h:54: error: template specialization with C linkage
/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.5/include/g++-v4/bits/stringfwd.h:59: error: template specialization with C linkage

How to repeat:
Try to compile the package. Compiling mysql-workbench 5.2.31 on the same system works fine.
[6 Mar 2011 8:03] Hans de Graaff
Please let me know if you need more information on installed versions of packages, the full log file, etc.
[12 Mar 2011 8:05] Hans de Graaff
This problem is still present in 5.2.33
[14 Mar 2011 12:07] Johannes Taxacher
Hi, can you please try  to move #inlcudes in xml_util_functions.h before extern "C" line and tell if the problem persists?
thanks in advance
[14 Mar 2011 18:20] Hans de Graaff
Thanks, that fixes things. I'll attach the patch I'm going to add to the Gentoo build.
[14 Mar 2011 18:21] Hans de Graaff
Patch that fixed compilation issues

Attachment: mysql-workbench-5.2.33-cpp.patch (application/octet-stream, text), 544 bytes.

[15 Apr 2011 11:46] Valeriy Kravchuk
Thank you for the problem report and patch contributed.
[18 May 2011 2:00] Paul DuBois
Noted in 5.2.34 changelog.

Workbench failed to compile on Gentoo Linux.