Linux添加头文件路径
<p style="text-align:center"><img src="/uploads/AilsonJack/2018.08.23/1535034138357051.jpg" onclick="preview_image('/uploads/AilsonJack/2018.08.23/1535034138357051.jpg')"/></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>
你可能也喜欢:
暂无评论,要不要来个沙发
发表评论
JLink V9掉固件修复(灯不亮) 3Zephyr笔记2 - 在STM32F429上运行HelloWorld 2计算NandFlash要传入的行地址和列地址 1Linux MMC子系统 - 6.eMMC 5.1工作模式-设备识别模式 0Linux MMC子系统 - 5.eMMC 5.1工作模式-引导模式 0Linux MMC子系统 - 4.eMMC 5.1常用命令说明(2) 0
标签云
Linux嵌入式实用技巧ARM内核学习问题集合CC++编程语言阅读笔记汇编Linux内核完全注释Windows驱动开发计算机基础ARM11ARMv7-ASTM32IDESublimeLinux内核学习eMMCMMC子系统Ubuntu操作系统OfficeVMWareAPUEgccRTOS中断漫游世界随笔感悟开发工具软件应用编程VsCodearmccarmclang编译器ZephyrSPIJLink网卡驱动安装各种芯片库函数NFSμCOS内核sambaFlashUnix命令与脚本输入法Linux内核设计与实现gitRIFFWAVJATGFTPar8161安装centos有线上网μCGUI字库工程建立右键菜单网络文件系统Firefox百度NTFS文件系统CodeBlocksCentOS数据结构算法PhotoShop51KeilQTUltraEditscanfglibc宏定义UIDGID优先级娱乐天地SourceInsight磁盘扇区总线I2CPDFBComparePythonI2SFPUMakefileSWDCPUARP软件推荐FileZilla