Skip to content

MacOS compile error with "unknown type name 'uint16_t'" #3971

@YingChenlu

Description

@YingChenlu

macOS: Sequoia 版本15.6.1(24G90)
Xcode: 26.0.1 (17A400)
command:

cmake .. -DMNN_LOW_MEMORY=ON -DMNN_BUILD_CONVERTER=ON -DMNN_BUILD_QUANTOOLS=ON && make -j4

error:

/Users/xxx/Documents/MNN/source/backend/cpu/x86_x64/cpu_id.cc:236:7: error: unknown type name 'uint16_t'
  236 |       uint16_t commpage64_ver = *((uint16_t *)(commpage64_addr + 0x01E));
      |       ^
/Users/xxx/Documents/MNN/source/backend/cpu/x86_x64/cpu_id.cc:236:36: error: use of undeclared identifier 'uint16_t'
  236 |       uint16_t commpage64_ver = *((uint16_t *)(commpage64_addr + 0x01E));
      |                                    ^
/Users/xxx/Documents/MNN/source/backend/cpu/x86_x64/cpu_id.cc:236:46: error: expected expression
  236 |       uint16_t commpage64_ver = *((uint16_t *)(commpage64_addr + 0x01E));
      |                                              ^
/Users/xxx/Documents/MNN/source/backend/cpu/x86_x64/cpu_id.cc:239:9: error: unknown type name 'uint64_t'
  239 |         uint64_t commpage64_cap = *((uint64_t *)(commpage64_addr + 0x010));
      |         ^
/Users/xxx/Documents/MNN/source/backend/cpu/x86_x64/cpu_id.cc:239:38: error: use of undeclared identifier 'uint64_t'
  239 |         uint64_t commpage64_cap = *((uint64_t *)(commpage64_addr + 0x010));
      |                                      ^
/Users/xxx/Documents/MNN/source/backend/cpu/x86_x64/cpu_id.cc:239:48: error: expected expression
  239 |         uint64_t commpage64_cap = *((uint64_t *)(commpage64_addr + 0x010));
      |                                                ^
6 errors generated.

After editing cpu_id.cc and including <cstdint>, the error has gone.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions