bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Linking Error


From: Bob Proulx
Subject: Re: Linking Error
Date: Fri, 9 Sep 2005 10:03:00 -0600
User-agent: Mutt/1.5.9i

Scott L Powell wrote:
> Hope you can give me some advice.

For this particular question I think the gcc-help mailing list may
have been best.

> The system I'm compiling on is a HP-UX rx4640. OS is 11.23.
> The first gcc compilation indicated some 'unsatisfied symbols'
> that I understood could be corrected by adding the -lmysqlclient
> reference. The second gcc compilation shows the 'Mismatched ABI'
> fatal error.

You will probably need to compile the mysql library using the same gcc
you are using to compile your current application.  They error
indicates that they were not and are using a mismatched ABI.

> I haven't run across enough information about the error on the
> internet, so I thought I'd write to see if you would be able to help.
> 
> 
> First compile:
> /opt/mysql> gcc sysiupd.c -o sysiupd.o -L/opt/mysql/lib/mysql

The -L specifies a path to look for libraries.  But you have not
specified any.  So this has little useful effect at this point.

> sysiupd.c: In function `main':
> sysiupd.c:286: warning: cast to pointer from integer of different size
> ld: Unsatisfied symbol "mysql_real_connect" in file /var/tmp//ccLkxZGe.o
> ld: Unsatisfied symbol "mysql_real_query" in file /var/tmp//ccLkxZGe.o
> ld: Unsatisfied symbol "mysql_error" in file /var/tmp//ccLkxZGe.o
> ld: Unsatisfied symbol "mysql_commit" in file /var/tmp//ccLkxZGe.o
> ld: Unsatisfied symbol "mysql_init" in file /var/tmp//ccLkxZGe.o
> 
> Second compile:
> /opt/mysql> gcc sysiupd.c -o sysiupd.o -L/opt/mysql/lib/mysql -lmysqlclient

Now that you have added -llibrary the -Lpath has useful effect.

> sysiupd.c: In function `main':
> sysiupd.c:286: warning: cast to pointer from integer of different size
> ld: Mismatched ABI (not an ELF file) for -lmysqlclient
> Fatal error.
> collect2: ld returned 1 exit status

You are mixing ABIs.  Check the type of the files you are creating and
the mysql library you are trying to link against.  I am sure you will
find them different.

  file sysiupd.o opt/mysql/lib/mysql/libmysqlclient*

I expect one to be IA64 and the other to be PA-RISC1.1 or some such.

Bob




reply via email to

[Prev in Thread] Current Thread [Next in Thread]