John McFarlane
John McFarlane

Reputation: 6107

FatalException thrown by protobuf library on instantiation of message

I'm compiling protobuf 3.6.1 from source and linking with an executable which is targeted at Ubuntu 16.04. As soon as an object of any message type gets created, the library throws an exception with the following console output:

[libprotobuf FATAL /myproj/protobuf/src/google/protobuf/generated_message_util.cc:785] CHECK failed: (scc->visit_status.load(std::memory_order_relaxed)) == (SCCInfoBase::kRunning):
terminate called after throwing an instance of 'google::protobuf::FatalException'
what(): CHECK failed: (scc->visit_status.load(std::memory_order_relaxed)) == (SCCInfoBase::kRunning):
Aborted

Upvotes: 3

Views: 5676

Answers (2)

cong cao
cong cao

Reputation: 1

I tried adding -pthread after the compile command and found that it can be executed normally after compilation.

Upvotes: 0

John McFarlane
John McFarlane

Reputation: 6107

As explained here, you need to run pkg-config or otherwise determine what build flags to use in a project which uses protobuf. In this particular case, the pthread library is missing.

Upvotes: 1

Related Questions