<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    Bryan

      BlogJava :: 首頁 :: 聯系 :: 聚合  :: 管理
      37 Posts :: 3 Stories :: 24 Comments :: 0 Trackbacks
    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
    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
    posted on 2011-08-25 16:33 Life is no respector of any genius. 閱讀(1226) 評論(0)  編輯  收藏

    只有注冊用戶登錄后才能發表評論。


    網站導航:
     
    主站蜘蛛池模板: 伊人久久亚洲综合影院首页| 亚洲精品一区二区三区四区乱码| 亚洲色偷偷色噜噜狠狠99网| 最近中文字幕免费完整| 久久精品国产亚洲AV麻豆~| 中文字幕无线码中文字幕免费| 亚洲天堂免费在线视频| 人妻18毛片a级毛片免费看| 国产亚洲人成A在线V网站| 中国极品美軳免费观看| 亚洲AV永久无码区成人网站 | 亚洲日本一区二区三区| 99久久精品免费精品国产| 亚洲色大成网站www永久| 亚洲一级毛片免费在线观看| 国产精品亚洲自在线播放页码| 国产99视频精品免费观看7| 亚洲乱亚洲乱妇24p| 四虎免费永久在线播放| 国产成人无码精品久久久久免费| 亚洲人成无码网站| 午夜免费1000部| 国产亚洲福利精品一区二区| 亚洲精品自在在线观看| 91福利视频免费观看| 国产亚洲精品影视在线| 亚洲人妻av伦理| 久久免费视频99| 亚洲人片在线观看天堂无码| 亚洲国产一级在线观看| 久久成人免费播放网站| 久久精品国产亚洲av麻豆图片 | 97久久免费视频| 国产精品亚洲专区在线播放| 中文字幕中韩乱码亚洲大片 | 免费福利视频导航| 亚洲国产区男人本色| 亚洲色成人中文字幕网站| 4hu四虎最新免费地址| 黄网站色成年片大免费高清| 亚洲日本在线观看|