LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 789|回复: 1

请问网络编程的socket&nsl的库怎么连接?

[复制链接]
发表于 2003-10-5 09:55:33 | 显示全部楼层 |阅读模式
我这样用的
g++ -g -o s s.c -lsocket -lnsl
结果说不能find in /usr/lib/ld
什么的,
请问应该怎么连接呀?

我的环境是magiclinux 1.1
发表于 2003-10-5 11:38:34 | 显示全部楼层
network in linux is be auto linked, you need not specialfy it
I think the best metod is
first use g++ -g -o s s.c
if gcc report some function not found,
then man functionname
you can see the library need to link,
then add -llibname to it

and so on

soly I am use debian,and don't know how to use chinput
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表