<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. 閱讀(1225) 評論(0)  編輯  收藏

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


    網站導航:
     
    主站蜘蛛池模板: 亚洲国产成人久久综合一 | 无码免费又爽又高潮喷水的视频| 日韩国产精品亚洲а∨天堂免| 色窝窝亚洲AV网在线观看| 久久毛片免费看一区二区三区| 黄桃AV无码免费一区二区三区| 99精品视频免费| 久久国产免费一区二区三区 | 不卡视频免费在线观看| 4虎永免费最新永久免费地址| 动漫黄网站免费永久在线观看| 成人毛片免费观看| 亚洲色婷婷综合久久| 亚洲an天堂an在线观看| 亚洲国产高清在线精品一区| 美女裸免费观看网站| 18级成人毛片免费观看| 亚洲国产日韩成人综合天堂| 亚洲欧洲在线播放| 99久久婷婷免费国产综合精品| 免费A级毛片在线播放| 亚洲国产成人久久综合区| 亚洲一级毛片视频| 曰批全过程免费视频在线观看无码 | 亚洲av综合avav中文| 小说专区亚洲春色校园| 亚洲免费人成视频观看| 亚洲人精品午夜射精日韩| 久久水蜜桃亚洲AV无码精品| 国产精品久久永久免费| 亚洲精品制服丝袜四区| 黄网站色视频免费看无下截| 一二三四影视在线看片免费 | 精品久久久久久亚洲| 在线看亚洲十八禁网站| 2021免费日韩视频网| 亚洲AV无码AV男人的天堂| 亚洲午夜无码久久久久软件| 久久九九AV免费精品| 永久免费视频v片www| 久久夜色精品国产亚洲|