Recently, I am learning the Unix C and come to know that Sockets are:
– Special files used for network communication (or local interprocess communication)
– Not available in all UNIX versions (some don't represent network connections as files in the file system)

finally I get one example Unix Domain Socket from the website 
http://beej.us/guide/bgipc/output/html/singlepage/bgipc.html#unixsockserv.
when trying to compile the application on platform solaris, It always produces the error message as follows:

Undefined                       first referenced
 symbol                             in file
bind                                /var/tmp//ccOrrHMQ.o
recv                                /var/tmp//ccOrrHMQ.o
send                                /var/tmp//ccOrrHMQ.o
accept                              /var/tmp//ccOrrHMQ.o
listen                              /var/tmp//ccOrrHMQ.o
socket                              /var/tmp//ccOrrHMQ.o
ld: fatal: Symbol referencing errors. No output written to echos
collect2: ld returned 1 exit status

I know It's linkage error and the c application could not find the related library file,but donot know how to solve it ,after one afternoon research, I find that we need to link to the socket library when compiling the c socket application on solaris.

-lmylib (lower case 'L') Search the library named mylib for unresolved
symbols (functions, global variables) when linking. The actual name of
the file will be libmylib.a, and must be found in either the default
locations for libraries or in a directory added with the -L flag.

gcc -o echos echos.c -lsocket -lnsl
and the pthread is the same thing and the thread application can be compiled in the following way
gcc -o thread-create thread-create.c -lpthread.

You can find the lib in the dir /usr/lib

lrwxrwxrwx 1 root root 25 Aug  5  2009 libpthread.so -> ../../lib/libpthread.so.1
lrwxrwxrwx 1 root root 24 Aug  5  2009 libsocket.so -> ../../lib/libsocket.so.1

Reference Materials
http://beej.us/guide/bgnet/output/html/singlepage/bgnet.html#solaris
http://www.fortunecity.com/skyscraper/arpanet/6/cc.htm
http://developers.sun.com/solaris/articles/solaris_linux_app.html

solaris bind 符号未定义的更多相关文章

  1. JQuery $未定义

    ---恢复内容开始--- JQuery $未定义 转载▼   jquery是Yii集成的,利用jquery写的代码$(document).ready(function(){// 操作列表$('.ope ...

  2. 错误: “WebForm_DoPostBackWithOptions”未定义

    无论是ASP.NET WebForm 还是 ASP.NET MVC项目,在本地程序测试没问题,但是部署在IIS上访问就会出现  错误: “WebForm_DoPostBackWithOptions”未 ...

  3. IE6 IE7 ‘JSON’ 未定义

    今天在调试javascript程序,在FireFox和Chrome没有问题,但是在IE中,一些可以,就会出现如标题的错误:‘JSON’ 未定义: 在IE6,IE7一定有此错误,以及IE能设置兼容性视图 ...

  4. 使用ajax.dll时js脚本错误-XXX未定义

    操作系统:Windows 7 IIS:7.5 ajax.dll现在用的比较少,但是以前的项目有这个,使用的时候很容易出现这个错误,因为总是会遗漏配置. 使用ajax.dll时,js脚本错误,无法调用后 ...

  5. .Net4.0的网站在IE10、IE11出现“__doPostBack未定义”的解决办法。

    方法一.浏览器设置成兼容模式. 方法二.安装服务器版的.Net40的补丁.http://download.csdn.net/detail/5653325/6642051 方法三.点击VS的工具菜单-- ...

  6. .NET4.0 __doPostBack未定义

    方法一.浏览器设置成兼容模式. 方法二.安装服务器版的.Net40的补丁.http://download.csdn.net/detail/5653325/6642051 方法三.点击VS的工具菜单-- ...

  7. “__doPostBack”未定义

    项目中发现IE10等高级浏览器报错 ASP.NET无法检测IE10,导致_doPostBack未定义JavaScript错误 为此微软工程师解释如果发布asp2.0 asp4.0发布时,这些浏览器还未 ...

  8. jquery.uploadify 异常 “__flash__removeCallback”未定义

    使用场景结合artdialog弹出框使用时发生“__flash__removeCallback”未定义,原因在于artdialog基于iframe加载的uloadify,在关闭artdialog的时候 ...

  9. IE11出现“__doPostBack未定义”的解决办法。

    方法一:浏览器设置成兼容模式,这个是超级掩耳盗铃方法,你就没想过其他人也会出这个问题. 方法二.安装服务器版的.Net40的补丁.http://download.csdn.net/detail/565 ...

随机推荐

  1. Java中的Scoket编程

    网络编程是指编写运行在多个设备(计算机)的程序,这些设备都通过网络连接起来. java.net包中提供了两种常见的网络协议的支持: TCP: TCP是传输控制协议的缩写,它保障了两个应用程序之间的可靠 ...

  2. Android 高级UI设计笔记02:可以拖动交换item位置的GridView(转载)

    如果大家不知道GridView基本使用,可以先参见:Android(java)学习笔记154:使用GridView以及重写BaseAdapter 1. 首先我们明白GridView拖拽的思路: ()根 ...

  3. git workflows

    https://www.atlassian.com/git/tutorials/comparing-workflows Comparing Workflows The array of possibl ...

  4. struts2 后台action向前端JSP传递参数的问题

    后台有个方法,里面部分代码如下: System.out.print("alter:"+user.getId()); User temp=userservice.getUserByU ...

  5. 【转载】Android使用Application总结

    Application 配置全局Context 第一步.写一个全局的单例模式的MyApplication继承自Application 覆盖onCreate ,在这个方法里面实例化Application ...

  6. markdownpad2 pro注册信息升级 破解版

    注册信息邮箱地址: Soar360@live.com 授权秘钥: GBPduHjWfJU1mZqcPM3BikjYKF6xKhlKIys3i1MU2eJHqWGImDHzWdD6xhMNLGVpbP2 ...

  7. java通过反射获取调用变量以及方法

    一:反射概念 可以通过Class类获取某个类的成员变量以及方法,并且调用之. 二:通过反射获取方法.变量.构造方法 @Test // 通过反射获取类定义的方法 public void testMeth ...

  8. Adobe Edge Animate –可重复使用的个性化按钮制作

    Adobe Edge Animate –可重复使用的个性化按钮制作 版权声明: 本文版权属于 北京联友天下科技发展有限公司. 转载的时候请注明版权和原文地址. 效果图: 工程文件中:

  9. [改善Java代码]小心switch带来的空值异常

    使用枚举定义常量时,会伴有大量的switch语句判断,目的是伪类每个枚举项解释其行为,例如: public class Client { public static void main(String[ ...

  10. hdu 4585 set应用

    #include<iostream> #include<algorithm> #include<cstring> #include<cstdio> #i ...