быстрая ошибка json: ожидаемый неквалифицированный идентификатор перед 'bool' при сборке для Linux с использованием Bazel - PullRequest
0 голосов
/ 28 февраля 2020

Я компилирую некоторый код C ++, который прекрасно компилируется для Android и iOS, но завершается с ошибкой при Linux. Я искал вокруг, и похоже, что этот вид cra sh обнаруживается, когда разработчик делает что-то не так; например, используя зарезервированное слово. Однако я не вижу, что я делаю неправильно, из-за ошибки, которую я получаю.

In file included from external/rapidjson_artifact/include/rapidjson/document.h:20:0,
             from src/main/cc/com/mycompany/serialization/JsonSerializer.h:4,
             from bazel-out/k8-dbg/genfiles/src/main/java/com/mycompany/model/common/cc/com

/mycompany/model/common/Vector2d.h:13,
                 from bazel-out/k8-dbg/genfiles/src/main/java/com/mycompany/model/common/cc/com/mycompany/model/common/FastVector2d.h:10,
                 from src/main/cc/com/mycompany/api/gestures/primitives/CalculatedElementPosition.h:7,
                 from src/main/cc/com/mycompany/api/gestures/primitives/PointerInteraction.h:7,
                 from src/main/cc/com/mycompany/api/gestures/native/NativeUserInteractionHandler.h:10,
                 from src/main/cc/com/mycompany/linux/api/gestures/UserInteractionHandler.h:4,
                 from src/main/cc/com/mycompany/linux/api/opengl/OpenGlHandler.h:13,
                 from src/main/cc/com/mycompany/linux/api/opengl/OpenGlHandler.cc:1:
external/rapidjson_artifact/include/rapidjson/reader.h:189:15: error: expected unqualified-id before 'bool'
     bool Bool(bool) { return static_cast<Override&>(*this).Default(); }
               ^~~~
external/rapidjson_artifact/include/rapidjson/reader.h:189:15: error: expected ')' before 'bool'
In file included from /usr/include/GL/glx.h:30:0,
                 from src/main/cc/com/mycompany/linux/api/opengl/OpenGlHandler.h:7,
                 from src/main/cc/com/mycompany/linux/api/opengl/OpenGlHandler.cc:1:
external/rapidjson_artifact/include/rapidjson/reader.h: In member function 'void rapidjson::GenericReader<SourceEncoding, TargetEncoding, StackAllocator>::ParseTrue(InputStream&, Handler&)':
external/rapidjson_artifact/include/rapidjson/reader.h:623:26: error: expected unqualified-id before 'int'
             if (!handler.Bool(true))
                          ^
external/rapidjson_artifact/include/rapidjson/reader.h:623:26: error: expected ')' before 'int'
external/rapidjson_artifact/include/rapidjson/reader.h: In member function 'void rapidjson::GenericReader<SourceEncoding, TargetEncoding, StackAllocator>::ParseFalse(InputStream&, Handler&)':
external/rapidjson_artifact/include/rapidjson/reader.h:636:26: error: expected unqualified-id before 'int'
             if (!handler.Bool(false))
                          ^
external/rapidjson_artifact/include/rapidjson/reader.h:636:26: error: expected ')' before 'int'
external/rapidjson_artifact/include/rapidjson/document.h: In member function 'bool rapidjson::GenericValue<Encoding, Allocator>::Accept(Handler&) const':
external/rapidjson_artifact/include/rapidjson/document.h:1539:44: error: expected unqualified-id before 'int'
         case kFalseType:    return handler.Bool(false);
                                            ^
external/rapidjson_artifact/include/rapidjson/document.h:1539:44: error: expected ';' before 'int'
external/rapidjson_artifact/include/rapidjson/document.h:1540:44: error: expected unqualified-id before 'int'
         case kTrueType:     return handler.Bool(true);
                                            ^
external/rapidjson_artifact/include/rapidjson/document.h:1540:44: error: expected ';' before 'int'
In file included from src/main/cc/com/mycompany/serialization/JsonSerializer.h:4:0,
                 from bazel-out/k8-dbg/genfiles/src/main/java/com/mycompany/model/common/cc/com/mycompany/model/common/Vector2d.h:13,
                 from bazel-out/k8-dbg/genfiles/src/main/java/com/mycompany/model/common/cc/com/mycompany/model/common/FastVector2d.h:10,
                 from src/main/cc/com/mycompany/api/gestures/primitives/CalculatedElementPosition.h:7,
                 from src/main/cc/com/mycompany/api/gestures/primitives/PointerInteraction.h:7,
                 from src/main/cc/com/mycompany/api/gestures/native/NativeUserInteractionHandler.h:10,
                 from src/main/cc/com/mycompany/linux/api/gestures/UserInteractionHandler.h:4,
                 from src/main/cc/com/mycompany/linux/api/opengl/OpenGlHandler.h:13,
                 from src/main/cc/com/mycompany/linux/api/opengl/OpenGlHandler.cc:1:
external/rapidjson_artifact/include/rapidjson/document.h: At global scope:
external/rapidjson_artifact/include/rapidjson/document.h:2028:15: error: expected unqualified-id before 'bool'
     bool Bool(bool b) { new (stack_.template Push<ValueType>()) ValueType(b); return true; }
               ^~~~
external/rapidjson_artifact/include/rapidjson/document.h:2028:15: error: expected ')' before 'bool'
In file included from src/main/cc/com/mycompany/serialization/JsonSerializer.h:6:0,
                 from bazel-out/k8-dbg/genfiles/src/main/java/com/mycompany/model/common/cc/com/mycompany/model/common/Vector2d.h:13,
                 from bazel-out/k8-dbg/genfiles/src/main/java/com/mycompany/model/common/cc/com/mycompany/model/common/FastVector2d.h:10,
                 from src/main/cc/com/mycompany/api/gestures/primitives/CalculatedElementPosition.h:7,
                 from src/main/cc/com/mycompany/api/gestures/primitives/PointerInteraction.h:7,
                 from src/main/cc/com/mycompany/api/gestures/native/NativeUserInteractionHandler.h:10,
                 from src/main/cc/com/mycompany/linux/api/gestures/UserInteractionHandler.h:4,
                 from src/main/cc/com/mycompany/linux/api/opengl/OpenGlHandler.h:13,
                 from src/main/cc/com/mycompany/linux/api/opengl/OpenGlHandler.cc:1:
external/rapidjson_artifact/include/rapidjson/writer.h:109:15: error: expected unqualified-id before 'bool'
     bool Bool(bool b)           { Prefix(b ? kTrueType : kFalseType); return WriteBool(b); }
               ^~~~
external/rapidjson_artifact/include/rapidjson/writer.h:109:15: error: expected ')' before 'bool'

Все ошибки указывают на быстрое json, но я очень сомневаюсь, что это проблема. Наверное, я что-то не так делаю.

Может кто-нибудь подсказать, что мне следует искать, чтобы найти причину root?

...