日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 人文社科 > 生活经验 >内容正文

生活经验

Linux环境网络库

發布時間:2023/11/27 生活经验 29 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Linux环境网络库 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

安裝libevent

官網:http://libevent.org/???

書籍:http://www.wangafu.net/~nickm/libevent-book/

Libevent參考手冊翻譯:http://blog.csdn.net/laoyi19861011/article/category/831215

Libevent參考手冊翻譯增加:http://blog.sina.com.cn/s/articlelist_1457448730_3_1.html

源碼分析:http://www.cnblogs.com/hustcat/archive/2010/08/31/1814022.html

libevent

# wget https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz

# tar xzfv? libevent-2.0.21-stable.tar.gz

# cd libevent-2.0.21-stable

# ./configure -prefix=/usr/local/libevent

# make && make install


如果其他調用event的程序安裝報錯

error while loading shared libraries: libevent-2.0.so.5: cannot open shared object file: No such file or directory

解決辦法:

先得到libevent位置

# whereis libevent?

[root@localhost test]#? whereis libevent
libevent: /usr/local/libevent


On a 32 bit system:

# ln -s /usr/local/libevent/lib/libevent-2.0.so.5 /usr/lib/libevent-2.0.so.5

On a 64 bit system:

# ln -s /usr/local/libevent/lib/libevent-2.0.so.5 /usr/lib64/libevent-2.0.so.5


如果提示“創建符號鏈接 "/usr/lib64/libevent-2.0.so.5": 文件已存在”那么就是之前安裝過,所以只要刪除之前的即可

# rm -f libevent-2.0.so.5

重新鏈接即可


其他解決方法:

那就表示系統不知道xxx.so 放在哪個目錄下。
這個時候就要在/etc/ld.so.conf中加入xxx.so所在的目錄。
一般而言,有很多so檔會在/usr/local/lib這個目錄下,所以在/etc/ld.so.conf中加入/usr/local/lib這一行,可以解決此問題。
將 /etc/ld.so.conf存檔后,還要執行「/sbin/ldconfig –v」來更新一下才會生效。


如果libevent安裝是自定義-prefix=/usr/local/libevent

# gcc socket.c -o socket -Wl,-rpath,/usr/local/libevent/lib/ -L/usr/local/libevent/lib/ -levent -I/usr/local/libevent/include/

如果libevent安裝是無-prefix

# gcc socket.c -o socket -levent?


可以使用ldd查看動態鏈接庫調用:



參考:GCC設定include和庫路徑



參考實例:

https://github.com/mike-zhang/testCodes

https://github.com/jasonish/libevent-examples

http://ishbits.googlecode.com/svn-history/r5/trunk/libevent_echosrv/

http://blog.linuxphp.org/archives/1482/

=============================================

libdatrie

http://linux.thai.net/~thep/datrie/datrie.html

#wget ftp://linux.thai.net/pub/ThaiLinux/software/libthai/libdatrie-0.2.4.tar.gz

# tar zxvf libdatrie-0.2.4.tar.gz

總結

以上是生活随笔為你收集整理的Linux环境网络库的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。