3

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

2 Answers 2

1

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.

3
  • 1
    So what else does one try when all these flags are present for the dependent code? I still get this issue with self-compiled mosh.
    – oarfish
    Commented Mar 18, 2021 at 10:34
  • @oarfish, I'm afraid I can't say. It sounds like the topic for a new question. Commented Mar 18, 2021 at 18:13
  • 1
    In my case i had to compile both client and server with the required flags and also use a recent compiler.
    – oarfish
    Commented Mar 19, 2021 at 19:50
0

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

1
  • Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.
    – Community Bot
    Commented May 13 at 9:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.