左腿疼是什么原因| 忧愁是什么意思| 无字五行属什么| 意义是什么意思| 鹅蛋炒什么好吃| 什么蛇没毒| 海东青是什么| 秦王是什么生肖| 狗狗犬窝咳吃什么药| 文曲星什么意思| 头经常晕是什么原因| 六月种什么菜| 耳机降噪是什么意思| aww是什么意思| 糯米粉可以做什么好吃的| 梦见牙齿掉光了是什么征兆| 入睡困难挂什么科| 一什么麦子| 早上右眼跳是什么预兆| 落花生的落是什么意思| 1985年是什么年| 什么原因导致性功能减退| 阴囊潮湿吃什么药| 长闭口是什么原因造成的| 什么是职业| 脑梗塞吃什么药| 什么的教导| 为什么饿了会想吐| 微针有什么功效| 备孕前需要做什么检查| 1037年属什么生肖| 六月十二日是什么日子| 福禄寿的禄是什么意思| 柠檬水有什么好处| bata鞋属于什么档次| 拔罐为什么会起水泡| 卡拉胶是什么| 吃氨糖有什么副作用| 什么是血脂| 什么是乳胶床垫| 颔是什么意思| 洋葱生吃有什么好处| 剖腹产后可以吃什么食物| 鸡精和鸡粉有什么区别| 锲而不舍下一句是什么| 小结节是什么意思| 尘螨是什么| 胰腺炎有什么症状| 鬼最怕什么颜色| 全身检查要挂什么科| 92年属什么的生肖| 鼎字五行属什么| 乳酪和奶酪有什么区别| 腐女是什么| 羊水偏多对胎儿有什么影响| 脾胃湿热吃什么药好| eos是什么意思| 梦见长白头发是什么意思| 契爷是什么意思| 骨蒸潮热 是什么意思| 眼镜是什么时候发明的| 吸血鬼初拥是什么意思| 紫玫瑰花语是什么意思| 3月23是什么星座| 呼吸内镜检查什么| 得了幽门螺旋杆菌有什么症状| 成龙真名叫什么名字| aj是什么鞋子| 痛风吃什么药好| 吃什么补精养肾| 猪血炒什么好吃| 点了斑不能吃什么| 马甲线是什么意思| gm是什么意思| 梦到火是什么意思| 胸闷气短是什么症状| 11月28日是什么星座| 什么人容易得小脑萎缩| 中医经方是什么意思| 社会很单纯复杂的是人是什么歌| 尿胆原阴性是什么意思| 紫色搭配什么颜色| 区长是什么级别| 瘘管是什么病| 目是什么意思| 95年属什么的| 宫商角徵羽是什么意思| 煲汤放什么药材补气血| 葡萄胎是什么| 床上放什么可以驱蟑螂| 女右眉毛跳是什么预兆| 黄油是什么做的| 桑黄是什么树上长出来的| 男的为什么喜欢男的| 不以为然什么意思| 黄连膏有什么功效和作用| 小孩睡觉流鼻血是什么原因引起的| 咳嗽吃什么好的快| 脑血管堵塞吃什么药| 滑板什么意思| 孙悟空被压在什么山下| 怎么吃都不胖是什么原因| 岁月匆匆是什么意思| 为什么会甲状腺肿大| 讹人是什么意思| 齁不住是什么意思| cg是什么| 什么手什么足| 绿色加红色是什么颜色| msi是什么意思| 脖子后面疼是什么原因| 为什么会生化| 闰月是什么| 舌头不舒服挂什么科| 肚子胀气吃什么通气| 弓形虫是什么| 治便秘吃什么| 神灵是什么意思| 梵克雅宝为什么那么贵| 肛裂出血和痔疮出血有什么区别| 天秤男喜欢什么样的女生| 九月15是什么星座| cpp是什么意思| 梦见自己有孩子了是什么预兆| 做四维需要准备什么| 驾驶证c1和c2有什么区别| 室早是什么意思| 开飞机是什么意思| thx是什么意思| 正月初八是什么星座| insun是什么牌子| 百毒不侵是什么意思| 什么心什么力| 80是什么意思| 红烧排骨用什么排骨比较好| 苦瓜炒什么好吃| cache什么意思| 操逼什么意思| 六月什么星座| 右胸上部隐痛什么原因| 狗狗肠胃炎吃什么药| 科级干部是什么级别| 心脏早搏什么症状| 腮腺炎反复发作是什么原因| 什么时候恢复高考| 15年婚姻是什么婚| 大耗是什么意思| 砚台是什么| 腰花是什么部位| 食道炎症吃什么药最好| 酪朊酸钠是什么| 外耳道炎用什么药| 横纹肌溶解什么意思| 灰指甲是什么样子| 0和1是什么意思| 骨髓抑制是什么意思| 什么情况下喝补液盐| 备皮是什么意思| 外公是什么关系| 万箭穿心是什么意思| 什么路最窄打一生肖| 1936年中国发生了什么| 病理活检是什么意思| 线上考试是什么意思| 燕子进屋来有什么兆头| 喜什么自什么| 维生素B3叫什么名字| 腱鞘炎用什么药能治好| 术后恢复吃什么好| 附件炎吃什么药效果好| 颈动脉强回声斑块是什么意思| 公道自在人心是什么意思| 三月十号是什么星座| 竹者念什么| 什么是滑精| 内膜回声欠均匀是什么意思| 一月7日是什么星座| hpv58阳性是什么意思| 唯女子与小人难养也是什么意思| 凝血常规是查什么的| 氯超标是因为什么原因| 高血糖可以吃什么水果| 奶思是什么意思| ccf是什么| 睾丸炎有什么症状| 为什么手术服是绿色的| 胆囊炎是什么| 草字头下面一个高字读什么| 劝君更尽一杯酒的下一句是什么| 代销商是什么意思| eva鞋底是什么材质| 结肠炎吃什么药治疗效果好| 一个马一个襄念什么| 洗牙喷砂是什么意思| 信徒什么意思| 古驰属于什么档次| 月经淋漓不尽是什么原因| 腿外侧是什么经络| 吃什么长胖| 前列腺炎是什么原因引起| 儿童腿疼挂什么科| 什么是纤维| 肝胆湿热吃什么中成药最好| 念力是什么意思| 什么最解酒最快| 牙龈萎缩吃什么维生素| 什么币最值钱| 手掌像什么| 霉菌性中耳炎用什么药| 女性分泌物像豆腐渣用什么药| 营养性贫血是什么意思| 霍霍是什么意思| 双子座和什么星座最配| 广东古代叫什么| 上火有什么症状| 前胸后背出汗是什么原因造成的| 什么床垫最健康| 什么然| 泛是什么意思| 总胆红素高是什么原因| 生孩子送什么花比较好| 酸奶可以做什么美食| 烟火气息是什么意思| 回头是岸是什么生肖| 十月七号什么星座| 痔疮有什么特征| 大好河山是什么生肖| 女人梦见棺材是什么征兆| 支气管舒张试验阳性说明什么| 吃什么有助于消化| hi是什么意思| 唯女子与小人难养也是什么意思| 鼻咽癌有什么症状| 夏天什么颜色最防晒| snoopy是什么意思| 查血常规挂什么科| 什么是砭石| 电饭煲煮粥为什么会溢出来| 老年人手抖是什么原因| 囊性占位是什么意思| 黄磊为什么不娶刘若英| 妊娠是什么意思| 鱼和熊掌不可兼得什么意思| 动次打次是什么意思| 类风湿不能吃什么| 7月4日是什么星座| 湿疹是什么症状图片| 糖尿病吃什么菜最好| 长期过敏是什么原因| 长期喝咖啡有什么好处和坏处| 吃什么补充维生素d| 大学是什么学历| 三花聚顶是什么修为| 肺结节吃什么药散结节最快| 绞肠痧是什么病| 股骨头坏死挂什么科| 什么榴莲好吃| 跻身是什么意思| 海员是干什么的| 阿托品属于什么类药物| 手机的英文是什么| eland是什么牌子| 为什么一直想睡觉| bf是什么| 百度

[内蒙古]国道335线乌不浪口至乌根高勒段勘测

百度 一段时间以来,网络视听节目出现了一些违规乱象,比如,有的节目歪曲、恶搞、丑化经典文艺作品;有的节目擅自截取拼接经典文艺作品、广播影视节目和网络原创视听节目的片段,形成了实质上的侵权,有的甚至重新配音、重配字幕,以篡改原意、断章取义、恶搞的方式吸引眼球,存在严重的价值导向偏差,给网民特别是青少年成长罩上精神雾霾,人民群众特别是广大网民非常愤慨,意见很大。

This FAQ tries to answer specific questions concerning GCC. For general information regarding C, C++, and Fortran respectively, please check the comp.lang.c FAQ and the C++ FAQ.

Other GCC-related FAQs: libstdc++-v3.


Questions

  1. General information
    1. How do I get a bug fixed or a feature added?
    2. Does GCC work on my platform?
  2. Installation
    1. How to install multiple versions of GCC
    2. Dynamic linker is unable to find GCC libraries
    3. libstdc++/libio tests fail badly with --enable-shared
    4. GCC can not find GNU as/GNU ld
    5. cpp: Usage:... Error
  3. Testsuite problems
    1. How do I pass flags like -fnew-abi to the testsuite?
    2. How can I run the testsuite with multiple options?
  4. Miscellaneous
    1. Friend Templates
    2. dynamic_cast, throw, typeid don't work with shared libraries
    3. Why do I need autoconf, bison, xgettext, automake, etc?
    4. Why can't I build a shared library?
    5. When building C++, the linker says my constructors, destructors or virtual tables are undefined, but I defined them

General information

How do I get a bug fixed or a feature added?

There are lots of ways to get something fixed. The list below may be incomplete, but it covers many of the common cases. These are listed roughly in order of decreasing difficulty for the average GCC user, meaning someone who is not skilled in the internals of GCC, and where difficulty is measured in terms of the time required to fix the bug. No alternative is better than any other; each has its benefits and disadvantages.


Does GCC work on my platform?

The host/target specific installation notes for GCC include information about known problems with installing or using GCC on particular platforms. These are included in the sources for a release in INSTALL/specific.html, and the latest version is always available at the GCC web site. There you also find reports around successful builds.


Installation

How to install multiple versions of GCC

It may be desirable to install multiple versions of the compiler on the same system. This can be done by using different prefix paths at configure time and a few symlinks.

Basically, configure the two compilers with different --prefix options, then build and install each compiler. Assume you want "gcc" to be the latest compiler and available in /usr/local/bin; also assume that you want "gcc2" to be the older gcc2 compiler and also available in /usr/local/bin.

The easiest way to do this is to configure the new GCC with --prefix=/usr/local/gcc and the older gcc2 with --prefix=/usr/local/gcc2. Build and install both compilers. Then make a symlink from /usr/local/bin/gcc to /usr/local/gcc/bin/gcc and from /usr/local/bin/gcc2 to /usr/local/gcc2/bin/gcc. Create similar links for the "g++", "c++" and "g77" compiler drivers.

An alternative to using symlinks is to configure with a --program-transform-name option. This option specifies a sed command to process installed program names with. Using it you can, for instance, have all the new GCC programs installed as "new-gcc" and the like. You will still have to specify different --prefix options for new GCC and old GCC, because it is only the executable program names that are transformed. The difference is that you (as administrator) do not have to set up symlinks, but must specify additional directories in your (as a user) PATH. A complication with --program-transform-name is that the sed command invariably contains characters significant to the shell, and these have to be escaped correctly, also it is not possible to use "^" or "$" in the command. Here is the option to prefix "new-" to the new GCC installed programs:

--program-transform-name='s,\\\\(.*\\\\),new-\\\\1,'

With the above --prefix option, that will install the new GCC programs into /usr/local/gcc/bin with names prefixed by "new-". You can use --program-transform-name if you have multiple versions of GCC, and wish to be sure about which version you are invoking.

If you use --prefix, GCC may have difficulty locating a GNU assembler or linker on your system, GCC can not find GNU as/GNU ld explains how to deal with this.

Another option that may be easier is to use the --program-prefix= or --program-suffix= options to configure. So if you're installing GCC 2.95.2 and don't want to disturb the current version of GCC in /usr/local/bin/, you could do

configure --program-suffix=-2.95.2 <other configure options>

This should result in GCC being installed as /usr/local/bin/gcc-2.95.2 instead of /usr/local/bin/gcc.


Dynamic linker is unable to find GCC libraries

This problem manifests itself by programs not finding shared libraries they depend on when the programs are started. (This often shows around libstdc++.)

GCC does not specify a runpath so that the dynamic linker can find dynamic libraries at runtime.

The short explanation is that if you always pass a -R option to the linker, your programs become dependent on directories which may be NFS mounted, and programs — even those which do not require these directories — may hang unnecessarily when an NFS server goes down. (SunOS effectively always passed a -R option for every -L option; this was a bad idea, and it was removed for Solaris.)

However, if you feel you really need such an option to be passed automatically to the linker, you may add it to a GCC specs file. This file can be created using gcc -dumpspecs and passed to GCC using the -specs= option. You may add linker flags such as -R or -rpath, depending on platform and linker, to the *link or *lib specs.

Alternately the syntax -Wl,option can be used to ask GCC to transfer the flag option to the linker.

Another alternative is to install a wrapper script around gcc, g++ or ld that adds the appropriate directory to the environment variable LD_RUN_PATH or equivalent (again, it's platform-dependent).


GCC can not find GNU as/GNU ld

GCC searches the PATH for an assembler and a linker, but it only does so after searching a directory list hard-coded in the GCC executables. Since, on most platforms, the hard-coded list includes directories in which the system assembler and linker can be found, you may have to take one of the following actions to arrange that GCC uses the GNU versions of those programs.

To ensure that GCC finds the GNU assembler (the GNU linker), which are required by some configurations, you should configure these with the same --prefix option as you used for GCC. Then build & install GNU as (GNU ld) and proceed with building GCC.

Another alternative is to create links to GNU as and ld in any of the directories printed by the command `gcc -print-search-dirs | grep '^programs:''. The link to `ld' should be named `real-ld' if `ld' already exists. If such links do not exist while you're compiling GCC, you may have to create them in the build directories too, within the gcc directory and in all the gcc/stage* subdirectories.

GCC 2.95 allows you to specify the full pathname of the assembler and the linker to use. The configure flags are `--with-as=/path/to/as' and `--with-ld=/path/to/ld'. GCC will try to use these pathnames before looking for `as' or `(real-)ld' in the standard search dirs. If, at configure-time, the specified programs are found to be GNU utilities, `--with-gnu-as' and `--with-gnu-ld' need not be used; these flags will be auto-detected. One drawback of this option is that it won't allow you to override the search path for assembler and linker with command-line options -B/path/ if the specified filenames exist.


cpp: Usage:... Error

If you get an error like this when building GCC (particularly when building __mulsi3), then you likely have a problem with your environment variables.

  cpp: Usage: /usr/lib/gcc-lib/i586-unknown-linux-gnulibc1/2.7.2.3/cpp
  [switches] input output

First look for an explicit '.' in either LIBRARY_PATH or GCC_EXEC_PREFIX from your environment. If you do not find an explicit '.', look for an empty pathname in those variables. Note that ':' at either the start or end of these variables is an implicit '.' and will cause problems.

Also note '::' in these paths will also cause similar problems.


Testsuite problems

How do I pass flags like -fnew-abi to the testsuite?

If you invoke runtest directly, you can use the --tool_opts option, e.g:

  runtest --tool_opts "-fnew-abi -fno-honor-std" <other options>

Or, if you use make check you can use the make variable RUNTESTFLAGS, e.g:

  make RUNTESTFLAGS="--tool_opts '-fnew-abi -fno-honor-std'" check-g++

How can I run the testsuite with multiple options?

If you invoke runtest directly, you can use the --target_board option, e.g:

  runtest --target_board "unix{-fPIC,-fpic,}" <other options>

Or, if you use make check you can use the make variable RUNTESTFLAGS, e.g:

  make RUNTESTFLAGS="--target_board 'unix{-fPIC,-fpic,}'" check-gcc

Either of these examples will run the tests three times. Once with -fPIC, once with -fpic, and once with no additional flags.

This technique is particularly useful on multilibbed targets.


Miscellaneous

Friend Templates

In order to make a specialization of a template function a friend of a (possibly template) class, you must explicitly state that the friend function is a template, by appending angle brackets to its name, and this template function must have been declared already. Here's an example:

template <typename T> class foo {
  friend void bar(foo<T>);
}

The above declaration declares a non-template function named bar, so it must be explicitly defined for each specialization of foo. A template definition of bar won't do, because it is unrelated with the non-template declaration above. So you'd have to end up writing:

void bar(foo<int>) { /* ... */ }
void bar(foo<void>) { /* ... */ }

If you meant bar to be a template function, you should have forward-declared it as follows. Note that, since the template function declaration refers to the template class, the template class must be forward-declared too:

template <typename T>
class foo;

template <typename T>
void bar(foo<T>);

template <typename T>
class foo {
  friend void bar<>(foo<T>);
};

template <typename T>
void bar(foo<T>) { /* ... */ }

In this case, the template argument list could be left empty, because it can be implicitly deduced from the function arguments, but the angle brackets must be present, otherwise the declaration will be taken as a non-template function. Furthermore, in some cases, you may have to explicitly specify the template arguments, to remove ambiguity.

An error in the last public comment draft of the ANSI/ISO C++ Standard and the fact that previous releases of GCC would accept such friend declarations as template declarations has led people to believe that the forward declaration was not necessary, but, according to the final version of the Standard, it is.


dynamic_cast, throw, typeid don't work with shared libraries

The new C++ ABI in the GCC 3.0 series uses address comparisons, rather than string compares, to determine type equality. This leads to better performance. Like other objects that have to be present in the final executable, these std::type_info objects have what is called vague linkage because they are not tightly bound to any one particular translation unit (object file). The compiler has to emit them in any translation unit that requires their presence, and then rely on the linking and loading process to make sure that only one of them is active in the final executable. With static linking all of these symbols are resolved at link time, but with dynamic linking, further resolution occurs at load time. You have to ensure that objects within a shared library are resolved against objects in the executable and other shared libraries.

Template instantiations are another, user visible, case of objects with vague linkage, which needs similar resolution. If you do not take the above precautions, you may discover that a template instantiation with the same argument list, but instantiated in multiple translation units, has several addresses, depending in which translation unit the address is taken. (This is not an exhaustive list of the kind of objects which have vague linkage and are expected to be resolved during linking & loading.)

If you are worried about different objects with the same name colliding during the linking or loading process, then you should use namespaces to disambiguate them. Giving distinct objects with global linkage the same name is a violation of the One Definition Rule (ODR) [basic.def.odr].

For more details about the way that GCC implements these and other C++ features, please read the C++ ABI specification. Note the std::type_info objects which must be resolved all begin with "_ZTS". Refer to ld's documentation for a description of the "-E" & "-Bsymbolic" flags.


Why do I need autoconf, bison, xgettext, automake, etc?

If you're using diffs up dated from one snapshot to the next, or if you're using the SVN repository, you may need several additional programs to build GCC.

These include, but are not necessarily limited to autoconf, automake, bison, and xgettext.

This is necessary because neither diff nor cvs keep timestamps correct. This causes problems for generated files as "make" may think those generated files are out of date and try to regenerate them.

An easy way to work around this problem is to use the gcc_update script in the contrib subdirectory of GCC, which handles this transparently without requiring installation of any additional tools.

If you modified some sources or when building from SVN you may also need some additional tools.


Why can't I build a shared library?

When building a shared library you may get an error message from the linker like `assert pure-text failed:' or `DP relative code in file'.

This kind of error occurs when you've failed to provide proper flags to gcc when linking the shared library.

You can get this error even if all the .o files for the shared library were compiled with the proper PIC option. When building a shared library, gcc will compile additional code to be included in the library. That additional code must also be compiled with the proper PIC option.

Adding the proper PIC option (-fpic or -fPIC) to the link line which creates the shared library will fix this problem on targets that support PIC in this manner. For example:

	gcc -c -fPIC myfile.c
	gcc -shared -o libmyfile.so -fPIC myfile.o

When building C++, the linker says my constructors, destructors or virtual tables are undefined, but I defined them

The ISO C++ Standard specifies that all virtual methods of a class that are not pure-virtual must be defined, but does not require any diagnostic for violations of this rule [class.virtual]/8. Based on this assumption, GCC will only emit the implicitly defined constructors, the assignment operator, the destructor and the virtual table of a class in the translation unit that defines its first such non-inline method.

Therefore, if you fail to define this particular method, the linker may complain about the lack of definitions for apparently unrelated symbols. Unfortunately, in order to improve this error message, it might be necessary to change the linker, and this can't always be done.

The solution is to ensure that all virtual methods that are not pure are defined. Note that a destructor must be defined even if it is declared pure-virtual [class.dtor]/7.

孩子上火吃什么药 棒打鸳鸯什么意思 取保候审需要什么条件 右眼皮跳是什么预兆男 六月19是什么日子
立春之后是什么节气 什么是禅定 易烊千玺的真名叫什么 吃了西瓜不能吃什么 口臭是什么原因
蔓越莓对女性妇科有什么好处 河北有什么市 出海什么意思 狮子座后面是什么星座 种植牙为什么那么贵
醋蛋液主要治什么 来月经小腹痛是什么原因 日语为什么怎么说 备孕要检查什么项目 猪肚子和什么煲汤最好
老年人嗜睡是什么原因hcv9jop8ns1r.cn 不寐病是什么意思hcv9jop2ns3r.cn 尿结石是什么症状hcv8jop1ns4r.cn 珂字五行属什么hcv9jop0ns4r.cn 羊水暗区是什么意思hcv9jop1ns1r.cn
上半身胖属于什么体质hcv9jop2ns8r.cn 一月十号是什么星座bjcbxg.com t波改变是什么意思hcv9jop3ns5r.cn 马凡氏综合症是什么病hcv8jop4ns9r.cn 毛戈平化妆品什么档次hebeidezhi.com
abby是什么意思hcv8jop7ns9r.cn 道谢是什么意思hcv7jop9ns9r.cn 发热挂什么科hcv8jop6ns8r.cn 阴道镜活检是什么意思hcv9jop4ns2r.cn 什么的英语单词hcv9jop4ns0r.cn
目前是什么意思dajiketang.com 啤酒有什么牌子hcv9jop6ns0r.cn 右腹疼是什么原因gysmod.com 州字五行属什么hcv8jop5ns5r.cn 五路财神都叫什么名字0735v.com
百度