Hello,
Can’t compile simple MySQL application. This is how I do that:
cc -I/usr/include/mysql -L/usr/lib/mysql -L/lib/libsocket
test.c -lm -lmysqlclient
/usr/ntox86/bin/ld: warning: libc.so.1, needed by
/usr/lib/libmysqlclient.so, may conflict with libc.so.2
/usr/lib/libmysqlclient.so: undefined reference to connect' /usr/lib/libmysqlclient.so: undefined reference to
socket’
/usr/lib/libmysqlclient.so: undefined reference to setsockopt' /usr/lib/libmysqlclient.so: undefined reference to
shutdown’
/usr/lib/libmysqlclient.so: undefined reference to gethostbyname' /usr/lib/libmysqlclient.so: undefined reference to
getservbyname’
/usr/lib/libmysqlclient.so: undefined reference to `getsockopt’
cc: /usr/ntox86/bin/ld error 1
What I’m doing wrong?
Thanks,
Gen
The problem is solved. Thanks,
Gen
“Gennadiy Gladchun” <gen@fortna.com.ua> wrote:
Hello,
Can’t compile simple MySQL application. This is how I do that:
cc -I/usr/include/mysql -L/usr/lib/mysql -L/lib/libsocket
test.c -lm -lmysqlclient
/usr/ntox86/bin/ld: warning: libc.so.1, needed by
/usr/lib/libmysqlclient.so, may conflict with libc.so.2
/usr/lib/libmysqlclient.so: undefined reference to connect' /usr/lib/libmysqlclient.so: undefined reference to
socket’
/usr/lib/libmysqlclient.so: undefined reference to setsockopt' /usr/lib/libmysqlclient.so: undefined reference to
shutdown’
/usr/lib/libmysqlclient.so: undefined reference to gethostbyname' /usr/lib/libmysqlclient.so: undefined reference to
getservbyname’
/usr/lib/libmysqlclient.so: undefined reference to `getsockopt’
cc: /usr/ntox86/bin/ld error 1
What I’m doing wrong?
Thanks,
Gen