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. Apache以及PHP的默认编码问题解决(详解)

    如果你在网上搜索 “apache配置”,搜到的页面大多都会建议你在httpd.conf中加上这么一句:AddDefaultCharset GB2312.对于新手而且是只用GB2312编码的开发人来说, ...

  2. vs2012调试时为什么会出现clr.dll与mscordacwks.dll版本不匹配

    第一次开发wpf程序,就遇到了上述问题,最后发现是因为vs2012默认用的是.net4.5,将版本改为.net4就好了,问题解决

  3. PHP对大文件的处理思路

    需求: 现有一个1G左右的日志文件,大约有500多万行, 用php返回最后几行的内容. 在php中,对于文件的读取时,最快捷的方式莫过于使用一些诸如file.file_get_contents之类的函 ...

  4. mysql颠覆实战笔记(三)-- 用户登录(二):保存用户操作日志的方法

    版权声明:笔记整理者亡命小卒热爱自由,崇尚分享.但是本笔记源自www.jtthink.com(程序员在囧途)沈逸老师的<web级mysql颠覆实战课程 >.如需转载请尊重老师劳动,保留沈逸 ...

  5. [转]HTML accesskey 属性

    本文转自:http://www.dreamdu.com/xhtml/attribute_accesskey/ 17.2. HTML accesskey 属性 accesskey 属性  --  代表链 ...

  6. Windows 8.1 归档 —— Step 2 对新系统的少量优化

    下面是来自 iplaysoft 的优化技巧:

  7. Java Concurrency - ScheduledThreadPoolExecutor

    The Executor framework provides the ThreadPoolExecutor class to execute Callable and Runnable tasks ...

  8. sqoop-1.4.6安装配置

    1. 下载sqoop-1.4.6并解压 wget http://archive.apache.org/dist/sqoop/1.4.6/sqoop-1.4.6.bin__hadoop-2.0.4-al ...

  9. Ubuntu系统应用程序创建快捷方式的方法

    大家安装了最新版的Ubuntu 14.0系统之后可能觉得很不习惯,因为Ubuntu的桌面干干净净没有任何快捷方式,任务栏的图标拖不下来,右键点击程序图标也没有创建快捷方式的菜单选项: 那如何把自己经常 ...

  10. SoftReference

    本文介绍对象的强.软.弱和虚引用的概念.应用及其在UML中的表示. 1.对象的强.软.弱和虚引用    在JDK 1.2以前的版本中,若一个对象不被任何变量引用,那么程序就无法再使用这个对象.也就是说 ...