Title: wchar.h: error: '__FILE' was not declared in this scope' error with gcc 5.2.0
Tags: c++;gcc;stdio;powerpc;wchar
Question: I am having trouble compiling code
before it ever gets to the linker. Can anyone point me in the right
direction?

Here is the very simple code of source to reproduce this issue.

```// CpxCryptoIfSimClientC.cpp //
#include <iostream&gt;
// end     
```

Compilation command line:

```powerpc64-wrs-linux-g++ -c -o CpxCryptoIfSimClientC.o   -m64 --sysroot=/proj/platform_cs/linux/deliveries/sdk_install/sysroots/ppc64e6500-wrs-linux -ggdb -O3 -Wextra -Wall -DPOWERPC64 -DLNX -D_GNU_SOURCE   -Os -fno-unit-at-a-time    -pedantic -Wall -Wno-long-long  `xml2-config --cflags` -std=gnu++98  -DINLINE=__inline__ -I../inc   CpxCryptoIfSimClientC.cpp
```

Output:

```In file included from /proj/platform_cs/linux/deliveries/sdk_install/sysroots/ppc64e6500-wrs-linux/usr/include/c++/5.2.0/cwchar:44:0,
             from /proj/platform_cs/linux/deliveries/sdk_install/sysroots/ppc64e6500-wrs-linux/usr/include/c++/5.2.0/bits/postypes.h:40,
             from /proj/platform_cs/linux/deliveries/sdk_install/sysroots/ppc64e6500-wrs-linux/usr/include/c++/5.2.0/iosfwd:40,
             from /proj/platform_cs/linux/deliveries/sdk_install/sysroots/ppc64e6500-wrs-linux/usr/include/c++/5.2.0/ios:38,
             from /proj/platform_cs/linux/deliveriessdk_install/sysroots/ppc64e6500-wrs-linux/usr/include/c++/5.2.0/ostream:38,
             from /proj/platform_cs/linux/deliveries/sdk_install/sysroots/ppc64e6500-wrs-linux/usr/include/c++/5.2.0/iostream:39,
             from ../../TestHelperStrategy_ppc64_linux/SimTestHelper.h:29,
             from ../CpxCryptoIfSimClientC.h:25,
             from ../CpxCryptoIfSimClientC.cpp:20:
/proj/platform_cs/linux/deliveries/sdk_install/sysroots/ppc64e6500-wrs-linux/usr/include/wchar.h:582:8: error: '__FILE' does not name a type
extern __FILE *open_wmemstream (wchar_t **__bufloc, size_t *__sizeloc) __THROW;
/proj/platform_cs/linux/deliveries/epb/epb_epb2_v1.52/sdk_install/sysroots/ppc64e6500-wrs-linux/usr/include/wchar.h:589:19: error: '__FILE' was not declared in this scope extern int fwide (__FILE *__fp, int __mode) __THROW;
/proj/platform_cs/linux/deliveries/epb/epb_epb2_v1.52/sdk_install/sysroots/ppc64e6500-wrs-linux/usr/include/wchar.h:589:27: error: '__fp' was not declared in this scope extern int fwide (__FILE *__fp, int __mode) __THROW;
```

and many similiar errors which are "undeclared in this scope".

Here I am using gcc version 5.2.0 for powerpc64. Is there anything wrong with ```wchar.h``` or any other header file with this gcc version? or am I missing any flag here?

Comment: `-DINLINE=__inline__` -- This seems to me like rather intentionally throwing a wrench into the library implementation gears. Any particular reasion for why you're doing this? More generally speaking, how did you come up with that rather involved compiler invocation in the first place?

Comment: `-O3` followed by `-Os`, `-Wall` appearing twice, and I get a *really* bad feeling about what might hide behind the `........`. Could you reduce this to a [mcve]?

Comment: Post your code.  It looks like you might be missing a header file.



{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 0, 'CommentCount': 3, 'ContentLicense': 'CC BY-SA 4.0', 'CreationDate': '2018:00:08/10/18', 'FavoriteCount': None, 'PostTypeId': 1, 'Tags': '<c++><gcc><stdio><powerpc><wchar>', 'Title': "wchar.h: error: '__FILE' was not declared in this scope' error with gcc 5.2.0", 'ViewCount': 312, 'id': 51784760, 'user_AboutMe': '', 'user_AccountId': 3994697.0, 'user_DisplayName': 'Govardhan Reddy', 'user_Reputation': 115.0, 'user_Views': 30.0, 'user_id': 3292567.0}}