weihuayi的个人博客分享 http://blog.sciencenet.cn/u/weihuayi

博文

GCC 4.4 related build problems: missing #include

已有 4971 次阅读 2010-12-10 08:19 |个人分类: C++|系统分类:科研笔记|关键词:学者

在编译Deal.II 6.0.0, 遇到如下问题:

source/parsed_function.cc:86: error: ‘sscanf’ was not declared in this scope

google 一下原因,原来是编译器的原因。

 

解决办法:

在parsed_function.h中加入 #include <cstdio>,then every thing is OK.

 

The following is the original words: (http://www.cyrius.com/journal/gcc)

C++ header dependencies got cleaned up in GCC 4.3, which broke a lot of code which relied on headers to be included indirectly through some other headers. I found some new build failures with GCC 4.4 related to missing #includes; in particular, #include <cstdio> is missing in a lot of code.

Typical errors look like these:

error: 'sscanf' was not declared in this scope error: 'EOF' was not declared in this scope error: '::fseek' has not been declared error: 'uint32_t' does not name a type 

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

Functions and defines Header
fopen, fwrite, fclose cstdio
fread, fseek, feof cstdio
sscanf, sprintf cstdio
rename, open cstdio
EOF cstdio
memset, memcpy, strdup cstring
va_list cstdarg
int16_t, uint32_t stdint.h


https://m.sciencenet.cn/blog-284809-392071.html

上一篇:boost::ublas中的稀疏矩阵
下一篇:编译showmesh.c

0

发表评论 评论 (0 个评论)

数据加载中...

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-6-2 20:11

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部