MySQL v3.23 and C API
Jean-Baptiste Quenot
jb.quenot at caraldi.com
Thu Nov 27 10:54:02 PST 2003
* Steve Blair:
> The errors I get are as follows. I get these if using cc or gcc to
> compile the program.
>
> 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'
>
> 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.
The linker searches a standard list of directories for the li-
brary, which is actually a file named `liblibrary.a'. The link-
er then uses this file as if it had been specified precisely by
name.
The directories searched include several standard system direc-
tories plus any that you specify with `-L'.
HTH,
--
Jean-Baptiste Quenot
http://caraldi.com/jbq/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20031127/e54629dc/attachment.bin
More information about the freebsd-questions
mailing list