Skip to content

Can't compile when including <pthread.h> with Rasbpian 11 (bullseye) #14

Description

@lucasssvaz

When building the cmake project, after following all instructions and changing the build script to reflect my board, the compilation fails with the following error:

In file included from /usr/include/pthread.h:25,
from /opt/cross-pi-gcc/arm-linux-gnueabihf/include/c++/8.3.0/arm-linux-gnueabihf/bits/gthr-default.h:35,
from /opt/cross-pi-gcc/arm-linux-gnueabihf/include/c++/8.3.0/arm-linux-gnueabihf/bits/gthr.h:148,
from /opt/cross-pi-gcc/arm-linux-gnueabihf/include/c++/8.3.0/ext/atomicity.h:35,
from /opt/cross-pi-gcc/arm-linux-gnueabihf/include/c++/8.3.0/bits/basic_string.h:39,
from /opt/cross-pi-gcc/arm-linux-gnueabihf/include/c++/8.3.0/string:52,
from modbus.h:12,
from modbus.cpp:35:
/opt/cross-pi-gcc/arm-linux-gnueabihf/include/bits/endian.h:2:3: error: #error "Never use <bits/endian.h> directly; include <endian.h> instead."
  • Platform: Raspberry Pi Zero W
  • OS: Rasbpian OS 11 (bullseye)

One solution I found was reverting the OS back to Rasbpian OS 10 (buster) and getting the required files from the board again. After that the code was compiled without any hassle and worked as intended. Both installations were fresh and with all packages updated to the latest version. I also found another user with a similar problem using the toolchain in this forum while trying to compile RtAudio.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions