problem in nested include -- missing a definition?
Linda A. Walsh
gcc@tlinx.org
Fri Oct 31 21:51:00 GMT 2014
I'm getting the following error:
In file included from /usr/include/features.h:364:0,
from /usr/include/limits.h:25,
from
/usr/lib64/gcc/x86_64-suse-linux/4.8/include-fixed/limits.h:168,
from
/usr/lib64/gcc/x86_64-suse-linux/4.8/include-fixed/syslimits.h:7,
from
/usr/lib64/gcc/x86_64-suse-linux/4.8/include-fixed/limits.h:34,
from /usr/include/c++/4.8/climits:41,
from fieldmetergraph.h:13,
from fieldmetergraph.cc:11:
/usr/include/assert.h:64:1: error: expected unqualified-id before string
constant
__BEGIN_DECLS
^
In file included from fieldmetergraph.h:17:0,
from fieldmetergraph.cc:11:
----
lines from assert.h:
(#48)#ifdef NDEBUG
...
(#62)#else /* Not NDEBUG. */
(#63)
(#64)__BEGIN_DECLS
(#65)
(#66)/* This prints an "Assertion failed" message and aborts. */
(#67)extern void __assert_fail (const char *__assertion, const char *__file,
unsigned int __line, const char *__function)
__THROW __attribute__ ((__noreturn__));
...
(#83)__END_DECLS
============
What should __BEGIN_DECLS expand to and where should it be defined?
You can see the include chain from the error message. The
only oddity I saw was
At features.h#364, I see:
(#361)/* This is here only because every header file already includes
this one. */
(#362)#ifndef __ASSEMBLER__
(#363)# ifndef _SYS_CDEFS_H
(#364)# include <sys/cdefs.h>
(#365)# endif
I don't see an inclusion of "/usr/include/assert.h"
Also odd is a double inclusion of the include file:
/usr/lib64/gcc/x86_64-suse-linux/4.8/include-fixed/limits.h
at 2 places in the include-chain -- not this is a problem, just
uncommon.
More odd, at limits.h:168:
#include_next <limits.h> /* recurse down to the real one */
(not a standard include statement)
Of minor note, these headers come from these packages:
/usr/include/c++/4.8/climits
libstdc++48-devel-4.8.1_20130909-3.2.1.x86_64
/usr/include/features.h glibc-devel-2.18-4.4.1.x86_64
/usr/include/limits.h glibc-devel-2.18-4.4.1.x86_64
/usr/lib64/gcc/x86_64-suse-linux/4.8/include-fixed/limits.h +
/usr/lib64/gcc/x86_64-suse-linux/4.8/include-fixed/syslimits.h
from gcc48-4.8.1_20130909-3.2.1.x86_64
--------------
Should something else be getting included here so that "__BEGIN_DECLS"
is defined to something?
using gcc-4.8 if not clear from above.
More information about the Libstdc++
mailing list