Skip to content

[C++] Build fails in util/pcre.h due to missing #include <cstdint> #43350

Closed

Description

@sergeibelov113

Describe the bug, including details regarding any error messages, version, and platform.

Description

Building the project fails with the following error in util/pcre.h:

/arrow/cpp/re2_ep-prefix/src/re2_ep/util/pcre.h:503:11: error: 'int32_t' does not name a type

Environment

  • OS: Docker Alpine 3.20
  • Compiler: g++ (Alpine 13.2.1_git20240309) 13.2.1 20240309
  • Build System: Ninja

Steps to Reproduce

apk update && apk add --no-cache \
    gcc \
    g++ \
    curl \
    unixodbc-dev \
    bash \
    libffi-dev \
    openssl-dev \
    cargo \
    musl-dev \
    postgresql-dev \
    cmake \
    rust \
    linux-headers \
    libc-dev \
    libgcc \
    libstdc++ \
    ca-certificates \
    zlib-dev \
    bzip2-dev \
    xz-dev \
    lz4-dev \
    zstd-dev \
    snappy-dev \
    brotli-dev \
    py3-numpy \
    py3-pandas \
    build-base \
    autoconf \
    boost-dev \
    flex \
    libxml2-dev \
    libxslt-dev \
    libjpeg-turbo-dev \
    ninja \
    git

export ARROW_VERSION=17.0.0
export ARROW_SHA256=8379554d89f19f2c8db63620721cabade62541f47a4e706dfb0a401f05a713ef
export ARROW_BUILD_TYPE=release
export ARROW_HOME=/usr/local
export PARQUET_HOME=/usr/local

 mkdir /arrow \
    && wget -q https://github.com/apache/arrow/archive/apache-arrow-${ARROW_VERSION}.tar.gz -O /tmp/apache-arrow.tar.gz \
    && echo "${ARROW_SHA256} *apache-arrow.tar.gz" | sha256sum /tmp/apache-arrow.tar.gz \
    && tar -xvf /tmp/apache-arrow.tar.gz -C /arrow --strip-components 1

cd /arrow/cpp \
    && cmake --preset ninja-release-python \
    && cmake --build . --target install \

Suggested Fix

Adding #include <cstdint> to util/pcre.h resolves the issue:

patch -p1 < /arrow/re2_patch.diff

diff --git a/util/pcre.h b/util/pcre.h
index e69de29..b6f3e31 100644
--- a/util/pcre.h
+++ b/util/pcre.h
@@ -21,6 +21,7 @@
 #include "re2/filtered_re2.h"
 #include "re2/pod_array.h"
 #include "re2/stringpiece.h"
+#include <cstdint>
#include <cstdint>



### Component(s)

C++

Activity

  1. pitrou commented on Sep 18, 2024

    @pitrou
    Member

    @sergeibelov113 This is a bug in the re2 library, can you report it there?

  2. DoumanAsh commented on Nov 7, 2024

    @DoumanAsh

    You can install re2's dev package via your package manager
    The issue is because arrow uses outdated re2 if it cannot find one in system I think
    master branch of re2 no longer uses int32_t in that header

  3. changed the title [-]Build fails in util/pcre.h due to missing #include <cstdint>[/-] [+][C++] Build fails in util/pcre.h due to missing #include <cstdint>[/+] on Oct 31, 2025
  4. added a commit that references this issue on Oct 31, 2025
  5. thisisnic commented on Dec 12, 2025

    @thisisnic
    Member

    I believe this should be resolved since we bumped the bundled version of RE2 in #48011 - if this is still a problem feel free to reopen this issue.

  6. added a commit that references this issue on Dec 22, 2025
  7. added a commit that references this issue on May 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions