当前位置: 首页 > news >正文

app拉新渠道南宁seo营销推广

app拉新渠道,南宁seo营销推广,中国外协加工网最新订单,网站建设教程讲解修改gcc/g默认include路径 转自:http://www.network-theory.co.uk/docs/gccintro/gccintro_23.htmlhttp://ilewen.com/questions/692 C/C程序在linux下被编译和连接时,GCC/G会查找系统默认的include和link的路径,以及自己在编译命令中指定的路…

修改gcc/g++默认include路径

转自:
http://www.network-theory.co.uk/docs/gccintro/gccintro_23.html
http://ilewen.com/questions/692

 

C/C++程序在linux下被编译和连接时,GCC/G++会查找系统默认的include和link的路径,以及自己在编译命令中指定的路径。自己指定的路径就不说了,这里说明一下系统自动搜索的路径。


【1】include头文件路径
除了默认的/usr/include, /usr/local/include等include路径外,还可以通过设置环境变量来添加系统include的路径:
# C
export C_INCLUDE_PATH=XXXX:$C_INCLUDE_PATH
# CPP
export CPLUS_INCLUDE_PATH=XXX:$CPLUS_INCLUDE_PATH

以上修改可以直接命令行输入(一次性),可以在/etc/profile中完成(对所有用户生效),也可以在用户home目录下的.bashrc或.bash_profile中添加(针对某个用户生效),修改完后重新登录即生效。


【2】link链接库文件路径
链接库文件在连接(静态库和共享库)和运行(仅限于使用共享库的程序)时被使用,其搜索路径是在系统中进行设置的(也可以在编译命令中通过 -l -L 来指定,这里讲的是使用系统默认搜索路径)。
一般 Linux 系统把 /lib /usr/lib /usr/local/lib 作为默认的库搜索路径,所以使用这几个目录中的链接库文件可直接被搜索到(不需要专门指定链接库路径)。对于默认搜索路径之外的库,则需要将其所在路径添加到gcc/g++的搜索路径之中。
链接库文件的搜索路径指定有两种方式:1)修改/etc/so.ld.conf 2)修改环境变量,在其中添加自己的路径

1)在环境变量中添加
动态链接库搜索路径:
export LD_LIBRARY_PATH=XXX:$LD_LIBRARY_PATH
静态链接库搜索路径:
export LIBRARY_PATH=XXX:$LIBRARY_PATH
以上修改可以直接命令行输入(一次性),可以在/etc/profile中完成(对所有用户生效),也可以在用户home目录下的.bashrc或.bash_profile中添加(针对某个用户生效),修改完后重新登录即生效。


2)在/etc/ld.so.conf 中添加指定的链接库搜索路径(需要root权限),然后运行 /sbin/ldconfig,以达到刷新 /etc/ld.so.cache的效果。

以上两种方式均可以达到指定链接库搜索路径的效果。

 

查看添加结果:

对于C

echo | gcc -v -x c -E -

 

[root@lsgxeva ~]# echo | gcc -v -x c -E -
使用内建 specs。
COLLECT_GCC=gcc
目标:x86_64-redhat-linux
配置为:../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++,objc,obj-c++,java,fortran,ada,go,lto --enable-plugin --enable-initfini-array --disable-libgcj --with-isl=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/isl-install --with-cloog=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/cloog-install --enable-gnu-indirect-function --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linux
线程模型:posix
gcc 版本 4.8.5 20150623 (Red Hat 4.8.5-11) (GCC) 
COLLECT_GCC_OPTIONS='-v' '-E' '-mtune=generic' '-march=x86-64'/usr/libexec/gcc/x86_64-redhat-linux/4.8.5/cc1 -E -quiet -v - -mtune=generic -march=x86-64
忽略不存在的目录“/usr/lib/gcc/x86_64-redhat-linux/4.8.5/include-fixed”
忽略不存在的目录“/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../x86_64-redhat-linux/include”
#include "..." 搜索从这里开始:
#include <...> 搜索从这里开始:
 /usr/lib/gcc/x86_64-redhat-linux/4.8.5/include/usr/local/include/usr/include
搜索列表结束。
# 1 "<stdin>"
# 1 "<built-in>"
# 1 "<命令行>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 1 "<命令行>" 2
# 1 "<stdin>"
COMPILER_PATH=/usr/libexec/gcc/x86_64-redhat-linux/4.8.5/:/usr/libexec/gcc/x86_64-redhat-linux/4.8.5/:/usr/libexec/gcc/x86_64-redhat-linux/:/usr/lib/gcc/x86_64-redhat-linux/4.8.5/:/usr/lib/gcc/x86_64-redhat-linux/
LIBRARY_PATH=/usr/lib/gcc/x86_64-redhat-linux/4.8.5/:/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/:/lib/../lib64/:/usr/lib/../lib64/:/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-E' '-mtune=generic' '-march=x86-64'

 

对于C++

echo | g++ -v -x c++ -E -  或者  echo | gcc -v -x c++ -E -

 

[root@lsgxeva ~]# echo | g++ -v -x c++ -E -
使用内建 specs。
COLLECT_GCC=g++
目标:x86_64-redhat-linux
配置为:../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++,objc,obj-c++,java,fortran,ada,go,lto --enable-plugin --enable-initfini-array --disable-libgcj --with-isl=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/isl-install --with-cloog=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/cloog-install --enable-gnu-indirect-function --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linux
线程模型:posix
gcc 版本 4.8.5 20150623 (Red Hat 4.8.5-11) (GCC) 
COLLECT_GCC_OPTIONS='-v' '-E' '-shared-libgcc' '-mtune=generic' '-march=x86-64'/usr/libexec/gcc/x86_64-redhat-linux/4.8.5/cc1plus -E -quiet -v -D_GNU_SOURCE - -mtune=generic -march=x86-64
忽略不存在的目录“/usr/lib/gcc/x86_64-redhat-linux/4.8.5/include-fixed”
忽略不存在的目录“/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../x86_64-redhat-linux/include”
#include "..." 搜索从这里开始:
#include <...> 搜索从这里开始:
 /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../include/c++/4.8.5/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../include/c++/4.8.5/x86_64-redhat-linux/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../include/c++/4.8.5/backward/usr/lib/gcc/x86_64-redhat-linux/4.8.5/include/usr/local/include/usr/include
搜索列表结束。
# 1 "<stdin>"
# 1 "<built-in>"
# 1 "<命令行>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 1 "<命令行>" 2
# 1 "<stdin>"
COMPILER_PATH=/usr/libexec/gcc/x86_64-redhat-linux/4.8.5/:/usr/libexec/gcc/x86_64-redhat-linux/4.8.5/:/usr/libexec/gcc/x86_64-redhat-linux/:/usr/lib/gcc/x86_64-redhat-linux/4.8.5/:/usr/lib/gcc/x86_64-redhat-linux/
LIBRARY_PATH=/usr/lib/gcc/x86_64-redhat-linux/4.8.5/:/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/:/lib/../lib64/:/usr/lib/../lib64/:/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-E' '-shared-libgcc' '-mtune=generic' '-march=x86-64'

 

 

注意:该方法只对当前ssh session有效,重新连接后,新加的include路径,gcc/g++将不保存

 

understand 编辑器的配置

*.cpp; *.hpp; *.cxx; *.hxx; *.cc; *.c; *.inl; *.h; *.hh; *.hm; *.asm; *.asmx; *.rc; *.resx; *.idl; *.rc2; *Makefile; Makefile*; *makefile; makefile*; CMakeLists.*; *.cmake; *Config; *config; *.am; *.ac; *.in; *.mk; *config; *.inc; *.lds; *.s; *.S; *.def; *.odl; *.xsd; *.bin; *.rgs; *.html; *.htm; *.d; *.txt; *.text; *.lic; *.ini; *.conf; *.xml; *.json; *.ini; *.lang; *.properties; *.bat; *.ps; *.sh; *.bash; *.csh; *.pl; *.pm; *.plx; *.md; *.markdown; .gitconfig; .gitignore; .gitattributes; .gitmodules; .gitlab-ci.yml; _clang-format; BUILD; CHANGELOG; COPYRIGHT; LICENSE; VERSION; RELEASE; TODO

 

U:\root\develop\nslc\src
U:\root\develop\nslc\incs\freebsd_x64\include
U:\root\develop\nslc\vendor\install\freebsd_x64\glog
U:\root\develop\nslc\vendor\install\freebsd_x64\gperftools
U:\root\develop\nslc\vendor\install\freebsd_x64\gmock
U:\root\develop\nslc\vendor\install\freebsd_x64\gtest
U:\root\develop\nslc\vendor\install\freebsd_x64\gflags
U:\root\develop\nslc\vendor\install\freebsd_x64\curl
U:\root\develop\nslc\vendor\install\freebsd_x64\mbedtls
U:\root\develop\nslc\vendor\install\freebsd_x64\libbson
U:\root\develop\nslc\vendor\install\freebsd_x64\libcstl
U:\root\develop\nslc\vendor\install\freebsd_x64\libev
U:\root\develop\nslc\vendor\install\freebsd_x64\libtap
U:\root\develop\nslc\vendor\install\freebsd_x64\zlog
U:\root\develop\nslc\vendor\install\freebsd_x64\libtar
U:\root\develop\nslc\vendor\install\freebsd_x64\zlib
U:\root\develop\nslc\vendor\install\freebsd_x64\stlport
U:\root\develop\nslc\vendor\install\freebsd_x64\boost
U:\root\develop\nslc\vendor\install\freebsd_x64\libunwind
U:\root\develop\nslc\vendor\install\freebsd_x64\execinfo
U:\root\develop\nslc\vendor\install\freebsd_x64\pthread
U:\usr\local\include
U:\usr\include\c++\4.2\backward
U:\usr\include\c++\4.2
U:\usr\include

 

__amd64=
__amd64__=
__cdecl=__attribute__((__cdecl__))
__ELF__=
__FreeBSD__=8
__GNUC__=4
__LP64__=
__STDC__=
__unix=
__unix__=
__x86_64=
__x86_64__=
_DEBUG=
_DEBUG_CDB=
_FILE_OFFSET_BITS=64
_FORTIFY_SOURCE=1
_LP64=
_UNICODE=
amd64=
CHECK_PTHREAD_RETURN_VALUE=
DEBUG=
UNICODE=
unix=
USE_GPERFTOOLS=
VALGRIND=
x86_64=

 

 

=============== End

 

转载于:https://www.cnblogs.com/lsgxeva/p/7910509.html

http://www.lbrq.cn/news/2554759.html

相关文章:

  • 做动态网站学php_asp+还是jsp好?武汉网站搜索引擎优化
  • 清远网站建设推广关键词排名点击软件推荐
  • 面包类网站设计成都网站设计
  • 可以自己做视频网站吗拼多多商品关键词搜索排名
  • 怎么买域名自己做网站营销团队找产品合作
  • 网站文章更新做销售找客户渠道
  • 昆明网站开发哪家好网站定制
  • 上海松江区做网站的公司成都百度seo优化公司
  • 对省政府网站建设的发展有期待seo快速推广
  • 平顶山公司做网站seo关键词优化系统
  • 网站开发团队介绍谷歌商店下载官网
  • 品划做网站广告公司广告牌制作
  • 常德市人民政府网站今日最新闻
  • 律师网站深圳网站设计关键词热度分析工具
  • 河南映天建设网站关键词优化技巧
  • 网站建设综合推荐指数网站
  • 做网站咋不用买虚拟机网址和网站的区别
  • 海南专业网站建设seo的排名机制
  • 做网站服务器需要系统关键词生成器 在线
  • 网站建设差打不开疫情防控最新通告
  • 重庆百度网站快速排名怎么样推广自己的产品
  • 高端企业门户网站建设服务公司外贸营销推广
  • 做视频网站视频存放问题企业培训计划方案
  • 榆林公司做网站外链发布
  • 有没有发布需求的网站网络营销公司招聘
  • 河南省建设监理协会网站重庆做网络优化公司电话
  • 想做棋牌网站怎么做google下载安卓版下载
  • wordpress归档侧边栏按分类长沙做优化的公司
  • linux做网站西安官网seo技术
  • 江苏网站建设空间徐州百度推广公司
  • 每日面试题18:基本数据类型和引用数据类型的区别
  • Go语言常用的设计模式
  • LeetCode 85:最大矩形
  • MakeInstaller: 一款麒麟操作系统安装包制作工具
  • RHCA学习概述
  • 工厂方法模式:从基础到C++实现