Undefined Reference to Google::Protobuf::Internal::Empty_String_[Abi:Cxx11]

Undefined reference to google::protobuf::internal::empty_string_[abi:cxx11]

I suspect this is a C++ ABI issue. The ABI for std::string has changed in GCC 5 (related to C++11 requirements, but it applies even if you aren't using C++11). See:

https://gcc.gnu.org/gcc-5/changes.html#libstdcxx

If libprotobuf was built with GCC 4.x or prior, but your app is built with GCC 5, then you will see problems, because libprotobuf uses std::string in its interface. You have two options:

  1. Rebuild libprotobuf with GCC 5 (but now any apps built with GCC 4 won't work with the new version of libprotobuf).
  2. Build you app with -D_GLIBCXX_USE_CXX11_ABI=0 as described at the above link. This will force GCC to use the old ABI version.

Can't build test C++ app with Google's protobuf

Problem was in the linker search path. Linker tried to use libprotobuf from OS distributon (version 8.0.0) instead of lib built by me (version 9.0.1).

can't build gem5 because of undefined reference warnings

Before building gem5, ensure you're using compatible dependencies, as listed in the official documentation: https://www.gem5.org/documentation/general_docs/building

Your gcc version is unsupported (too old). Your protobuf version is supported.

Try upgrading your gcc version to at least GCC 7. This is not directly available from Ubuntu 16.04, but you will find different alternative ways of installing it in the web, including building it from source. Otherwise, use a more recent Ubuntu version.

undefined reference to 'ClassName::memberField[abi:cxx11]'

In Code-Listing-2 Node.cpp:

#include "Node.hpp"

list<Node *> nodes;

Node::Node() {
// ...

Should be:

#include "Node.hpp"

list<Node *> Node::nodes;

Node::Node() {
// ...

Without Node::, you are declaring a global variable nodes unrelated to the static member Node::nodes, thus the undefined reference since a static member variable needs a proper definition.

Cannot resolve symbol in libprotobuf in openwrt

This looks like it's probably caused by using a different compiler / C++ ABI to compile your application vs. libprotobuf.so. See this previous question for more:

Undefined reference to google::protobuf::internal::empty_string_[abi:cxx11]



Related Topics



Leave a reply



Submit