I'm stuck with the error below while building a private vendor specific clone of AOSP. What's weird is that I have tried on 3 machines and everything works fine one the one machine that I cannot use.
/home/username/workspace/aosp/prebuilts/clang/host/linux-x86/clang-r383902b1/bin/clang++ -c -DPCCTS_USE_NAMESPACE_STD -I Pccts/h -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/ Pccts/h/AParser.cpp -o AParser.o
In file included from Pccts/h/AParser.cpp:30:
In file included from Pccts/h/pcctscfg.h:61:
Pccts/h/pccts_stdio.h:5:10: fatal error: 'cstdio' file not found
#include <cstdio>
^~~~~~~~
1 error generated.
make[3]: *** [GNUmakefile:68: AParser.o] Error 1
make[3]: Leaving directory '/home/username/workspace/aosp/bootable/bootloader/edk2/BaseTools/Source/C/VfrCompile'
make[2]: *** [GNUmakefile:79: VfrCompile] Error 2
make[2]: Leaving directory '/home/username/workspace/aosp/bootable/bootloader/edk2/BaseTools/Source/C'
make[1]: *** [GNUmakefile:25: Source/C] Error 2
make[1]: Leaving directory '/home/username/workspace/aosp/bootable/bootloader/edk2/BaseTools'
make: *** [makefile:133: EDK_TOOLS_BIN] Error 2
make: Leaving directory '/home/username/workspace/aosp/bootable/bootloader/edk2'
Background: I need to build an app inside this AOSP environment. This app uses hidden APIs so it can only build within AOSP env. I have tried this on 3 machines:
Out of these 3 machines I've only been able to build it on #1. The problem with that is that I can't put any corporate code on mer personal PC.
In order to replicate my success from the personal PC on the corporate ones, I tried the following:
I've checked and installed gcc, g++, clang, and anything else I could think of, but nothing seems to resolve it. The fact that the 3 environments are as close to each other as I know how to make them and I'm literally copying the exact same code, but only one works is even more confusing to me.
These two things worked for me:
sudo apt install libstdc++-12-dev
(from https://stackoverflow.com/a/75443790)
install openssl 1.1 (from https://askubuntu.com/questions/1403837/how-do-i-use-openssl-1-1-1-in-ubuntu-22-04 but updated to the latest version of the packages on that repo which is 20 at the time of writing):
# download binary openssl packages from Impish build
wget http://security.ubuntu.com/ubuntu/pool/main/o/openssl/openssl_1.1.1f-1ubuntu2.20_amd64.deb
wget http://security.ubuntu.com/ubuntu/pool/main/o/openssl/libssl-dev_1.1.1f-1ubuntu2.20_amd64.deb
wget http://security.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2.20_amd64.deb
# install downloaded binary packages
sudo dpkg -i libssl1.1_1.1.1f-1ubuntu2.20_amd64.deb
sudo dpkg -i libssl-dev_1.1.1f-1ubuntu2.20_amd64.deb
sudo dpkg -i openssl_1.1.1f-1ubuntu2.20_amd64.deb