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: macro "__has_attribute" requires an identifier" #400

Closed
ztorchan opened this issue May 17, 2023 · 1 comment
Closed

Comments

@ztorchan
Copy link

OS: Ubuntu Server 22.04 LTS
Complier: gcc 11.3.0, g++ 11.3.0
brpc: 1.5.0

$ mkdir build && cd build && cmake .. && make

[  2%] Building CXX object src/CMakeFiles/OBJ_LIB.dir/braft/ballot.cpp.o
In file included from /usr/include/features.h:486,
                 from /usr/include/x86_64-linux-gnu/c++/11/bits/os_defines.h:39,
                 from /usr/include/x86_64-linux-gnu/c++/11/bits/c++config.h:586,
                 from /usr/include/c++/11/string:38,
                 from /home/ubuntu/third_party/braft/src/braft/configuration.h:22,
                 from /home/ubuntu/third_party/braft/src/braft/ballot.h:20,
                 from /home/ubuntu/third_party/braft/src/braft/ballot.cpp:17:
/usr/include/x86_64-linux-gnu/sys/cdefs.h:314:60: error: macro "__has_attribute" requires an identifier
  314 | #if __GNUC_PREREQ (2,5) || __glibc_has_attribute (__const__)
      |                                                            ^
cc1plus: note: unrecognized command-line option ‘-Wno-reserved-user-defined-literal’ may have been intended to silence earlier diagnostics
make[2]: *** [src/CMakeFiles/OBJ_LIB.dir/build.make:76: src/CMakeFiles/OBJ_LIB.dir/braft/ballot.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:120: src/CMakeFiles/OBJ_LIB.dir/all] Error 2
make: *** [Makefile:156: all] Error 2

@ztorchan
Copy link
Author

原先用了v1.1.2 release,换回master最新commit解决了。

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

1 participant