Bug #27318 linker complains about libmysqlclient.a
Submitted: 21 Mar 2007 5:38 Modified: 16 Mar 2009 12:25
Reporter: Otis Maclay Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Compiling Severity:S1 (Critical)
Version:mysql-max-5.0.27-osx10.4-powerpc-64bit, 5.0.37 OS:MacOS (OS X 10.4.9 (g5))
Assigned to: Daniel Fischer CPU Architecture:Any
Tags: libmysqlclient.a, link error, mac osx

[21 Mar 2007 5:38] Otis Maclay
Description:
archmnt.c: In function 'main':
archmnt.c:1033: warning: passing argument 1 of 'split_string' from incompatible pointer type
archmnt.c:1033: warning: passing argument 2 of 'split_string' from incompatible pointer type
archmnt.c:1033: warning: passing argument 3 of 'split_string' from incompatible pointer type
/usr/bin/ld: truncated or malformed archive: /usr/local/lib/mysql/libmysqlclient.a (ranlib structures in table of contents extends past the end of the table of contents, can't load from it)
collect2: ld returned 1 exit status

ld version:Apple Computer, Inc. version cctools-576.obj~23

How to repeat:
cc mytest.c -g -o mytest -I /usr/local/include/mysql -L/usr/local/lib/mysql -lmysqlclient

-----------
little test file in c:
---------------------
#include    <stdio.h>
#include    <string.h>
#include    <stdlib.h>
#include    "/usr/local/include/mysql/mysql.h"
#include    "/usr/local/include/mysql/mysqld_error.h"

#define db_host "localhost"     // usually
#define db_name "parchive"
#define db_user "parchiver"
#define db_pass "z89fqArX"

main(int ac, char *av[])
{

    MYSQL       * myData ;
    MYSQL_RES   * res ;
    char    *db_str;
    char    szDB[100];

    strcpy(szDB,db_name);

    if ( (myData = mysql_init((MYSQL*) 0)) &&
        mysql_real_connect( myData, NULL, db_user, db_pass, NULL, MYSQL_PORT,
            NULL, 0 ) )
    {
        if ( mysql_select_db( myData, szDB ) < 0 )
        {
            printf( "Can't select the %s database !\n", szDB ) ;
        }
        mysql_close( myData ) ;
    }
    exit(0);
}

-----------------------------------
applies to the above version, i assume...

Suggested fix:
i don't know enough about how the libs are built to suggest anything....

it would be nice to make corrected libs available, or, create a tarball to comple them locally -

I'd hate to have to reinstall. Normally, I install by compiling source, but the MySQL site was very insistent about using dmg's

Any wisdom would be greatly appreciated!

Thanks,

O.

Otis Maclay
Houston
omaclay@gmail.com (preferred email)
[21 Mar 2007 5:40] Otis Maclay
little test program

Attachment: mytest.c (text/plain), 687 bytes.

[21 Mar 2007 5:42] Otis Maclay
teeny little shell script to compile 'mytest'

Attachment: maketest (application/octet-stream, text), 90 bytes.

[21 Mar 2007 5:56] Valeriy Kravchuk
Thank you for a problem report. Please, try to repeat with a newer version, 5.0.37, and inform about the results.
[24 Mar 2007 2:18] Otis Maclay
It compiles fine (as far as I can tell) with 5.0.37. However, there is no g5 (64bit) version. The 64bit version under 37 is actually 27. I think it's been reported that this problem only applies to the 64bit.

Thanks, Valeriy,

O.
[29 Mar 2007 10:15] Sveta Smirnova
Thank you for the report.

Verified as described with not published 5.0.37 package.
[16 Mar 2009 12:25] Daniel Fischer
Closing, because this is targeted for 6.0 and I can't reproduce it in 5.1 and above.