Header File Not Found During Source File Scan with the Tiancheng Code Optimizer
Symptom
When running the tool, a message is displayed indicating that the header file cannot be found.
Possible Causes
The project, system, or other header files for the source file cannot be found.
Troubleshooting Procedure
- The project header file cannot be found.
When scanning the source file, use the -r parameter to specify the root directory of the project containing the source file. The Tiancheng Code Optimizer will then automatically analyze and locate the required header files.
- The system header file cannot be found.
- Download the BiSheng Compiler (BiSheng Compiler 4.2.0 in earlier versions) and upload it to a custom directory (for example, /home/demo) on the server.
- Extract the BiSheng Compiler installation package.
cd /home/demo tar -zxvf BiShengCompiler-4.2.0-aarch64-linux.tar.gz
- Add the following environment variables to ~/.bashrc:
export INCLUDE=/home/demo/BiShengCompiler-4.2.0-aarch64-linux/lib/clang/17/include/:/home/demo/BiShengCompiler-4.2.0-aarch64-linux/include:$INCLUDE export C_INCLUDE_PATH=/home/demo/BiShengCompiler-4.2.0-aarch64-linux/lib/clang/17/include/:/home/demo/BiShengCompiler-4.2.0-aarch64-linux/include:C_INCLUDE_PATH export CPLUS_INCLUDE_PATH=/home/demo/BiShengCompiler-4.2.0-aarch64-linux/lib/clang/17/include/:/home/demo/BiShengCompiler-4.2.0-aarch64-linux/include:/home/demo/BiShengCompiler-4.2.0-aarch64-linux/include/c++/v1/:$CPLUS_INCLUDE_PATH export LD_LIBRARY_PATH=/home/demo/BiShengCompiler-4.2.0-aarch64-linux/lib:/home/demo/BiShengCompiler-4.2.0-aarch64-linux/lib64:$LD_LIBRARY_PATH export LIBRARY_PATH=/home/demo/BiShengCompiler-4.2.0-aarch64-linux/lib:/home/demo/BiShengCompiler-4.2.0-aarch64-linux/lib64:$LIBRARY_PATH export PATH=/home/demo/BiShengCompiler-4.2.0-aarch64-linux/bin:$PATH
- Make the configuration take effect.
source ~/.bashrc
- Other header files cannot be found.
When scanning the source file, use the -I parameter to specify the path to a missing header file. Multiple -I parameters can be used together.
Parent topic: FAQs