I just built clang and then I was following a simple helloworld
guide on Getting Started with the LLVM System — LLVM 17.0.0git documentation. But the
compilation failed because clang said 'stdio.h' file not found
.
I couldn’t even find this header file in my build directory build/lib/clang/16/include
, although it looks like full of header files.
The command I used to build the toolchain is
cmake -G Ninja -S ../llvm-project-llvmorg-16.0.6/llvm \
> -DCMAKE_BUILD_TYPE="Debug" \
> -DBUILD_SHARED_LIBS=ON -DLLVM_USE_SPLIT_DWARF=ON \
> -DLLVM_OPTIMIZED_TABLEGEN=ON \
> -DLLVM_TARGETS_TO_BUILD="X86" \
> -DLLVM_ENABLE_PROJECTS="clang;lld"
I then tried another simple source file without the stdio.h
:
int main(void)
{
return 0;
}
Then lld
reported a whole bunch of errors saying unable to find library -l...
lld: error: unable to find library -lmingw32
lld: error: unable to find library -lgcc
lld: error: unable to find library -lgcc_eh
...
Can someone tell me what’s going on?