﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>C++博客-yesg-随笔分类-Linux</title><link>http://www.cppblog.com/yesg/category/19618.html</link><description /><language>zh-cn</language><lastBuildDate>Fri, 13 Jul 2012 07:15:50 GMT</lastBuildDate><pubDate>Fri, 13 Jul 2012 07:15:50 GMT</pubDate><ttl>60</ttl><item><title>error: expected specifier-qualifier-list before 'PQ'(suse上源码安装graphviz)</title><link>http://www.cppblog.com/yesg/archive/2012/07/10/182640.html</link><dc:creator>nk_ysg</dc:creator><author>nk_ysg</author><pubDate>Tue, 10 Jul 2012 08:43:00 GMT</pubDate><guid>http://www.cppblog.com/yesg/archive/2012/07/10/182640.html</guid><wfw:comment>http://www.cppblog.com/yesg/comments/182640.html</wfw:comment><comments>http://www.cppblog.com/yesg/archive/2012/07/10/182640.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/yesg/comments/commentRss/182640.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/yesg/services/trackbacks/182640.html</trackback:ping><description><![CDATA[<div>同事需要在suse上安装php的性能测试工具xhprof,图形化展示需要源码安装graphviz<br />选取的源码为graphviz-2.24.0.tar.gz,<br />安装步骤如下<br />1.tar xzvf graphviz-2.24.0.tar.gz<br />2.cd graphviz-2.24.0<br />3../configure<br />4.make<br />报了如下错误<br /><div>&nbsp;gcc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../../lib/common -I../../lib/gvc -I../../lib/pack -I../../lib/ortho -I../../lib/pathplan -I../../lib/graph -I../../lib/sparse -I../../lib/rbtree -I../../lib/sfdpgen -I../../lib/cdt -I/usr/local/include -g -O2 -Wno-unknown-pragmas -Wstrict-prototypes -Wpointer-arith -Wall -ffast-math -MT multispline.lo -MD -MP -MF .deps/multispline.Tpo -c multispline.c &nbsp;-fPIC -DPIC -o .libs/multispline.o</div><div>multispline.c:1228: error: expected specifier-qualifier-list before 'PQ'<br /><div>In file included from multispline.c:1224:</div><div>../../lib/ortho/fPQ.h:22:1: warning: this is the location of the previous definition</div><div>multispline.c:1234:1: warning: "N_IDX" redefined</div><div>../../lib/ortho/fPQ.h:23:1: warning: this is the location of the previous definition</div>查找multispline.c,<br />使用如下命令find . -name multispline.c&nbsp;,结果为<br /><div>./lib/neatogen/multispline.c</div><div>发现PQ定义在fPQ.h,当前路径下有fPQ.h还是无法编译<br /><div>cd graphviz-2.24.0<br /><div>&nbsp;find . -name "fPQ.h</div><div>./lib/neatogen/fPQ.h</div><div>./lib/ortho/fPQ.h</div>可能是文件不同或是被包含两次，具体没查<br /><div>cd lib/ortho/<br />mkdir -p bak<br />mv * bak<br /><br />然后cd ../neatogen/<br />单独编译neatogen运行make<br />成功<br />cd ../ortho&nbsp;<br />mv bak/*．<br /><br /><div>cd ../../<br />运行make,所有模块都可以编译了</div></div></div></div></div></div><img src ="http://www.cppblog.com/yesg/aggbug/182640.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/yesg/" target="_blank">nk_ysg</a> 2012-07-10 16:43 <a href="http://www.cppblog.com/yesg/archive/2012/07/10/182640.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>centos 5.6下面KosmosFS的安装</title><link>http://www.cppblog.com/yesg/archive/2012/07/07/182085.html</link><dc:creator>nk_ysg</dc:creator><author>nk_ysg</author><pubDate>Sat, 07 Jul 2012 08:56:00 GMT</pubDate><guid>http://www.cppblog.com/yesg/archive/2012/07/07/182085.html</guid><wfw:comment>http://www.cppblog.com/yesg/comments/182085.html</wfw:comment><comments>http://www.cppblog.com/yesg/archive/2012/07/07/182085.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/yesg/comments/commentRss/182085.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/yesg/services/trackbacks/182085.html</trackback:ping><description><![CDATA[参考文章<a href="http://blog.csdn.net/russell_tao/article/details/7207093">http://blog.csdn.net/russell_tao/article/details/7207093</a>&nbsp;<br />尝试过在centos6.0上编译不成功<br />需要安装的第三方软件如下<br /><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial; line-height: 26px; text-align: left; background-color: #ffffff; ">openssl</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial; line-height: 26px; text-align: left; background-color: #ffffff; ">openssl-devel</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial; line-height: 26px; text-align: left; background-color: #ffffff; ">xfsprogs</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial; line-height: 26px; text-align: left; background-color: #ffffff; ">xfsprogs-devel<br /></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial; line-height: 26px; text-align: left; background-color: #ffffff; ">e2fsprogs<br /></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial; line-height: 26px; text-align: left; background-color: #ffffff; ">e2fsprogs-devel<br /></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial; line-height: 26px; text-align: left; background-color: #ffffff; ">log4cpp</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial; line-height: 26px; text-align: left; background-color: #ffffff; ">boost</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial; line-height: 26px; text-align: left; background-color: #ffffff; ">boost-devel<br />安装jkd,我安装在/usr/lib/jvm/jdk1.7.0_04</p><div></div>开始安装<p>&nbsp;</p>1.wget http://kosmosfs.googlecode.com/files/kfs-0.5.tar.gz<br />2.tar xzvf kfs-0.5.tar.gz<br />3.cd kfs-0.5<br />4.mkdir build<br />5.cd build<br />6.cmake ..<br />7.make<br />8.make install<br />后面参考文章<img src ="http://www.cppblog.com/yesg/aggbug/182085.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/yesg/" target="_blank">nk_ysg</a> 2012-07-07 16:56 <a href="http://www.cppblog.com/yesg/archive/2012/07/07/182085.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>strace,ltrace功能</title><link>http://www.cppblog.com/yesg/archive/2012/07/06/181960.html</link><dc:creator>nk_ysg</dc:creator><author>nk_ysg</author><pubDate>Fri, 06 Jul 2012 11:14:00 GMT</pubDate><guid>http://www.cppblog.com/yesg/archive/2012/07/06/181960.html</guid><wfw:comment>http://www.cppblog.com/yesg/comments/181960.html</wfw:comment><comments>http://www.cppblog.com/yesg/archive/2012/07/06/181960.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/yesg/comments/commentRss/181960.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/yesg/services/trackbacks/181960.html</trackback:ping><description><![CDATA[strace a.out用来查看a.out程序运行中有哪些系统调用<br />ltrace a.out用来查看a.out运行中有哪些库函数调用<img src ="http://www.cppblog.com/yesg/aggbug/181960.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/yesg/" target="_blank">nk_ysg</a> 2012-07-06 19:14 <a href="http://www.cppblog.com/yesg/archive/2012/07/06/181960.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>（装载） linux 共享库知识整理</title><link>http://www.cppblog.com/yesg/archive/2012/07/06/181908.html</link><dc:creator>nk_ysg</dc:creator><author>nk_ysg</author><pubDate>Fri, 06 Jul 2012 08:57:00 GMT</pubDate><guid>http://www.cppblog.com/yesg/archive/2012/07/06/181908.html</guid><wfw:comment>http://www.cppblog.com/yesg/comments/181908.html</wfw:comment><comments>http://www.cppblog.com/yesg/archive/2012/07/06/181908.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/yesg/comments/commentRss/181908.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/yesg/services/trackbacks/181908.html</trackback:ping><description><![CDATA[<span style="color: #444444; font-family: Tahoma, Helvetica, SimSun, sans-serif; background-color: #ffffff; ">&nbsp;创建和使用静态库&nbsp;</span><br style="word-wrap: break-word; color: #444444; font-family: Tahoma, Helvetica, SimSun, sans-serif; background-color: #ffffff; " /><span style="color: #444444; font-family: Tahoma, Helvetica, SimSun, sans-serif; background-color: #ffffff; ">创建一个静态库是相当简单的。通常使用 ar 程序把一些目标文件（.o）组合在一起，</span><br style="word-wrap: break-word; color: #444444; font-family: Tahoma, Helvetica, SimSun, sans-serif; background-color: #ffffff; " /><span style="color: #444444; font-family: Tahoma, Helvetica, SimSun, sans-serif; background-color: #ffffff; ">成为一个单独的库，然后运行 ranlib，以给库加入一些索引信息。&nbsp;</span><br style="word-wrap: break-word; color: #444444; font-family: Tahoma, Helvetica, SimSun, sans-serif; background-color: #ffffff; " /><span style="color: #444444; font-family: Tahoma, Helvetica, SimSun, sans-serif; background-color: #ffffff; ">2&nbsp;&nbsp;创建和使用共享库</span><br style="word-wrap: break-word; color: #444444; font-family: Tahoma, Helvetica, SimSun, sans-serif; background-color: #ffffff; " /><span style="color: #444444; font-family: Tahoma, Helvetica, SimSun, sans-serif; background-color: #ffffff; ">特殊的编译和连接选项</span><br style="word-wrap: break-word; color: #444444; font-family: Tahoma, Helvetica, SimSun, sans-serif; background-color: #ffffff; " /><span style="color: #444444; font-family: Tahoma, Helvetica, SimSun, sans-serif; background-color: #ffffff; ">-D_REENTRANT&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;使得预处理器符号 _REENTRANT 被定义，这个符号激活一些宏特性。</span><br style="word-wrap: break-word; color: #444444; font-family: Tahoma, Helvetica, SimSun, sans-serif; background-color: #ffffff; " /><span style="color: #444444; font-family: Tahoma, Helvetica, SimSun, sans-serif; background-color: #ffffff; ">-fPIC&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; 选项产生位置独立的代码。由于库是在运行的时候被调入，因此这个</span><br style="word-wrap: break-word; color: #444444; font-family: Tahoma, Helvetica, SimSun, sans-serif; background-color: #ffffff; " /><span style="color: #444444; font-family: Tahoma, Helvetica, SimSun, sans-serif; background-color: #ffffff; ">&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;选项是必需的，因为在编译的时候，装入内存的地址还不知道。如果</span><br style="word-wrap: break-word; color: #444444; font-family: Tahoma, Helvetica, SimSun, sans-serif; background-color: #ffffff; " /><span style="color: #444444; font-family: Tahoma, Helvetica, SimSun, sans-serif; background-color: #ffffff; ">&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;不使用这个选项，库文件可能不会正确运行。</span><br style="word-wrap: break-word; color: #444444; font-family: Tahoma, Helvetica, SimSun, sans-serif; background-color: #ffffff; " /><span style="color: #444444; font-family: Tahoma, Helvetica, SimSun, sans-serif; background-color: #ffffff; ">-shared&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;选项告诉编译器产生共享库代码。</span><br style="word-wrap: break-word; color: #444444; font-family: Tahoma, Helvetica, SimSun, sans-serif; background-color: #ffffff; " /><span style="color: #444444; font-family: Tahoma, Helvetica, SimSun, sans-serif; background-color: #ffffff; ">-Wl,-soname&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; -Wl 告诉编译器将后面的参数传递到连接器。而 -soname 指定了</span><br style="word-wrap: break-word; color: #444444; font-family: Tahoma, Helvetica, SimSun, sans-serif; background-color: #ffffff; " /><span style="color: #444444; font-family: Tahoma, Helvetica, SimSun, sans-serif; background-color: #ffffff; ">&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;共享库的 soname。&nbsp;</span><br style="word-wrap: break-word; color: #444444; font-family: Tahoma, Helvetica, SimSun, sans-serif; background-color: #ffffff; " /><br style="word-wrap: break-word; color: #444444; font-family: Tahoma, Helvetica, SimSun, sans-serif; background-color: #ffffff; " /><span style="color: #444444; font-family: Tahoma, Helvetica, SimSun, sans-serif; background-color: #ffffff; ">&nbsp; &nbsp; ＃ 可以把库文件拷贝到 /etc/ld.so.conf 中列举出的任何目录中，并以</span><br style="word-wrap: break-word; color: #444444; font-family: Tahoma, Helvetica, SimSun, sans-serif; background-color: #ffffff; " /><span style="color: #444444; font-family: Tahoma, Helvetica, SimSun, sans-serif; background-color: #ffffff; ">root 身份运行 ldconfig；或者</span><br style="word-wrap: break-word; color: #444444; font-family: Tahoma, Helvetica, SimSun, sans-serif; background-color: #ffffff; " /><span style="color: #444444; font-family: Tahoma, Helvetica, SimSun, sans-serif; background-color: #ffffff; ">&nbsp; &nbsp; ＃ 运行 export LD_LIBRARY_PATH='pwd'，它把当前路径加到库搜索路径中去。&nbsp;</span><br style="word-wrap: break-word; color: #444444; font-family: Tahoma, Helvetica, SimSun, sans-serif; background-color: #ffffff; " /><br style="word-wrap: break-word; color: #444444; font-family: Tahoma, Helvetica, SimSun, sans-serif; background-color: #ffffff; " /><span style="color: #444444; font-family: Tahoma, Helvetica, SimSun, sans-serif; background-color: #ffffff; ">3&nbsp;&nbsp;使用高级共享库特性</span><br style="word-wrap: break-word; color: #444444; font-family: Tahoma, Helvetica, SimSun, sans-serif; background-color: #ffffff; " /><span style="color: #444444; font-family: Tahoma, Helvetica, SimSun, sans-serif; background-color: #ffffff; ">1&gt; ldd 工具</span><br style="word-wrap: break-word; color: #444444; font-family: Tahoma, Helvetica, SimSun, sans-serif; background-color: #ffffff; " /><span style="color: #444444; font-family: Tahoma, Helvetica, SimSun, sans-serif; background-color: #ffffff; ">ldd 用来显示执行文件需要哪些共享库, 共享库装载管理器在哪里找到了需要的共享库.&nbsp;</span><br style="word-wrap: break-word; color: #444444; font-family: Tahoma, Helvetica, SimSun, sans-serif; background-color: #ffffff; " /><span style="color: #444444; font-family: Tahoma, Helvetica, SimSun, sans-serif; background-color: #ffffff; ">2&gt; soname&nbsp;</span><br style="word-wrap: break-word; color: #444444; font-family: Tahoma, Helvetica, SimSun, sans-serif; background-color: #ffffff; " /><span style="color: #444444; font-family: Tahoma, Helvetica, SimSun, sans-serif; background-color: #ffffff; ">共享库的一个非常重要的，也是非常难的概念是 soname--简写共享目标名（short for shared object name）。这是一个为共享库（.so）文件而内嵌在控制数据中的名字。如前面提到的，每一个程序都有一个需要使用的库的清单。这个清单的内容是一系列库的 soname，如同 ldd 显示的那样，共享库装载器必须找到这个清单。&nbsp;</span><br style="word-wrap: break-word; color: #444444; font-family: Tahoma, Helvetica, SimSun, sans-serif; background-color: #ffffff; " /><span style="color: #444444; font-family: Tahoma, Helvetica, SimSun, sans-serif; background-color: #ffffff; ">soname 的关键功能是它提供了兼容性的标准。当要升级系统中的一个库时，并且新库的 soname 和老的库的 soname 一样，用旧库连接生成的程序，使用新的库依然能正常运行。这个特性使得在&nbsp;</span><a href="http://www.acejoy.com/forum-24-1.html" target="_blank" style="word-wrap: break-word; color: #336699; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: blue; font-family: Tahoma, Helvetica, SimSun, sans-serif; background-color: #ffffff; ">Linux</a><span style="color: #444444; font-family: Tahoma, Helvetica, SimSun, sans-serif; background-color: #ffffff; ">&nbsp;下，升级使用共享库的程序和定位错误变得十分容易。&nbsp;</span><br style="word-wrap: break-word; color: #444444; font-family: Tahoma, Helvetica, SimSun, sans-serif; background-color: #ffffff; " /><span style="color: #444444; font-family: Tahoma, Helvetica, SimSun, sans-serif; background-color: #ffffff; ">在 Linux 中，应用程序通过使用 soname，来指定所希望库的版本。库作者也可以通过保留或者改变 soname 来声明，哪些版本是相互兼容的，这使得程序员摆脱了共享库版本冲突问题的困扰。&nbsp;</span><br style="word-wrap: break-word; color: #444444; font-family: Tahoma, Helvetica, SimSun, sans-serif; background-color: #ffffff; " /><span style="color: #444444; font-family: Tahoma, Helvetica, SimSun, sans-serif; background-color: #ffffff; ">查看/usr/local/lib 目录，分析 MiniGUI 的共享库文件之间的关系&nbsp;</span><br style="word-wrap: break-word; color: #444444; font-family: Tahoma, Helvetica, SimSun, sans-serif; background-color: #ffffff; " /><span style="color: #444444; font-family: Tahoma, Helvetica, SimSun, sans-serif; background-color: #ffffff; ">3&gt; 共享库装载器&nbsp;</span><br style="word-wrap: break-word; color: #444444; font-family: Tahoma, Helvetica, SimSun, sans-serif; background-color: #ffffff; " /><span style="color: #444444; font-family: Tahoma, Helvetica, SimSun, sans-serif; background-color: #ffffff; ">当程序被调用的时候，Linux 共享库装载器（也被称为动态连接器）也自动被调用。它的作用是保证程序所需要的所有适当版本的库都被调入内存。共享库装载器名字是 ld.so 或者是 ld-linux.so，这取决于 Linux libc 的版本，它必须使用一点外部交互，才能完成自己的工作。然而它接受在环境变量和配置文件中的配置信息。&nbsp;</span><br style="word-wrap: break-word; color: #444444; font-family: Tahoma, Helvetica, SimSun, sans-serif; background-color: #ffffff; " /><span style="color: #444444; font-family: Tahoma, Helvetica, SimSun, sans-serif; background-color: #ffffff; ">文件 /etc/ld.so.conf 定义了标准系统库的路径。共享库装载器把它作为搜索路径。为了改变这个设置，必须以 root 身份运行 ldconfig 工具。这将更新 /etc/ls.so.cache 文件，这个文件其实是装载器内部使用的文件之一。&nbsp;</span><br style="word-wrap: break-word; color: #444444; font-family: Tahoma, Helvetica, SimSun, sans-serif; background-color: #ffffff; " /><span style="color: #444444; font-family: Tahoma, Helvetica, SimSun, sans-serif; background-color: #ffffff; ">可以使用许多环境变量控制共享库装载器的操作（表1-4+）。&nbsp;</span><br style="word-wrap: break-word; color: #444444; font-family: Tahoma, Helvetica, SimSun, sans-serif; background-color: #ffffff; " /><span style="color: #444444; font-family: Tahoma, Helvetica, SimSun, sans-serif; background-color: #ffffff; ">&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;表 1-4+ 共享库装载器环境变量</span><br style="word-wrap: break-word; color: #444444; font-family: Tahoma, Helvetica, SimSun, sans-serif; background-color: #ffffff; " /><span style="color: #444444; font-family: Tahoma, Helvetica, SimSun, sans-serif; background-color: #ffffff; ">变量&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;含义</span><br style="word-wrap: break-word; color: #444444; font-family: Tahoma, Helvetica, SimSun, sans-serif; background-color: #ffffff; " /><span style="color: #444444; font-family: Tahoma, Helvetica, SimSun, sans-serif; background-color: #ffffff; ">LD_AOUT_LIBRARY_PATH&nbsp; &nbsp;&nbsp; &nbsp; 除了不使用 a.out 二进制格式外，与 LD_LIBRARY_PATH 相同。</span><br style="word-wrap: break-word; color: #444444; font-family: Tahoma, Helvetica, SimSun, sans-serif; background-color: #ffffff; " /><span style="color: #444444; font-family: Tahoma, Helvetica, SimSun, sans-serif; background-color: #ffffff; ">LD_AOUT_PRELOAD&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;除了不使用 a.out 二进制格式外，与 LD_PRELOAD 相同。</span><br style="word-wrap: break-word; color: #444444; font-family: Tahoma, Helvetica, SimSun, sans-serif; background-color: #ffffff; " /><span style="color: #444444; font-family: Tahoma, Helvetica, SimSun, sans-serif; background-color: #ffffff; ">LD_KEEPDIR&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;只适用于 a.out 库；忽略由它们指定的目录。</span><br style="word-wrap: break-word; color: #444444; font-family: Tahoma, Helvetica, SimSun, sans-serif; background-color: #ffffff; " /><span style="color: #444444; font-family: Tahoma, Helvetica, SimSun, sans-serif; background-color: #ffffff; ">LD_LIBRARY_PATH&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;将其他目录加入库搜索路径。它的内容应该是由冒号</span><br style="word-wrap: break-word; color: #444444; font-family: Tahoma, Helvetica, SimSun, sans-serif; background-color: #ffffff; " /><span style="color: #444444; font-family: Tahoma, Helvetica, SimSun, sans-serif; background-color: #ffffff; ">&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;分隔的目录列表，与可执行文件的 PATH 变量具有相同的格式。</span><br style="word-wrap: break-word; color: #444444; font-family: Tahoma, Helvetica, SimSun, sans-serif; background-color: #ffffff; " /><span style="color: #444444; font-family: Tahoma, Helvetica, SimSun, sans-serif; background-color: #ffffff; ">&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;如果调用设置用户 ID 或者进程 ID 的程序，该变量被忽略。</span><br style="word-wrap: break-word; color: #444444; font-family: Tahoma, Helvetica, SimSun, sans-serif; background-color: #ffffff; " /><span style="color: #444444; font-family: Tahoma, Helvetica, SimSun, sans-serif; background-color: #ffffff; ">LD_NOWARN&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;只适用于 a.out 库；当改变版本号是，发出警告信息。</span><br style="word-wrap: break-word; color: #444444; font-family: Tahoma, Helvetica, SimSun, sans-serif; background-color: #ffffff; " /><span style="color: #444444; font-family: Tahoma, Helvetica, SimSun, sans-serif; background-color: #ffffff; ">LD_PRELOAD&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;首先装入用户定义的库，使得它们有机会覆盖或者重新定义标准库。</span><br style="word-wrap: break-word; color: #444444; font-family: Tahoma, Helvetica, SimSun, sans-serif; background-color: #ffffff; " /><span style="color: #444444; font-family: Tahoma, Helvetica, SimSun, sans-serif; background-color: #ffffff; ">&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;使用空格分开多个入口。对于设置用户 ID 或者进程 ID 的程序，</span><br style="word-wrap: break-word; color: #444444; font-family: Tahoma, Helvetica, SimSun, sans-serif; background-color: #ffffff; " /><span style="color: #444444; font-family: Tahoma, Helvetica, SimSun, sans-serif; background-color: #ffffff; ">&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;只有被标记过的库才被首先装入。在 /etc/ld.so.perload 中指定</span><br style="word-wrap: break-word; color: #444444; font-family: Tahoma, Helvetica, SimSun, sans-serif; background-color: #ffffff; " /><span style="color: #444444; font-family: Tahoma, Helvetica, SimSun, sans-serif; background-color: #ffffff; ">&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;了全局版本号，该文件不遵守这个限制。&nbsp;</span><br style="word-wrap: break-word; color: #444444; font-family: Tahoma, Helvetica, SimSun, sans-serif; background-color: #ffffff; " /><br style="word-wrap: break-word; color: #444444; font-family: Tahoma, Helvetica, SimSun, sans-serif; background-color: #ffffff; " /><span style="color: #444444; font-family: Tahoma, Helvetica, SimSun, sans-serif; background-color: #ffffff; ">4&gt; 使用 dlopen&nbsp;</span><br style="word-wrap: break-word; color: #444444; font-family: Tahoma, Helvetica, SimSun, sans-serif; background-color: #ffffff; " /><span style="color: #444444; font-family: Tahoma, Helvetica, SimSun, sans-serif; background-color: #ffffff; ">&nbsp; &nbsp; 另外一个强大的库函数是 dlopen()。该函数将打开一个新库，并把它装入内存。该函数主要用来加载库中的符号，这些符号在编译的时候是不知道的。比如 Apache Web&nbsp;</span><a href="http://www.acejoy.com/forum-9-1.html" target="_blank" style="word-wrap: break-word; color: #336699; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: blue; font-family: Tahoma, Helvetica, SimSun, sans-serif; background-color: #ffffff; ">服务器</a><span style="color: #444444; font-family: Tahoma, Helvetica, SimSun, sans-serif; background-color: #ffffff; ">利用这个函数在运行过程中加载模块，这为它提供了额外的能力。一个配置文件控制了加载模块的过程。这种机制使得在系统中添加或者删除一个模块时，都不需要重新编译了。&nbsp;</span><br style="word-wrap: break-word; color: #444444; font-family: Tahoma, Helvetica, SimSun, sans-serif; background-color: #ffffff; " /><span style="color: #444444; font-family: Tahoma, Helvetica, SimSun, sans-serif; background-color: #ffffff; ">&nbsp; &nbsp; 可以在自己的程序中使用 dlopen()。dlopen() 在 dlfcn.h 中定义，并在 dl 库中实现。它需要两个参数：一个文件名和一个标志。文件名可以是我们学习过的库中的 soname。标志指明是否立刻计算库的依赖性。如果设置为 RTLD_NOW 的话，则立刻计算；如果设置的是 RTLD_LAZY，则在需要的时候才计算。另外，可以指定 RTLD_GLOBAL，它使得那些在以后才加载的库可以获得其中的符号。&nbsp;</span><br style="word-wrap: break-word; color: #444444; font-family: Tahoma, Helvetica, SimSun, sans-serif; background-color: #ffffff; " /><span style="color: #444444; font-family: Tahoma, Helvetica, SimSun, sans-serif; background-color: #ffffff; ">&nbsp; &nbsp; 当库被装入后，可以把 dlopen() 返回的句柄作为给 dlsym() 的第一个参数，以获得符号在库中的地址。使用这个地址，就可以获得库中特定函数的指针，并且调用装载库中的相应函数。 作者：perfectpdl 发表于2011-12-25 21:40:34&nbsp;</span><a href="http://blog.csdn.net/perfectpdl/article/details/7101721" target="_blank" style="word-wrap: break-word; color: #336699; font-family: Tahoma, Helvetica, SimSun, sans-serif; background-color: #ffffff; ">原文链接</a>&nbsp;<img src ="http://www.cppblog.com/yesg/aggbug/181908.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/yesg/" target="_blank">nk_ysg</a> 2012-07-06 16:57 <a href="http://www.cppblog.com/yesg/archive/2012/07/06/181908.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>(转载)库函数和系统调用 </title><link>http://www.cppblog.com/yesg/archive/2012/07/06/181885.html</link><dc:creator>nk_ysg</dc:creator><author>nk_ysg</author><pubDate>Fri, 06 Jul 2012 08:18:00 GMT</pubDate><guid>http://www.cppblog.com/yesg/archive/2012/07/06/181885.html</guid><wfw:comment>http://www.cppblog.com/yesg/comments/181885.html</wfw:comment><comments>http://www.cppblog.com/yesg/archive/2012/07/06/181885.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/yesg/comments/commentRss/181885.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/yesg/services/trackbacks/181885.html</trackback:ping><description><![CDATA[<table cellspacing="0" cellpadding="0" style="word-wrap: break-word; empty-cells: show; border-collapse: collapse; table-layout: fixed; width: 1662px; color: #444444; font-family: Tahoma, Helvetica, SimSun, sans-serif; font-size: 12px; line-height: 18px; background-color: #ffffff; "><tbody style="word-wrap: break-word; "><tr style="word-wrap: break-word; "><td id="postmessage_9839" style="word-wrap: break-word; font-size: 14px; ">系统调用（system call）是操作系统内核提供的函数，在内核态运行（kernel mode），属于函数中的低等下人，终身代号9527，虽然低等，但是谁也离不开他们，因为离开他们就没办法和内核打交道了，没办法和内核打交道就什么都歇菜了。。。<br style="word-wrap: break-word; " />linux3.0.0-14的系统调用有346个，可以在源码的 linux-3.0/arch/x86/kernel/syscall_table_32.S文件中找到所有的系统调用编号，如果以汇编的方法调用这些系统函数，那么放在EAX寄存器里面的值就是想要调用的函数的号码，把前20个贴在下面了，很多貌似很熟悉的吧：）ENTRY(sys_call_table)<br /><div>&nbsp; &nbsp; &nbsp; &nbsp; .long sys_restart_syscall &nbsp; &nbsp; &nbsp; &nbsp;/* 0 - old "setup()" system call, used for restarting */</div><div>&nbsp; &nbsp; &nbsp; &nbsp; .long sys_exit</div><div>&nbsp; &nbsp; &nbsp; &nbsp; .long ptregs_fork</div><div>&nbsp; &nbsp; &nbsp; &nbsp; .long sys_read</div><div>&nbsp; &nbsp; &nbsp; &nbsp; .long sys_write</div><div>&nbsp; &nbsp; &nbsp; &nbsp; .long sys_open &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;/* 5 */</div><div>&nbsp; &nbsp; &nbsp; &nbsp; .long sys_close</div><div>&nbsp; &nbsp; &nbsp; &nbsp; .long sys_waitpid</div><div>&nbsp; &nbsp; &nbsp; &nbsp; .long sys_creat</div><div>&nbsp; &nbsp; &nbsp; &nbsp; .long sys_link</div><div>&nbsp; &nbsp; &nbsp; &nbsp; .long sys_unlink &nbsp; &nbsp; &nbsp; &nbsp;/* 10 */</div><div>&nbsp; &nbsp; &nbsp; &nbsp; .long ptregs_execve</div><div>&nbsp; &nbsp; &nbsp; &nbsp; .long sys_chdir</div><div>&nbsp; &nbsp; &nbsp; &nbsp; .long sys_time</div><div>&nbsp; &nbsp; &nbsp; &nbsp; .long sys_mknod</div><div>&nbsp; &nbsp; &nbsp; &nbsp; .long sys_chmod &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;/* 15 */</div><div>&nbsp; &nbsp; &nbsp; &nbsp; .long sys_lchown16</div><div>&nbsp; &nbsp; &nbsp; &nbsp; .long sys_ni_syscall &nbsp; &nbsp; &nbsp; &nbsp;/* old break syscall holder */</div><div>&nbsp; &nbsp; &nbsp; &nbsp; .long sys_stat</div><div>&nbsp; &nbsp; &nbsp; &nbsp; .long sys_lseek</div><div>&nbsp; &nbsp; &nbsp; &nbsp; .long sys_getpid &nbsp; &nbsp; &nbsp; &nbsp;/* 20 */<br /><br /><span style="line-height: 21px; ">库函数是在系统调用上的一层包装，运行在用户态（user mode），打个比方吧，库函数相当于包工头，系统调用是工人，我们可以自己找工人分任务，但一般是把任务摊给包工头，包工头再去给工人分任务。</span><br style="word-wrap: break-word; line-height: 21px; " /><span style="line-height: 21px; ">所以虽然最终所有的工作都是系统调用做的，但是我们更通常的做法是调用库函数，有以下几个原因：</span><br style="word-wrap: break-word; line-height: 21px; " /><br style="word-wrap: break-word; line-height: 21px; " /><ul type="1" style="word-wrap: break-word; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 14px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 21px; "><li style="word-wrap: break-word; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 2em; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: decimal; list-style-position: initial; list-style-image: initial; ">库函数提供了抽象，抽象是个好东西，可以让我们把更多的注意力集中在要解决问题的核心。</li><li style="word-wrap: break-word; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 2em; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: decimal; list-style-position: initial; list-style-image: initial; ">库函数给我们提供的接口更人性化，所以调用起来更方便。</li><li style="word-wrap: break-word; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 2em; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: decimal; list-style-position: initial; list-style-image: initial; ">调用库函数更安全，内存管理不用自己太操心。</li><li style="word-wrap: break-word; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 2em; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: decimal; list-style-position: initial; list-style-image: initial; ">调用库函数效率更高，程序跑的更快。虽然库函数最终是调用系统函数，但是库函数会比我们用更好的方式方法调用系统函数。<br /><br /><br />例子可以参考这篇文章<a href="http://blog.csdn.net/high_high/article/details/7102081">http://blog.csdn.net/high_high/article/details/7102081</a></li></ul></div></td></tr></tbody></table><img src ="http://www.cppblog.com/yesg/aggbug/181885.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/yesg/" target="_blank">nk_ysg</a> 2012-07-06 16:18 <a href="http://www.cppblog.com/yesg/archive/2012/07/06/181885.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>slice2cpp: error while loading shared libraries: libSlice.so.34: cannot open shared object file: No such file or directory</title><link>http://www.cppblog.com/yesg/archive/2012/07/05/181487.html</link><dc:creator>nk_ysg</dc:creator><author>nk_ysg</author><pubDate>Thu, 05 Jul 2012 09:26:00 GMT</pubDate><guid>http://www.cppblog.com/yesg/archive/2012/07/05/181487.html</guid><wfw:comment>http://www.cppblog.com/yesg/comments/181487.html</wfw:comment><comments>http://www.cppblog.com/yesg/archive/2012/07/05/181487.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/yesg/comments/commentRss/181487.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/yesg/services/trackbacks/181487.html</trackback:ping><description><![CDATA[<div>export LD_LIBRARY_PATH=/usr/local/lib64<br />即可就是把libSlice.so.34库的位置找出来</div><img src ="http://www.cppblog.com/yesg/aggbug/181487.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/yesg/" target="_blank">nk_ysg</a> 2012-07-05 17:26 <a href="http://www.cppblog.com/yesg/archive/2012/07/05/181487.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>google protobuf的编译</title><link>http://www.cppblog.com/yesg/archive/2012/07/05/181450.html</link><dc:creator>nk_ysg</dc:creator><author>nk_ysg</author><pubDate>Thu, 05 Jul 2012 03:11:00 GMT</pubDate><guid>http://www.cppblog.com/yesg/archive/2012/07/05/181450.html</guid><wfw:comment>http://www.cppblog.com/yesg/comments/181450.html</wfw:comment><comments>http://www.cppblog.com/yesg/archive/2012/07/05/181450.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/yesg/comments/commentRss/181450.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/yesg/services/trackbacks/181450.html</trackback:ping><description><![CDATA[C++的编译<br />1.<span style="font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace; font-size: 12px; line-height: normal; background-color: #e5ecf9; ">svn checkout&nbsp;</span><strong style="font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace; font-size: 12px; line-height: normal; background-color: #e5ecf9; "><em>http</em></strong><span style="font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace; font-size: 12px; line-height: normal; background-color: #e5ecf9; ">://protobuf.googlecode.com/svn/trunk/ protobuf<br />2.cd protobuf<br />3../autogen.sh<br />4.autoconf产生configure脚本<br />5../configure<br />6.make &amp;&amp; make check &amp;&amp; make install<br /><br />Python Install<br />1.python setup.py test<br />2.python setup.py install</span><img src ="http://www.cppblog.com/yesg/aggbug/181450.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/yesg/" target="_blank">nk_ysg</a> 2012-07-05 11:11 <a href="http://www.cppblog.com/yesg/archive/2012/07/05/181450.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title> 内存检测工具valgrind</title><link>http://www.cppblog.com/yesg/archive/2012/07/03/181274.html</link><dc:creator>nk_ysg</dc:creator><author>nk_ysg</author><pubDate>Tue, 03 Jul 2012 09:49:00 GMT</pubDate><guid>http://www.cppblog.com/yesg/archive/2012/07/03/181274.html</guid><wfw:comment>http://www.cppblog.com/yesg/comments/181274.html</wfw:comment><comments>http://www.cppblog.com/yesg/archive/2012/07/03/181274.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/yesg/comments/commentRss/181274.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/yesg/services/trackbacks/181274.html</trackback:ping><description><![CDATA[参考如下文章<br /><a href="http://blog.csdn.net/hbhhww/article/details/7168507">http://blog.csdn.net/hbhhww/article/details/7168507<br /></a><a href="http://rdc.taobao.com/blog/cs/?p=455">http://rdc.taobao.com/blog/cs/?p=455</a><img src ="http://www.cppblog.com/yesg/aggbug/181274.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/yesg/" target="_blank">nk_ysg</a> 2012-07-03 17:49 <a href="http://www.cppblog.com/yesg/archive/2012/07/03/181274.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Linux下面编译gtest步骤</title><link>http://www.cppblog.com/yesg/archive/2012/06/30/180922.html</link><dc:creator>nk_ysg</dc:creator><author>nk_ysg</author><pubDate>Sat, 30 Jun 2012 13:27:00 GMT</pubDate><guid>http://www.cppblog.com/yesg/archive/2012/06/30/180922.html</guid><wfw:comment>http://www.cppblog.com/yesg/comments/180922.html</wfw:comment><comments>http://www.cppblog.com/yesg/archive/2012/06/30/180922.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/yesg/comments/commentRss/180922.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/yesg/services/trackbacks/180922.html</trackback:ping><description><![CDATA[编译步骤如下<br />1.使用svn下载源码<br /><div>svn checkout http://googletest.googlecode.com/svn/trunk/ googletest<br />2.cd googletest查看README里面的Setting up the Build<br />3.编译方式分两种，<br />一种使用gmake<br /><div>&nbsp;g++ -I${GTEST_DIR}/include -I${GTEST_DIR} -c ${GTEST_DIR}/src/gtest-all.cc<br /><div>ar -rv libgtest.a gtest-all.o<br />这里${GTEST_DIR}为当前目录于是命令行为<br />g++ -I./include -I./ -c ./src/gtest-all.cc<br />ar -rv libgtest.a gtest-all.o<br />另一种使用cmake</div></div><div>&nbsp;mkdir mybuild &nbsp; &nbsp; &nbsp; # Create a directory to hold the build output.</div><div>&nbsp; cd mybuild</div><div>&nbsp; cmake ${GTEST_DIR} &nbsp;# Generate native build scripts.</div><div></div><div>If you want to build Google Test's samples, you should replace the</div><div>last command with</div><div></div><div>&nbsp; cmake -Dgtest_build_samples=ON ${GTEST_DIR}<br />我们如下<br />mkdir build<br />cd build<br />cmake&nbsp;-Dgtest_build_samples=ON ..<br />生成Makefile,运行make</div><div></div></div><img src ="http://www.cppblog.com/yesg/aggbug/180922.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/yesg/" target="_blank">nk_ysg</a> 2012-06-30 21:27 <a href="http://www.cppblog.com/yesg/archive/2012/06/30/180922.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>(转载）-bash: scp: command not found问题解决</title><link>http://www.cppblog.com/yesg/archive/2012/06/29/180748.html</link><dc:creator>nk_ysg</dc:creator><author>nk_ysg</author><pubDate>Fri, 29 Jun 2012 04:32:00 GMT</pubDate><guid>http://www.cppblog.com/yesg/archive/2012/06/29/180748.html</guid><wfw:comment>http://www.cppblog.com/yesg/comments/180748.html</wfw:comment><comments>http://www.cppblog.com/yesg/archive/2012/06/29/180748.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/yesg/comments/commentRss/180748.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/yesg/services/trackbacks/180748.html</trackback:ping><description><![CDATA[<p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; text-indent: 2em; color: #333333; font-family: Verdana, Arial, Tahoma; line-height: 25px; background-color: #ffffff; ">为了尝鲜，CentOS 6.0一出来，就立马安装了。由于选择的是最小安装，有很多包都没有安装，因此一些常用的命令也不支持，如下：</p><pre style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; font-family: 'Courier New', monospace; font-size: 12px; width: 712px; overflow-x: auto; overflow-y: auto; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #ffffff; color: #333333; line-height: 25px; "><div id="codeCtrl_1" style="padding-left: 10px; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 3em !important; border-left-width: 3px; border-left-style: solid; border-left-color: #146b00; color: #999999; "><a id="view_1" href="http://www.sunchis.com/html/os/linux/2011/0803/347.html" style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; color: #999999; text-decoration: none; background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; border-image: initial; background-position: initial initial; background-repeat: initial initial; ">view plain</a>&nbsp;&nbsp;&nbsp;<span id="clipinner" style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; position: relative; width: 100px; "><a href="http://www.sunchis.com/html/os/linux/2011/0803/347.html#" style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; color: #999999; text-decoration: none; background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; border-image: initial; background-position: initial initial; background-repeat: initial initial; ">copy</a><embed width="100" height="20" type="application/x-shockwave-flash" wmode="transparent" swliveconnect="true" allowscriptaccess="sameDomain" menu="false" src="http://www.sunchis.com/public/clipboard.swf" devicefont="false" id="clipboardswf_1" name="clipboardswf_1" style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; position: absolute; left: 0px; top: 0px; "></span></div><ol style="padding-top: 5px; padding-right: 0px; padding-bottom: 5px; padding-left: 0px; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 1px !important; margin-left: 3em !important; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: solid; border-width: initial; border-color: initial; border-image: initial; list-style-position: initial; list-style-image: initial; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #f7f7f7; color: #5c5c5c; border-left-width: 3px; border-left-color: #146b00; "><li style="padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; border-image: initial; list-style-type: decimal-leading-zero; list-style-image: initial; list-style-position: outside !important; color: inherit; line-height: 1.3em; "><span style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; border-image: initial; color: black; background-color: inherit; "><span style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; border-image: initial; background-color: inherit; ">#&nbsp;scp&nbsp;</span></span></li><li style="padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; border-image: initial; list-style-type: decimal-leading-zero; list-style-image: initial; list-style-position: outside !important; line-height: 1.3em; "><span style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; border-image: initial; color: black; background-color: inherit; ">-bash:&nbsp;scp:&nbsp;command&nbsp;not&nbsp;found&nbsp;</span></li></ol></pre><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; text-indent: 2em; color: #333333; font-family: Verdana, Arial, Tahoma; line-height: 25px; background-color: #ffffff; ">这个问题很容易解决，我在一台运行正常的CentOS 5.6服务器上找到了scp所在的包：</p><pre style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; font-family: 'Courier New', monospace; font-size: 12px; width: 712px; overflow-x: auto; overflow-y: auto; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #ffffff; color: #333333; line-height: 25px; "><div id="codeCtrl_2" style="padding-left: 10px; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 3em !important; border-left-width: 3px; border-left-style: solid; border-left-color: #146b00; color: #999999; "><a id="view_2" href="http://www.sunchis.com/html/os/linux/2011/0803/347.html" style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; color: #999999; text-decoration: none; background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; border-image: initial; background-position: initial initial; background-repeat: initial initial; ">view plain</a>&nbsp;&nbsp;&nbsp;<span id="clipinner" style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; position: relative; width: 100px; "><a href="http://www.sunchis.com/html/os/linux/2011/0803/347.html#" style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; color: #999999; text-decoration: none; background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; border-image: initial; background-position: initial initial; background-repeat: initial initial; ">copy</a><embed width="100" height="20" type="application/x-shockwave-flash" wmode="transparent" swliveconnect="true" allowscriptaccess="sameDomain" menu="false" src="http://www.sunchis.com/public/clipboard.swf" devicefont="false" id="clipboardswf_2" name="clipboardswf_2" style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; position: absolute; left: 0px; top: 0px; "></span></div><ol style="padding-top: 5px; padding-right: 0px; padding-bottom: 5px; padding-left: 0px; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 1px !important; margin-left: 3em !important; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: solid; border-width: initial; border-color: initial; border-image: initial; list-style-position: initial; list-style-image: initial; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #f7f7f7; color: #5c5c5c; border-left-width: 3px; border-left-color: #146b00; "><li style="padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; border-image: initial; list-style-type: decimal-leading-zero; list-style-image: initial; list-style-position: outside !important; color: inherit; line-height: 1.3em; "><span style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; border-image: initial; color: #339966; background-color: inherit; ">######&nbsp;以下命令在运行正常的CentOS&nbsp;5.6上执行</span><span style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; border-image: initial; color: black; background-color: inherit; ">&nbsp;</span></li><li style="padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; border-image: initial; list-style-type: decimal-leading-zero; list-style-image: initial; list-style-position: outside !important; line-height: 1.3em; "><span style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; border-image: initial; color: black; background-color: inherit; ">#&nbsp;which&nbsp;scp&nbsp;</span></li><li style="padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; border-image: initial; list-style-type: decimal-leading-zero; list-style-image: initial; list-style-position: outside !important; color: inherit; line-height: 1.3em; "><span style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; border-image: initial; color: black; background-color: inherit; ">/usr/bin/scp&nbsp;</span></li><li style="padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; border-image: initial; list-style-type: decimal-leading-zero; list-style-image: initial; list-style-position: outside !important; line-height: 1.3em; ">&nbsp;</li><li style="padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; border-image: initial; list-style-type: decimal-leading-zero; list-style-image: initial; list-style-position: outside !important; color: inherit; line-height: 1.3em; "><span style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; border-image: initial; color: black; background-color: inherit; ">#&nbsp;rpm&nbsp;-qf&nbsp;/usr/bin/scp&nbsp;</span></li><li style="padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; border-image: initial; list-style-type: decimal-leading-zero; list-style-image: initial; list-style-position: outside !important; line-height: 1.3em; "><span style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; border-image: initial; color: black; background-color: inherit; ">openssh-clients-4.3p2-72.el5&nbsp;</span></li></ol></pre><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; text-indent: 2em; color: #333333; font-family: Verdana, Arial, Tahoma; line-height: 25px; background-color: #ffffff; ">哈哈，查到scp所在的包是openssh-clients了，没啥可说的，那就安装了。</p><pre style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; font-family: 'Courier New', monospace; font-size: 12px; width: 712px; overflow-x: auto; overflow-y: auto; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #ffffff; color: #333333; line-height: 25px; "><div id="codeCtrl_3" style="padding-left: 10px; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 3em !important; border-left-width: 3px; border-left-style: solid; border-left-color: #146b00; color: #999999; "><a id="view_3" href="http://www.sunchis.com/html/os/linux/2011/0803/347.html" style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; color: #999999; text-decoration: none; background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; border-image: initial; background-position: initial initial; background-repeat: initial initial; ">view plain</a>&nbsp;&nbsp;&nbsp;<span id="clipinner" style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; position: relative; width: 100px; "><a href="http://www.sunchis.com/html/os/linux/2011/0803/347.html#" style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; color: #999999; text-decoration: none; background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; border-image: initial; background-position: initial initial; background-repeat: initial initial; ">copy</a><embed width="100" height="20" type="application/x-shockwave-flash" wmode="transparent" swliveconnect="true" allowscriptaccess="sameDomain" menu="false" src="http://www.sunchis.com/public/clipboard.swf" devicefont="false" id="clipboardswf_3" name="clipboardswf_3" style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; position: absolute; left: 0px; top: 0px; "></span></div><ol style="padding-top: 5px; padding-right: 0px; padding-bottom: 5px; padding-left: 0px; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 1px !important; margin-left: 3em !important; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: solid; border-width: initial; border-color: initial; border-image: initial; list-style-position: initial; list-style-image: initial; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #f7f7f7; color: #5c5c5c; border-left-width: 3px; border-left-color: #146b00; "><li style="padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; border-image: initial; list-style-type: decimal-leading-zero; list-style-image: initial; list-style-position: outside !important; color: inherit; line-height: 1.3em; "><span style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; border-image: initial; color: black; background-color: inherit; "><span style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; border-image: initial; background-color: inherit; ">#&nbsp;yum&nbsp;install&nbsp;openssh-clients&nbsp;</span></span></li><li style="padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; border-image: initial; list-style-type: decimal-leading-zero; list-style-image: initial; list-style-position: outside !important; line-height: 1.3em; "><span style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; border-image: initial; color: black; background-color: inherit; ">或者从光盘上安装&nbsp;</span></li><li style="padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; border-image: initial; list-style-type: decimal-leading-zero; list-style-image: initial; list-style-position: outside !important; color: inherit; line-height: 1.3em; "><span style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; border-image: initial; color: black; background-color: inherit; ">#&nbsp;rpm&nbsp;-ivh&nbsp;libedit-2.11-4.20080712cvs.1.el6.x86_64&nbsp;</span></li><li style="padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; border-image: initial; list-style-type: decimal-leading-zero; list-style-image: initial; list-style-position: outside !important; line-height: 1.3em; "><span style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; border-image: initial; color: black; background-color: inherit; ">#&nbsp;rpm&nbsp;-ivh&nbsp;openssh-clients-5.3p1-20.el6.x86_64&nbsp;</span></li></ol></pre><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; text-indent: 2em; color: #333333; font-family: Verdana, Arial, Tahoma; line-height: 25px; background-color: #ffffff; ">至此，scp命令可以执行了。</p><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; text-indent: 2em; color: #333333; font-family: Verdana, Arial, Tahoma; line-height: 25px; background-color: #ffffff; ">需要注意的是，上述用到的包名请根据自己的情况进行调整。</p><img src ="http://www.cppblog.com/yesg/aggbug/180748.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/yesg/" target="_blank">nk_ysg</a> 2012-06-29 12:32 <a href="http://www.cppblog.com/yesg/archive/2012/06/29/180748.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>工作用的Makefile模板</title><link>http://www.cppblog.com/yesg/archive/2012/06/26/180285.html</link><dc:creator>nk_ysg</dc:creator><author>nk_ysg</author><pubDate>Tue, 26 Jun 2012 03:31:00 GMT</pubDate><guid>http://www.cppblog.com/yesg/archive/2012/06/26/180285.html</guid><wfw:comment>http://www.cppblog.com/yesg/comments/180285.html</wfw:comment><comments>http://www.cppblog.com/yesg/archive/2012/06/26/180285.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/yesg/comments/commentRss/180285.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/yesg/services/trackbacks/180285.html</trackback:ping><description><![CDATA[<p style="color: #4b4b4b; font-family: georgia, verdana, Arial, helvetica, sans-seriff; font-size: 13px; line-height: 20px; text-align: left; background-color: #ffffff; ">一直看别人写的博客，自己动气手来,参考别人的文章写了个Makefile模板，结果用了一个多小时，果然是动手能力太差了以后要多写。<br /></p><div style="color: #4b4b4b; font-family: georgia, verdana, Arial, helvetica, sans-seriff; font-size: 13px; line-height: 20px; text-align: left; background-color: #eeeeee; border-bottom-color: #cccccc; border-bottom-width: 1px; border-bottom-style: solid; border-left-color: #cccccc; border-left-width: 1px; border-left-style: solid; padding-bottom: 4px; padding-left: 4px; width: 597px; padding-right: 5px; word-break: break-all; border-top-color: #cccccc; border-top-width: 1px; border-top-style: solid; border-right-color: #cccccc; border-right-width: 1px; border-right-style: solid; padding-top: 4px; "><img align="top" src="http://www.cppblog.com/Images/OutliningIndicators/None.gif" alt="" /><span style="color: #000000; ">CC&nbsp;</span><span style="color: #000000; ">=</span><span style="color: #000000; ">&nbsp;gcc<br /><img align="top" src="http://www.cppblog.com/Images/OutliningIndicators/None.gif" alt="" />CXX&nbsp;</span><span style="color: #000000; ">=</span><span style="color: #000000; ">&nbsp;g</span><span style="color: #000000; ">++</span><span style="color: #000000; "><br /><img align="top" src="http://www.cppblog.com/Images/OutliningIndicators/None.gif" alt="" />INC_PATH&nbsp;</span><span style="color: #000000; ">=</span>&nbsp;<span style="color: #000000; ">-</span><span style="color: #000000; ">I<br /><img align="top" src="http://www.cppblog.com/Images/OutliningIndicators/None.gif" alt="" />CXXFLAGS&nbsp;</span><span style="color: #000000; ">=</span>&nbsp;<span style="color: #000000; ">-</span><span style="color: #000000; ">pg&nbsp;</span><span style="color: #000000; ">-</span><span style="color: #000000; ">g&nbsp;</span><span style="color: #000000; ">-</span><span style="color: #000000; ">Wall&nbsp;$(INC_PATH)<br /><img align="top" src="http://www.cppblog.com/Images/OutliningIndicators/None.gif" alt="" />RM&nbsp;</span><span style="color: #000000; ">=</span><span style="color: #000000; ">&nbsp;rm&nbsp;</span><span style="color: #000000; ">-</span><span style="color: #000000; ">rf<br /><img align="top" src="http://www.cppblog.com/Images/OutliningIndicators/None.gif" alt="" />SVR_SRC&nbsp;</span><span style="color: #000000; ">=</span><span style="color: #000000; ">&nbsp;$(wildcard&nbsp;</span><span style="color: #000000; ">*</span><span style="color: #000000; ">.cpp)<br /><img align="top" src="http://www.cppblog.com/Images/OutliningIndicators/None.gif" alt="" />SVR_OBJ&nbsp;</span><span style="color: #000000; ">=</span><span style="color: #000000; ">&nbsp;$(addprefix&nbsp;.</span><span style="color: #000000; ">/</span><span style="color: #000000; ">,$(subst&nbsp;.cpp,.o,$(SVR_SRC)))<br /><img align="top" src="http://www.cppblog.com/Images/OutliningIndicators/None.gif" alt="" /><br /><img align="top" src="http://www.cppblog.com/Images/OutliningIndicators/None.gif" alt="" />AR&nbsp;</span><span style="color: #000000; ">=</span><span style="color: #000000; ">&nbsp;ar&nbsp;</span><span style="color: #000000; ">-</span><span style="color: #000000; ">curs<br /><img align="top" src="http://www.cppblog.com/Images/OutliningIndicators/None.gif" alt="" />TARGET&nbsp;</span><span style="color: #000000; ">=</span><span style="color: #000000; ">&nbsp;test<br /><img align="top" src="http://www.cppblog.com/Images/OutliningIndicators/None.gif" alt="" />LDFLAGS&nbsp;</span><span style="color: #000000; ">=</span><span style="color: #000000; "><br /><img align="top" src="http://www.cppblog.com/Images/OutliningIndicators/None.gif" alt="" /><br /><img align="top" src="http://www.cppblog.com/Images/OutliningIndicators/None.gif" alt="" />.PHONY:&nbsp;all&nbsp;clean<br /><img align="top" src="http://www.cppblog.com/Images/OutliningIndicators/None.gif" alt="" /><br /><img align="top" src="http://www.cppblog.com/Images/OutliningIndicators/None.gif" alt="" />all&nbsp;:&nbsp;$(TARGET)<br /><img align="top" src="http://www.cppblog.com/Images/OutliningIndicators/None.gif" alt="" /><br /><img align="top" src="http://www.cppblog.com/Images/OutliningIndicators/None.gif" alt="" />$(TARGET)&nbsp;:&nbsp;$(SVR_OBJ)<br /><img align="top" src="http://www.cppblog.com/Images/OutliningIndicators/None.gif" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$(CXX)&nbsp;</span><span style="color: #000000; ">-</span><span style="color: #000000; ">o&nbsp;&nbsp;$@&nbsp;$(SVR_OBJ)&nbsp;$(CPPFLAGS)&nbsp;$(LDFLAGS)&nbsp;<br /><img align="top" src="http://www.cppblog.com/Images/OutliningIndicators/None.gif" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br /><img align="top" src="http://www.cppblog.com/Images/OutliningIndicators/None.gif" alt="" /></span><span style="color: #000000; ">%</span><span style="color: #000000; ">.o&nbsp;:&nbsp;</span><span style="color: #000000; ">%</span><span style="color: #000000; ">.cpp<br /><img align="top" src="http://www.cppblog.com/Images/OutliningIndicators/None.gif" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$(CXX)&nbsp;</span><span style="color: #000000; ">-</span><span style="color: #000000; ">o&nbsp;$@&nbsp;</span><span style="color: #000000; ">-</span><span style="color: #000000; ">c&nbsp;$</span><span style="color: #000000; ">&lt;</span><span style="color: #000000; ">&nbsp;$(CPPFLAGS)<br /><img align="top" src="http://www.cppblog.com/Images/OutliningIndicators/None.gif" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br /><img align="top" src="http://www.cppblog.com/Images/OutliningIndicators/None.gif" alt="" />clean:<br /><img align="top" src="http://www.cppblog.com/Images/OutliningIndicators/None.gif" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$(RM)&nbsp;$(SVR_OBJ)&nbsp;$(TARGET)</span></div><p style="color: #4b4b4b; font-family: georgia, verdana, Arial, helvetica, sans-seriff; font-size: 13px; line-height: 20px; text-align: left; background-color: #ffffff; ">&nbsp;&nbsp;&nbsp;&nbsp; 这个模板，稍加修改就可以编译lib库,so库</p><img src ="http://www.cppblog.com/yesg/aggbug/180285.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/yesg/" target="_blank">nk_ysg</a> 2012-06-26 11:31 <a href="http://www.cppblog.com/yesg/archive/2012/06/26/180285.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>suse下源码编译thrift</title><link>http://www.cppblog.com/yesg/archive/2012/06/26/180284.html</link><dc:creator>nk_ysg</dc:creator><author>nk_ysg</author><pubDate>Tue, 26 Jun 2012 03:31:00 GMT</pubDate><guid>http://www.cppblog.com/yesg/archive/2012/06/26/180284.html</guid><wfw:comment>http://www.cppblog.com/yesg/comments/180284.html</wfw:comment><comments>http://www.cppblog.com/yesg/archive/2012/06/26/180284.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/yesg/comments/commentRss/180284.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/yesg/services/trackbacks/180284.html</trackback:ping><description><![CDATA[<span style="color: #4b4b4b; font-family: georgia, verdana, Arial, helvetica, sans-seriff; font-size: 13px; line-height: 20px; text-align: left; background-color: #ffffff; ">1.&nbsp;tar xzvf thrift-0.8.0.tar.gz</span><br style="color: #4b4b4b; font-family: georgia, verdana, Arial, helvetica, sans-seriff; font-size: 13px; line-height: 20px; text-align: left; background-color: #ffffff; " /><span style="color: #4b4b4b; font-family: georgia, verdana, Arial, helvetica, sans-seriff; font-size: 13px; line-height: 20px; text-align: left; background-color: #ffffff; ">2. cd&nbsp;thrift-0.8.0</span><br style="color: #4b4b4b; font-family: georgia, verdana, Arial, helvetica, sans-seriff; font-size: 13px; line-height: 20px; text-align: left; background-color: #ffffff; " /><span style="color: #4b4b4b; font-family: georgia, verdana, Arial, helvetica, sans-seriff; font-size: 13px; line-height: 20px; text-align: left; background-color: #ffffff; ">3. ./configure&nbsp;</span><br style="color: #4b4b4b; font-family: georgia, verdana, Arial, helvetica, sans-seriff; font-size: 13px; line-height: 20px; text-align: left; background-color: #ffffff; " /><span style="color: #4b4b4b; font-family: georgia, verdana, Arial, helvetica, sans-seriff; font-size: 13px; line-height: 20px; text-align: left; background-color: #ffffff; ">4. 提示for openssl/rand.h... no,checking for SSL_ctrl in -lssl... no</span><br style="color: #4b4b4b; font-family: georgia, verdana, Arial, helvetica, sans-seriff; font-size: 13px; line-height: 20px; text-align: left; background-color: #ffffff; " /><span style="color: #4b4b4b; font-family: georgia, verdana, Arial, helvetica, sans-seriff; font-size: 13px; line-height: 20px; text-align: left; background-color: #ffffff; ">5. ./configure --help&nbsp;</span><br style="color: #4b4b4b; font-family: georgia, verdana, Arial, helvetica, sans-seriff; font-size: 13px; line-height: 20px; text-align: left; background-color: #ffffff; " /><span style="color: #4b4b4b; font-family: georgia, verdana, Arial, helvetica, sans-seriff; font-size: 13px; line-height: 20px; text-align: left; background-color: #ffffff; ">有如下些提示</span><br style="color: #4b4b4b; font-family: georgia, verdana, Arial, helvetica, sans-seriff; font-size: 13px; line-height: 20px; text-align: left; background-color: #ffffff; " /><div style="color: #4b4b4b; font-family: georgia, verdana, Arial, helvetica, sans-seriff; font-size: 13px; line-height: 20px; text-align: left; background-color: #ffffff; ">&nbsp;LDFLAGS &nbsp; &nbsp; linker flags, e.g. -L&lt;lib dir&gt; if you have libraries in a</div><div style="color: #4b4b4b; font-family: georgia, verdana, Arial, helvetica, sans-seriff; font-size: 13px; line-height: 20px; text-align: left; background-color: #ffffff; ">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nonstandard directory &lt;lib dir&gt;</div><div style="color: #4b4b4b; font-family: georgia, verdana, Arial, helvetica, sans-seriff; font-size: 13px; line-height: 20px; text-align: left; background-color: #ffffff; ">&nbsp; LIBS &nbsp; &nbsp; &nbsp; &nbsp;libraries to pass to the linker, e.g. -l&lt;library&gt;</div><div style="color: #4b4b4b; font-family: georgia, verdana, Arial, helvetica, sans-seriff; font-size: 13px; line-height: 20px; text-align: left; background-color: #ffffff; ">&nbsp; CPPFLAGS &nbsp; &nbsp;(Objective) C/C++ preprocessor flags, e.g. -I&lt;include dir&gt; if</div><div style="color: #4b4b4b; font-family: georgia, verdana, Arial, helvetica, sans-seriff; font-size: 13px; line-height: 20px; text-align: left; background-color: #ffffff; ">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; you have headers in a nonstandard directory &lt;include dir&gt;</div><div style="color: #4b4b4b; font-family: georgia, verdana, Arial, helvetica, sans-seriff; font-size: 13px; line-height: 20px; text-align: left; background-color: #ffffff; ">查看我的openssl的目录为/usr/local/ssl/include/<br />6.运行如下命令<br /><div>./configure CPPFLAGS=-I/usr/local/ssl/include LDFLAGS=-L/usr/local/ssl/lib<br />生成Makefile<br />7.make &amp;&amp; make install</div></div><img src ="http://www.cppblog.com/yesg/aggbug/180284.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/yesg/" target="_blank">nk_ysg</a> 2012-06-26 11:31 <a href="http://www.cppblog.com/yesg/archive/2012/06/26/180284.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>使用PUTTY实现自动登录的方法(ssh和ssh2)</title><link>http://www.cppblog.com/yesg/archive/2012/03/23/168705.html</link><dc:creator>nk_ysg</dc:creator><author>nk_ysg</author><pubDate>Fri, 23 Mar 2012 03:07:00 GMT</pubDate><guid>http://www.cppblog.com/yesg/archive/2012/03/23/168705.html</guid><wfw:comment>http://www.cppblog.com/yesg/comments/168705.html</wfw:comment><comments>http://www.cppblog.com/yesg/archive/2012/03/23/168705.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/yesg/comments/commentRss/168705.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/yesg/services/trackbacks/168705.html</trackback:ping><description><![CDATA[<div>关于ssh的自动登录<br />http://hi.baidu.com/zzbasic/blog/item/329276d1ec362ed6562c8438.html</div><div>1、登录主机并输入ssh-keygen -t rsa<br /><span style="color: #ff0000; ">提示</span><span style="color: #ff0000; ">Enter file in which to save the key (/root/.ssh/id_rsa):</span><br /><span style="color: #ff0000; ">输入/root/.ssh/sea_rsa</span></div><div>&nbsp; &nbsp; &nbsp;根据提示输入相关路径名和文件名并生成两个文件（之后的两个选项直接回车）</div><div>2、把那个没有.pub的文件copy出来用puttygen转换一下生成windows下putty可用的key(<span style="color: #ff0000; ">这里指sea_rsa,选择puttygen的Conversions的Import key（这里指sea_rsa,然后点Save private key)</span></div><div>3、把那个带有.pub的文件改名为authorized_keys并放入/root/.ssh/</div><div>4、启动Putty，设置好session的各项参数，然后从左边选择&#8220;SSH-&gt;Auth&#8221;，点击 Browse 按钮，选择那个key文件。再从左边选择 Session，然后点击 Save 按钮把修改保存下来。然后点击Open 按钮就可以登录了。</div><div></div><div></div><div>如果上面的操作都没有问题，那这时应该就自动登录了，只需输入用户名无需输入密码。</div><div>如果在Connection里的Data里添加用户名的话就连用户名就不用输入了。</div><div>主意：如果只用SSH2协议，需要修改一下 /etc/ssh/sshd_config 文件，加入（或改为）：Protocol 2<br />ls -l `which ssh`如何为ssh2的话<br />需要修改<br />cd /root/.ssh2/<br />touch&nbsp;authorization(对应于<span style="color: #ff0000; ">authorized_keys)<br />&nbsp;内容为<br /></span><div></div><div># Local public key</div><div>Key id_rsa_1024_a.pub</div><div></div>其他步骤一样<br /><br /><br /></div><img src ="http://www.cppblog.com/yesg/aggbug/168705.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/yesg/" target="_blank">nk_ysg</a> 2012-03-23 11:07 <a href="http://www.cppblog.com/yesg/archive/2012/03/23/168705.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>gdb调试cgi程序</title><link>http://www.cppblog.com/yesg/archive/2011/11/04/159621.html</link><dc:creator>nk_ysg</dc:creator><author>nk_ysg</author><pubDate>Fri, 04 Nov 2011 07:05:00 GMT</pubDate><guid>http://www.cppblog.com/yesg/archive/2011/11/04/159621.html</guid><wfw:comment>http://www.cppblog.com/yesg/comments/159621.html</wfw:comment><comments>http://www.cppblog.com/yesg/archive/2011/11/04/159621.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/yesg/comments/commentRss/159621.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/yesg/services/trackbacks/159621.html</trackback:ping><description><![CDATA[<div> 不是，比方说我发个get请求http://www.tutorialspoint.com/cgi-bin/cpp_get.cgi?first_name=ZARA&amp;last_name=ALI<br />在gdb里面设置set&nbsp;env&nbsp;QUERY_STRING=first_name=ZARA&amp;last_name=ALI<br />就可以打断点了</div><img src ="http://www.cppblog.com/yesg/aggbug/159621.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/yesg/" target="_blank">nk_ysg</a> 2011-11-04 15:05 <a href="http://www.cppblog.com/yesg/archive/2011/11/04/159621.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>addr2line</title><link>http://www.cppblog.com/yesg/archive/2011/05/25/147103.html</link><dc:creator>nk_ysg</dc:creator><author>nk_ysg</author><pubDate>Wed, 25 May 2011 10:49:00 GMT</pubDate><guid>http://www.cppblog.com/yesg/archive/2011/05/25/147103.html</guid><wfw:comment>http://www.cppblog.com/yesg/comments/147103.html</wfw:comment><comments>http://www.cppblog.com/yesg/archive/2011/05/25/147103.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/yesg/comments/commentRss/147103.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/yesg/services/trackbacks/147103.html</trackback:ping><description><![CDATA[<div>addr2line -e mainsvr -f 0x888<br /><br />其中-e后面跟程序名mainsvr，-f代表转化为函数名，0x888为出错函数地址</div><img src ="http://www.cppblog.com/yesg/aggbug/147103.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/yesg/" target="_blank">nk_ysg</a> 2011-05-25 18:49 <a href="http://www.cppblog.com/yesg/archive/2011/05/25/147103.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>