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

Some error were encountered while trying to compile protobuf for PS4 #2

Open
LambdaHL opened this issue Mar 9, 2022 · 0 comments
Open

Comments

@LambdaHL
Copy link

LambdaHL commented Mar 9, 2022

Environment:

  • UE4.26.2
  • Protobuf 3.19.4
  • VS2017
  • clang tool chain v17 10.0.1-centos7
  • cmake 3.22.3
  • PS4 SDK 8.000

Encountered following problems:

  1. CMakeList.txt specified to build with c++11, however some header files of PS4 SDK have following macro definitions which caused build failure:
#if __cplusplus<=201103L  
  #error This version of C++ is not compatible with the standard library implementation. 
#endif

I made it work by changing the specified c++ version from 11 to 14 in CMakeList.txt

  1. Some header files of protobuf have following code which also caused build failure:
#elif defined(__FreeBSD__)  
#include <sys/endian.h>  // __BYTE_ORDER

Compiler can't find this header file because I am building these files on Windows platform. It works after I modified this code block to

#elif defined(__FreeBSD__)
#define PROTOBUF_LITTLE_ENDIAN 1
  1. Finally I don't know how to solve following errors because I am not a C++ developer but a golang developer QAQ

G:\protobuf-3.19.4\src\google\protobuf\arena_impl.h(534,44): error : alignment (64) of thread-local variable 'thread_cache' is greater than the maximum supported alignment (32) for a thread-local variable on this target [G:\protobuf-3.19.4\cmake\build\PS4\libprotobuf.vcxproj]

G:\protobuf-3.19.4\src\google\protobuf\stubs\mutex.h(124,13): error : constexpr constructor never produces a constant expression [-Winvalid-constexpr] [G:\protobuf-3.19.4\cmake\build\PS4\libprotobuf.vcxproj]

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