Compile & Link error

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Gene Holmerud
Date:  
Old-Topics: (no subject)
Subject: Compile & Link error
I'm trying to compile & link an example for mysql access from C code
using the command:

gcc -L/usr/local/mysql/lib -I/usr/local/mysql/include -o select \
select.c -lmysql -lnsl -lsocket

I get error messages:

select.c: In function `main':
select.c:5: warning: return type of `main' is not `int' <-OK
/usr/bin/ld: cannot find -lmysql
collect2: ld returned 1 exit status

I looked in /usr/local/mysql/lib and saw *.a's, so figured I was OK
that way. If I omit the -lmysql in the command, it doesn't object to
the -lnsl, but fails on -lsocket. What am I missing?

Appreciations,
Gene