Chinaunix首页 | 论坛 | 博客
  • 博客访问: 15498432
  • 博文数量: 2005
  • 博客积分: 11986
  • 博客等级: 上将
  • 技术积分: 22535
  • 用 户 组: 普通用户
  • 注册时间: 2007-05-17 13:56
文章分类

全部博文(2005)

文章存档

2014年(2)

2013年(2)

2012年(16)

2011年(66)

2010年(368)

2009年(743)

2008年(491)

2007年(317)

分类: LINUX

2009-07-09 14:45:13

GCC4.3开始为了提高编译速度,将不再自动搜索一些头文件目录,需要手工添加,之前版本如GCC 4.2,4.2等仍然支持自动搜索.
gcc4.3 atol string not declared in this scope

In GCC 4.3 the C++ header dependencies have been . In the past, compilation would often be quite slow because including a simple header would indirectly include a lot of other headers, even if they were not needed to compile the current code. Many headers have now been cleaned up with the result that compilation is quicker. The downside is that programmers cannot rely on indirect inclusion of headers they may need anymore. Instead, everything that is needed has to be directly referenced with an #include.

Typical errors look like these:

error: 'find' is not a member of 'std'
error: 'exit' was not declared in this scope

Below is a table showing which header needs to be included for a number of common functions:

Functions and definesHeader
find, for_each, sortalgorithm
isalnum, touppercctype
INT_MIN, RAND_MAXclimits
printfcstdio
atoi, free, randcstdlib
EXIT_FAILUREcstdlib
strcmp, memcpycstring
auto_ptrmemory
fd_set, mode_tsys/types.h
typeidtypeinfo
Thu, 10 May 2007; 15:56 — —

Even though GCC 4.2 has seen many delays and still hasn't been released (although it's finally getting close), a lot of development has already been done on trunk for the release of GCC 4.3. I started testing 4.3 in March and in addition to finding and reporting compiler issues I have on packages that fail to build with GCC 4.3. The idea is to give people an advance warning and to be ready for GCC 4.3 when it will be released.

We have almost 500 bugs related to GCC 4.3 already, mostly due to a clean-up of C++ headers in GCC that has exposed sloppy programming in many programs. Fortunately, these bugs are easy to fix. As I'm finding common mistakes in packages, I will document these problems and way to make sure a program is ready for GCC 4.3.

Common problems

  • directives

Update: there is now a that describes the most common problems people will face when moving to GCC 4.3.


阅读(2090) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~