简体   繁体   中英

C++ builder Android fail to compile App?

An Android project is failing to compile within C++Builder 10.1 Berlin Update 2.

The IDE reports these errors:

bccaarm command line for "MainU.cpp"
  c:\program files (x86)\embarcadero\studio\18.0\bin\bccaarm.exe -cc1 -D _DEBUG -n .\Android\Debug -isysroot 
  C:\Users\MIDO\Documents\Embarcadero\Studio\18.0\PlatformSDKs\android-ndk-r9c\platforms\android-14\arch-arm -idirafter =\usr\include -idirafter 
  C:\Users\MIDO\Documents\Embarcadero\Studio\18.0\PlatformSDKs\android-ndk-r9c\sources\cxx-stl\gnu-libstdc++\4.8\include -idirafter 
  C:\Users\MIDO\Documents\Embarcadero\Studio\18.0\PlatformSDKs\android-ndk-r9c\sources\cxx-stl\gnu-libstdc++\4.8\include -idirafter 
  C:\Users\MIDO\Documents\Embarcadero\Studio\18.0\PlatformSDKs\android-ndk-r9c\sources\cxx-stl\gnu-libstdc++\4.8\libs\armeabi-v7a\include -idirafter 
  C:\Users\MIDO\Documents\Embarcadero\Studio\18.0\PlatformSDKs\android-ndk-r9c\sources\android\native_app_glue -I "D:\L-Development\AUB Projects\AUB 
  Apps\Mobile\AUBE Branch Contacts" -I "c:\program files (x86)\embarcadero\studio\18.0\include\android\fmx" -I "..\..\..\..\Main Library\Units" -I 
  "C:\Users\Ahmed Sayed\Desktop\ActivitiesXE6\ActivitiesXE6" -I "..\..\..\..\Main Library\Units\FMX" -I "..\..\..\..\Main Library\Classes" -I 
  "..\..\..\..\Main Library\Clients\FMX\Frames" -I "D:\L-Development\Main Library\Units\FMX" -I "D:\L-Development\Main Library\Classes" -I 
  "D:\L-Development\Main Library\Clients\FMX\Frames" -I "..\..\..\..\Desktop\AUBE Contacts Test" -isystem "C:\Program Files 
  (x86)\Woll2Woll\FirePower\10.0\include\18.0\Android" -isystem "c:\program files (x86)\embarcadero\studio\18.0\include" -isystem "c:\program files 
  (x86)\embarcadero\studio\18.0\include\android\rtl" -isystem "c:\program files (x86)\embarcadero\studio\18.0\include\android\fmx" -isystem "c:\program 
  files (x86)\embarcadero\studio\18.0\include\android\crtl" -isystem C:\Users\Public\Documents\Embarcadero\Studio\18.0\hpp\Android -g 
  -fno-limit-debug-info -fborland-extensions -fborland-auto-refcount -nobuiltininc -nostdsysteminc -triple thumbv7-none-linux-androideabi -emit-obj 
  -mconstructor-aliases -pic-level 2 -target-abi aapcs-linux -target-cpu cortex-a8  -nostdinc++ -fdeprecated-macro -fexceptions -fcxx-exceptions 
  -munwind-tables -mstackrealign -fno-spell-checking -main-file-name MainU.cpp -x c++ -std=c++11 -O2 -fmath-errno -tU -o .\Android\Debug\MainU.o 
  -dependency-file .\Android\Debug\MainU.d -MT .\Android\Debug\MainU.o MainU.cpp 
[bccaarm Error] SystemTypes.h(1278): implicit instantiation of undefined template 'System::DynamicArray<unsigned char>'
  sysmac.h(603): template is declared here
[bccaarm Error] SystemTypes.h(1286): implicit instantiation of undefined template 'System::DynamicArray<unsigned char>'
  sysmac.h(603): template is declared here
[bccaarm Error] SystemTypes.h(1292): implicit instantiation of undefined template 'System::DynamicArray<unsigned char>'
  sysmac.h(603): template is declared here
[bccaarm Error] MainU.cpp(1): ICE: Internal compiler error: C0000005 @ 548FD234

I don't even use DynamicArray anywhere in the project. I am using Windows 10. This was working fine with Windows 7.

The error happens after I add a cpp file to the project. And even if I remove the file from the project, the error remains. It's like the project is corrupted.

This is the error:

错误

Is this a bug for Android development on Windows 10 or something?

When I build an empty Android project, it compiles fine. But when I only add a file, it produces the DynamicArray error above. As you can see, the file code is commented, so there is no reason to give an error at all.

Resolved:

Just found a workaround.

The Networking unit that I was adding to the project was originally in a different folder that the project folder so for you to test it you need to move Networking some where else.

Coping the unit files in project directory before adding them fixes the issue for android compilation.

But the problem will exits if I forget and added another unit from a different location. Even after removing that unit the problem remains. It is like the project file has been infected with it.

Win7

  1. This compile error should be easy to resolve:

    PROBLEM:

    [bccaarm Error] SystemTypes.h(1278): implicit instantiation of undefined template 'System::DynamicArray<unsigned char>' sysmac.h(603): template is declared here

    SOLUTION:

    #include <sysmac.h>

    #include <SystemTypes.h>

In other words, include "sysmac.h" before "SystemTypes.h"

  1. I understand that you THINK it works on Win7, but not on Win10 ... but that's probably just a "coincidence". Maybe you have a different SDK and/or compiler version, maybe it was installed differently ... there are a million possibilities. But it's unlikely the problem is "win7" vs. "win10" per se...

  2. In your example, you commented out every line in "Networking.h". Why??? In general, you should never NEVER edit system headers.

  3. You might want to consider doing a "clean" of your project, and rebuilding from scratch.

  4. You might even want to consider uninstalling and reinstalling C++ Builder and your Android SDK. Or installing it on a different PC.

I hope that helps...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM