Compile & Link error

Kezdőlap
Csatolmányok:
Üzenet email-ben
+ (text/plain)
Üzenet törlése
Válasz az üzenetre
Szerző: Gene Holmerud
Dátum:  
Régi témák: (no subject)
Tárgy: 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