Clion not finding STL bits in WSL Ubuntu for 32bit target

Hi everybody,

I'm facing an issue where Clion is not finding the STL "bits" for a 32bit target and is, hence, marking all C methods unknown. In contrast, the compiler and linker do not show any issues and the program executes just fine.

I'm using Clang 12 as my Toolchain with Ubuntu in WSL.

Let's take cstdint for example.
When I include cstdint, it will include "stdint.h" from clang which falls back to the systems "/usr/include/stdint.h" using "#include_next". stdint.h includes "bits/stdint_intn.h" where bits is /usr/include/bits and links to /usr/include/x86_64-linux-gnu/bits. This is all working fine when I generate without the "-m32" flag.
When I add "-m32" to the CMAKE_CXX_FLAGS now, Clion seems to "forget" about that specific bits directory alltogether...

This is probably some usage fault but I'm out of ideas and would be very happy about any help or insight in what I'm doing wrong. Many thanks in advance!

Please sign in to leave a comment.