Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 27 Nov 2003 19:53:59 +0100
From:      Jean-Baptiste Quenot <jb.quenot@caraldi.com>
To:        freebsd-questions@freebsd.org
Subject:   Re: MySQL v3.23 and C API
Message-ID:  <20031127185357.GB1842@watt.intra.caraldi.com>
In-Reply-To: <3FC64697.9090903@isc.upenn.edu>
References:  <3FC64697.9090903@isc.upenn.edu>

next in thread | previous in thread | raw e-mail | index | archive | help

--neYutvxvOLaeuPCA
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

* Steve Blair:

>   The errors I get  are as follows. I get these if using  cc or gcc to
> compile the program.
>=20
> host# cc -o locserv locserv.c
> /tmp/ccJdDxg3.o: In function `main':
> /tmp/ccJdDxg3.o(.text+0x6ca): undefined reference to `mysql_init'
> /tmp/ccJdDxg3.o(.text+0x7bc): undefined reference to `mysql_real_query'
> /tmp/ccJdDxg3.o(.text+0x7f3): undefined reference to `mysql_store_result'
> /tmp/ccJdDxg3.o(.text+0x80d): undefined reference to `mysql_num_rows'
> /tmp/ccJdDxg3.o(.text+0x877): undefined reference to `mysql_fetch_row'
>=20
>  Can anyone help explain what the problem is and how to correct it?

See the man page for gcc(1):

       -llibrary
              Use the library named library when linking.
                                                                           =
                                                  =20
              The  linker  searches a standard list of directories for the =
li-
              brary, which is actually a file named `liblibrary.a'.  The li=
nk-
              er  then uses this file as if it had been specified precisely=
 by
              name.
                                                                           =
                                                  =20
              The directories searched include several standard system  dir=
ec-
              tories plus any that you specify with `-L'.
                                                                           =
                                                  =20
HTH,
--=20
Jean-Baptiste Quenot
http://caraldi.com/jbq/

--neYutvxvOLaeuPCA
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (FreeBSD)

iD8DBQE/xkhF9xx3BCMc9gsRAs07AJ9zPxVB+eFhjJohFYJ3LXJgXP7qkgCeLJOB
bkWgfTQYPnd56V9wuLRTOuo=
=uOA/
-----END PGP SIGNATURE-----

--neYutvxvOLaeuPCA--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20031127185357.GB1842>