Linux添加头文件路径
 2016.02.25    |      Linux问题集合    |     AilsonJack    |     暂无评论    |     3332 views
By: Ailson Jack
Date: 2016-02-25
个人博客: http://www.only2fire.com/
<p style="text-align:center"><img src="/uploads/AilsonJack/2018.08.23/1535034138357051.jpg" onclick="preview_image(&#39;/uploads/AilsonJack/2018.08.23/1535034138357051.jpg&#39;)"/></p><p style="text-indent: 2em;">如果想对所有用户有效则在<span style="color: rgb(0, 112, 192);">/etc/profile</span>增加以下内容。</p><p style="text-indent: 2em;">如果只对当前用户有效则在home目录下的<span style="color: rgb(0, 112, 192);">.bashrc</span>或<span style="color: rgb(0, 112, 192);">.bash_profile</span>里增加下面的内容(下面的内容可选自己需要的进行添加):</p><p style="text-indent: 2em;"><span style="color: rgb(0, 112, 192);">#在PATH中找到可执行文件程序的路径</span></p><p style="text-indent: 2em;"><span style="color: rgb(0, 112, 192);">export PATH=$PATH:$HOME/bin</span></p><p style="text-indent: 2em;"><br/></p><p style="text-indent: 2em;"><span style="color: rgb(0, 112, 192);">#gcc找到头文件的路径</span></p><p style="text-indent: 2em;"><span style="color: rgb(0, 112, 192);">C_INCLUDE_PATH=/usr/include/libxml2:/MyLib</span></p><p style="text-indent: 2em;"><span style="color: rgb(0, 112, 192);">export C_INCLUDE_PATH</span></p><p style="text-indent: 2em;"><br/></p><p style="text-indent: 2em;"><span style="color: rgb(0, 112, 192);">#g++找到头文件的路径</span></p><p style="text-indent: 2em;"><span style="color: rgb(0, 112, 192);">CPLUS_INCLUDE_PATH=$CPLUS_INCLUDE_PATH:/usr/include/libxml2:/MyLib</span></p><p style="text-indent: 2em;"><span style="color: rgb(0, 112, 192);">export CPLUS_INCLUDE_PATH</span></p><p style="text-indent: 2em;"><br/></p><p style="text-indent: 2em;"><span style="color: rgb(0, 112, 192);">#找到动态链接库的路径</span></p><p style="text-indent: 2em;"><span style="color: rgb(0, 112, 192);">LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/MyLib</span></p><p style="text-indent: 2em;"><span style="color: rgb(0, 112, 192);">export LD_LIBRARY_PATH<br/></span></p><p style="text-indent: 2em;"><br/></p><p style="text-indent: 2em;"><span style="color: rgb(0, 112, 192);">#找到静态库的路径</span></p><p style="text-indent: 2em;"><span style="color: rgb(0, 112, 192);">LIBRARY_PATH=$LIBRARY_PATH:/MyLib</span></p><p style="text-indent: 2em;"><span style="color: rgb(0, 112, 192);">export LIBRARY_PATH</span></p><p style="text-indent: 2em;"><span style="color: rgb(255, 0, 0);">注意:</span>等号前面不要加空格,否则可能出现 command not found。</p><p style="text-indent: 2em;">添加了上面的内容后,可以执行如下的命令:</p><p style="text-indent: 2em;"><span style="color: rgb(255, 0, 0);">source /etc/profile</span>或者<span style="color: rgb(255, 0, 0);">source .bashrc(.bash_profile)</span>来使修改的内容生效。</p>
欢迎关注博主的公众号呀,精彩内容随时掌握:
热情邀请仔细浏览下博客中的广告,万一有对自己有用或感兴趣的呢。◕ᴗ◕。。
如果这篇文章对你有帮助,记得点赞和关注博主就行了^_^,当然了能够赞赏博主,那就非常感谢啦!
注: 转载请注明出处,谢谢!^_^
转载请注明来源: 本文链接:  By: AilsonJack
Linux添加头文件路径  |  说好一起走
暂无评论,要不要来个沙发
发表评论

 
Copyright © 2015~2023  说好一起走   保留所有权利   |  百度统计  蜀ICP备15004292号