0

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>
// 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?

valiano
  • 16,433
  • 7
  • 64
  • 79
Govardhan Reddy
  • 115
  • 1
  • 11
  • Post your code. It looks like you might be missing a header file. – Andrew Henle Aug 10 '18 at 10:46
  • `-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? – DevSolar Aug 10 '18 at 10:47
  • 1
    `-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]? – DevSolar Aug 10 '18 at 10:53

0 Answers0