|||
在编译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 |
Archiver|手机版|科学网 ( 京ICP备07017567号-12 )
GMT+8, 2024-6-2 20:11
Powered by ScienceNet.cn
Copyright © 2007- 中国科学报社