[Qt-creator] How to override clangtools target triplet and how to exlude unknown compiler flags?

Richard Weickelt richard at weickelt.de
Wed Jan 14 17:13:45 CET 2026


Thanks for your reply.

On 1/14/26 14:25, Christian Kandeler via Qt-creator wrote:
> If your build dir is not inside the source dir, I suppose clangd will not 
> find the .clangd file, as its project root is the compile_commands.json 
> file. Try using the general config.yaml and constraining it to your project 
> e.g. via wildcards.

Indeed, my build folder is not in the project directory. When I put a 
.clangd file with the following content next to the compile_commands.json in 
the build folder, the values are still ignored:

CompileFlags:
   Remove: [-G1024, -membedded]

Putting above 2 lines into the config.yaml created by QtCreator under 
$HOME/.config/clangd/ has no effect either.

> 
>> When setting up the compiler, QtCreator fails to identify the ABI properties,
> Meaning what exactly?`

QtCreator prints "unnown-unknown-unknown-elf-32bit. In target triple it then 
prints "ba-elf". The GCC toolchain is a bare metal ELF toolchain.

> 
>>  but overriding them in the compiler setup in QtCreator has absolutely no 
>> effect.
> 
> Did you try the "override for code model" option?

Overriding the value with something that should work, like arm-none-eabi, 
has no effect. The log prints still

error: unknown target triple 'ba-unknown-unknown-elf' [clang-diagnostic-error]




More information about the Qt-creator mailing list