Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error occured while running ninja build #39

Open
hanchiho opened this issue Aug 5, 2024 · 1 comment
Open

Error occured while running ninja build #39

hanchiho opened this issue Aug 5, 2024 · 1 comment

Comments

@hanchiho
Copy link

hanchiho commented Aug 5, 2024

Hi,

My host machine is linux x86-64 machine(ubuntu 18.04), and trying to build android platform tools that works for arm64, as my target machine is raspberry pi which is arm64.
tool that you are providing seems to be exactly what i've been looking for weeks, but following the steps have some problem.

test command: ninja -j$(nproc --all)

1. config.h missing

FAILED: /usr/bin/c++   -DGOOGLE_PROTOBUF_CMAKE_BUILD -DHAVE_ZLIB -I. -I../src -std=c++11 -MMD -MT CMakeFiles/libprotobuf-lite.dir/src/google/protobuf/stubs/common.cc.o -MF CMakeFiles/libprotobuf-lite.dir/src/google/protobuf/stubs/common.cc.o.d -o CMakeFiles/libprotobuf-lite.dir/src/google/protobuf/stubs/common.cc.o -c ../src/google/protobuf/stubs/common.cc
../src/google/protobuf/stubs/common.cc:41:20: fatal error: config.h: No such file or directory
compilation terminated.

I can't find any config.h file in the path or inside any relative path.
Can you tell me where to get it? or How can I fix this error?

2. missing binary operator before token "("

A lot of errors are comming out during ninja comand

../src/google/protobuf/parse_context.h:575:18: error: missing binary operator before token "("
 #if __has_builtin(__builtin_add_overflow) && __has_builtin(__builtin_sub_overflow)

parse_context.h

  }
  uint32_t second = static_cast<uint8_t>(p[1]);
**_#if __has_builtin(__builtin_add_overflow) && __has_builtin(__builtin_sub_overflow)_**
  uint32_t second_minus_1;
  __builtin_sub_overflow(second, 1, &second_minus_1);
  __builtin_add_overflow(res, second_minus_1 << 7, &res);
#else
  res += (second - 1) << 7;
#endif
  if (second < 128) {
    *out = res;

#if __has_builtin(__builtin_add_overflow) && __has_builtin(__builtin_sub_overflow) seems to be invoking errors, but don't know how to change it.

I cloned sourcecode not specifing any branch or tags.
Please can you help me remove this issue?

@lzhiyong
Copy link
Owner

modify protobuf/CMakeLists.txt

# L298
# add android to include directory
# as follows
include_directories(
  ${ZLIB_INCLUDE_DIRECTORIES}
  ${protobuf_BINARY_DIR}
  ${protobuf_SOURCE_DIR}/src
  ${protobuf_SOURCE_DIR}/android)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants