xamcat/mobcat-samples

Unable to build using Clang after including system header in C++

Opened this issue · 0 comments

I'm trying to run given shellscript for my own c++ file with some syteam headers(e.g iostream, vector ) but getting below error while build .

Build for x86:
Compiling and linking (output as dynamic library)
In file included from D:/MathFuncs/mobcat-samples/cpp_with_xamarin/Sample/MathFuncsLib/tmp/sourceFiles/MyMathFuncs.cpp:2:
In file included from C:\Users\xyz\AppData\Local\Android\Sdk\ndk-bundle\toolchains\llvm\prebuilt\windows-x86_64\bin/../sysroot/usr/include/c++/v1\iostream:37:
In file included from C:\Users\xyz\AppData\Local\Android\Sdk\ndk-bundle\toolchains\llvm\prebuilt\windows-x86_64\bin/../sysroot/usr/include/c++/v1\ios:214:
In file included from C:\Users\xyz\AppData\Local\Android\Sdk\ndk-bundle\toolchains\llvm\prebuilt\windows-x86_64\bin/../sysroot/usr/include/c++/v1\iosfwd:95:
In file included from C:\Users\xyz\AppData\Local\Android\Sdk\ndk-bundle\toolchains\llvm\prebuilt\windows-x86_64\bin/../sysroot/usr/include/c++/v1\wchar.h:118:
In file included from C:\Users\xyz\AppData\Local\Android\Sdk\ndk-bundle\toolchains\llvm\prebuilt\windows-x86_64\bin/../sysroot/usr/local/include\wchar.h:32:
In file included from C:\Users\xyz\AppData\Local\Android\Sdk\ndk-bundle\toolchains\llvm\prebuilt\windows-x86_64\bin/../sysroot/usr/include\wchar.h:33:
In file included from C:\Users\xyz\AppData\Local\Android\Sdk\ndk-bundle\toolchains\llvm\prebuilt\windows-x86_64\bin/../sysroot/usr/include/c++/v1\stdio.h:107:
In file included from C:\Users\xyz\AppData\Local\Android\Sdk\ndk-bundle\toolchains\llvm\prebuilt\windows-x86_64\bin/../sysroot/usr/include\stdio.h:42:
In file included from C:\Users\xyz\AppData\Local\Android\Sdk\ndk-bundle\toolchains\llvm\prebuilt\windows-x86_64\bin/../sysroot/usr/include\sys/types.h:33:
In file included from C:\Users\xyz\AppData\Local\Android\Sdk\ndk-bundle\toolchains\llvm\prebuilt\windows-x86_64\bin/../sysroot/usr/include/c++/v1\stdint.h:123:
In file included from C:\Users\xyz\AppData\Local\Android\Sdk\ndk-bundle\toolchains\llvm\prebuilt\windows-x86_64\lib64\clang\9.0.8\include\stdint.h:11:
C:\Users\xyz\AppData\Local\Android\Sdk\ndk-bundle\toolchains\llvm\prebuilt\windows-x86_64\lib64\clang\9.0.8\include\vcruntime.h:96:1: error: C++ requires a type specifier for all declarations
_CRT_BEGIN_C_HEADER
^
C:\Users\xyz\AppData\Local\Android\Sdk\ndk-bundle\toolchains\llvm\prebuilt\windows-x86_64\lib64\clang\9.0.8\include\vcruntime.h:69:9: note: expanded from macro '_CRT_BEGIN_C_HEADER'
__pragma(pack(push, _CRT_PACKING))
^
C:\Users\xyz\AppData\Local\Android\Sdk\ndk-bundle\toolchains\llvm\prebuilt\windows-x86_64\lib64\clang\9.0.8\include\vcruntime.h:96:1: error: use of undeclared identifier 'push'
C:\Users\xyz\AppData\Local\Android\Sdk\ndk-bundle\toolchains\llvm\prebuilt\windows-x86_64\lib64\clang\9.0.8\include\vcruntime.h:69:23: note: expanded from macro '_CRT_BEGIN_C_HEADER'
__pragma(pack(push, _CRT_PACKING))
^
C:\Users\xyz\AppData\Local\Android\Sdk\ndk-bundle\toolchains\llvm\prebuilt\windows-x86_64\lib64\clang\9.0.8\include\vcruntime.h:96:1: error: expected ';' after top level declarator
C:\Users\xyz\AppData\Local\Android\Sdk\ndk-bundle\toolchains\llvm\prebuilt\windows-x86_64\lib64\clang\9.0.8\include\vcruntime.h:70:9: note: expanded from macro '_CRT_BEGIN_C_HEADER'
extern "C" {
^
C:\Users\xyz\AppData\Local\Android\Sdk\ndk-bundle\toolchains\llvm\prebuilt\windows-x86_64\lib64\clang\9.0.8\include\vcruntime.h:228:22: error: 'short wchar_t' is invalid
typedef unsigned short wchar_t;
^