* 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/

Attachment: pgp00000.pgp
Description: PGP signature

Reply via email to