Undefined first referenced gethostbyname 编译 错误
Solaris系统下编译 网络程序出现以下错误解决办法
-bash-3.00$ cc -o gggg getwww.c
"getwww.c", line 87: warning: implicit function declaration: bzero
Undefined first referenced
symbol in file
recv getwww.o
send getwww.o
gethostbyname getwww.o
socket getwww.o
connect getwww.o
ld: fatal: Symbol referencing errors. No output written to gggg
解决办法
同问:我上次在一台solaris的机器上编译socket用了-lsocket也不行,后来正好手头用本讲linux下编程的说,随手翻了下说要用-lxnet,试了下还真的可以.但是我在另以太aix上什么都不要,都可以编译通过