From owner-freebsd-ports-bugs@FreeBSD.ORG Wed Feb 6 05:40:01 2013 Return-Path: Delivered-To: freebsd-ports-bugs@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 5F1DBF3 for ; Wed, 6 Feb 2013 05:40:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 4054DE3A for ; Wed, 6 Feb 2013 05:40:01 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.6/8.14.6) with ESMTP id r165e1mM043055 for ; Wed, 6 Feb 2013 05:40:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.6/8.14.6/Submit) id r165e15l043054; Wed, 6 Feb 2013 05:40:01 GMT (envelope-from gnats) Resent-Date: Wed, 6 Feb 2013 05:40:01 GMT Resent-Message-Id: <201302060540.r165e15l043054@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Thomas Mack Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 11D7EE5 for ; Wed, 6 Feb 2013 05:39:54 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22]) by mx1.freebsd.org (Postfix) with ESMTP id 032FAE31 for ; Wed, 6 Feb 2013 05:39:54 +0000 (UTC) Received: from red.freebsd.org (localhost [127.0.0.1]) by red.freebsd.org (8.14.5/8.14.5) with ESMTP id r165drWV014951 for ; Wed, 6 Feb 2013 05:39:53 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.5/8.14.5/Submit) id r165drQC014950; Wed, 6 Feb 2013 05:39:53 GMT (envelope-from nobody) Message-Id: <201302060539.r165drQC014950@red.freebsd.org> Date: Wed, 6 Feb 2013 05:39:53 GMT From: Thomas Mack To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Subject: ports/175872: Static linking to libmysqlclient_r.a results in charset is not a compiled character set error X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Feb 2013 05:40:01 -0000 >Number: 175872 >Category: ports >Synopsis: Static linking to libmysqlclient_r.a results in charset is not a compiled character set error >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Feb 06 05:40:00 UTC 2013 >Closed-Date: >Last-Modified: >Originator: Thomas Mack >Release: 8.3 >Organization: >Environment: FreeBSD admin.bildarchiv-ostpreussen.de 8.3-RELEASE-p3 FreeBSD 8.3-RELEASE-p3 #0: Tue Jun 12 00:39:29 UTC 2012 root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC amd64 >Description: Trying to connect to a mysql database through C works fine, as long as the program is linked dynamically. Linking statically (gcc -static ...) results in the error: Character set 'latin1' is not a compiled character set and is not specified in the '/usr/local/share/mysql/charsets/Index.xml' file Error 2: Can't initialize character set latin1 (path: /usr/local/share/mysql/charsets/) even though the charset is at least included in /usr/local/share/mysql/charsets/Index.xml: [mack@admin ~/sources]$ grep -w latin1 /usr/local/share/mysql/charsets/Index.xml latin1 [mack@admin ~/sources]$ Tested on mysql-client-5.5.29. >How-To-Repeat: Just try to connect to a MySQL database from C: ===================================================== #include #include #include int main(int argc, char *argv[]) { MYSQL *mysql; if (mysql_library_init(0, NULL, NULL)) { fprintf(stderr, "Error 1: %s\n", mysql_error(mysql)); exit(-1); } mysql = mysql_init(NULL); if (!mysql_real_connect(mysql, "db_server.host.name","dbuser","password", "db_name", 0,NULL,0)) { fprintf(stderr, "Error 2: %s\n", mysql_error(mysql)); exit(-1); } } =================================================================== and compile it statically: gcc -static -o mt -I/usr/local/include/mysql -L/usr/local/lib/mysql mt.c -lmysqlclient_r -lz -lm >Fix: >Release-Note: >Audit-Trail: >Unformatted: