Skip to content

pp_file_not_found sys/cdefs.h file not found  #556

Closed
@keepitsimle

Description

@keepitsimle

Please describe the problem.
I cross-compile the app at code-sever, it's simple , but clangd keeps showing that it can't find the header file.
run cmd "clangd --check=/root/project/cloud-edge-collaboration-test/src/main.cpp" Is there anything I've lost ?
the clangd.arguments setting below:
image

Logs
Please attach the clangd log from the "Output" window if you can.
I[15:47:35.573] argv[0]: clangd
I[15:47:35.573] argv[1]: --check=/root/project/cloud-edge-collaboration-test/src/main.cpp
I[15:47:35.573] Entering check mode (no LSP server)
I[15:47:35.573] Testing on source file /root/project/cloud-edge-collaboration-test/src/main.cpp
I[15:47:35.573] Loading compilation database...
I[15:47:35.573] Loaded compilation database from /root/project/cloud-edge-collaboration-test/build/compile_commands.json
I[15:47:35.574] Compile command from CDB is: /opt/toolchains/gcc-linaro-7.5.0-2019.12-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-g++ --target=aarch64-linux-gnu --driver-mode=g++ -DIS_LITTLE_ENDIAN=1 -I/root/project/cloud-edge-collaboration-test/build/subprojects/stage/include -O3 -DNDEBUG -fPIE -std=gnu++11 -o CMakeFiles/cloud_edge.dir/main.cpp.o -c -resource-dir=/usr/lib/clang/15.0.0 -- /root/project/cloud-edge-collaboration-test/src/main.cpp
I[15:47:35.574] Parsing command...
I[15:47:35.575] internal (cc1) args are: -cc1 -triple aarch64-unknown-linux-gnu -fsyntax-only -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name main.cpp -mrelocation-model pic -pic-level 2 -pic-is-pie -mframe-pointer=non-leaf -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu generic -target-feature +neon -target-feature +v8a -target-abi aapcs -fallow-half-arguments-and-returns -mllvm -treat-scalable-fixed-error-as-warning -debugger-tuning=gdb -fcoverage-compilation-dir=/root/project/cloud-edge-collaboration-test/build/src -resource-dir /usr/lib/clang/15.0.0 -D IS_LITTLE_ENDIAN=1 -I /root/project/cloud-edge-collaboration-test/build/subprojects/stage/include -D NDEBUG -internal-isystem /opt/toolchains/gcc-linaro-7.5.0-2019.12-x86_64_aarch64-linux-gnu/bin/../lib/gcc/aarch64-linux-gnu/7.5.0/../../../../aarch64-linux-gnu/include/c++/7.5.0 -internal-isystem /opt/toolchains/gcc-linaro-7.5.0-2019.12-x86_64_aarch64-linux-gnu/bin/../lib/gcc/aarch64-linux-gnu/7.5.0/../../../../aarch64-linux-gnu/include/c++/7.5.0/aarch64-linux-gnu -internal-isystem /opt/toolchains/gcc-linaro-7.5.0-2019.12-x86_64_aarch64-linux-gnu/bin/../lib/gcc/aarch64-linux-gnu/7.5.0/../../../../aarch64-linux-gnu/include/c++/7.5.0/backward -internal-isystem /usr/lib/clang/15.0.0/include -internal-isystem /usr/local/include -internal-isystem /opt/toolchains/gcc-linaro-7.5.0-2019.12-x86_64_aarch64-linux-gnu/bin/../lib/gcc/aarch64-linux-gnu/7.5.0/../../../../aarch64-linux-gnu/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -O3 -std=gnu++11 -fdeprecated-macro -fdebug-compilation-dir=/root/project/cloud-edge-collaboration-test/build/src -ferror-limit 19 -fno-signed-char -fgnuc-version=4.2.1 -fcxx-exceptions -fexceptions -vectorize-loops -vectorize-slp -no-round-trip-args -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -x c++ /root/project/cloud-edge-collaboration-test/src/main.cpp
I[15:47:35.575] Building preamble...
I[15:47:35.696] Indexing headers...
E[15:47:35.736] [pp_file_not_found] Line 3: in included file: 'sys/cdefs.h' file not found
I[15:47:35.736] Building AST...
E[15:47:35.740] [typecheck_invalid_operands] Line 8: invalid operands to binary expression ('std::ostream' (aka 'int') and 'const char[19]')
I[15:47:35.740] Indexing AST...
I[15:47:35.740] Building inlay hints
I[15:47:35.740] Testing features at each token (may be slow in large files)
I[15:47:35.742] All checks completed, 2 errors

System information
Clangd version (from the log, or clangd --version):
clangd extension version:
Operating system:

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions