Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to build protobuf without pthread?

There is a need to use Protocol Buffers on the real-time OS where there is no pthread. I am able to link protobuf statically this way

g++ -g -Wall example.pb.cc example.cc -o example -static -lprotobuf -lpthread

However without pthread I get link errors. Is it possible to configure protobuf to work without pthread?

like image 489
Иван Avatar asked Jan 15 '13 12:01

Иван


People also ask

What encoding does protobuf use?

Protobuf strings are always valid UTF-8 strings. See the Language Guide: A string must always contain UTF-8 encoded or 7-bit ASCII text.

Does protobuf use HTTP?

Protobufs work fine over HTTP in their native binary format.

Is protobuf a programming language?

"Protobuf (Protocol buffers) are Google's language-neutral, platform-neutral, extensible mechanism for serializing structured data – think XML, but smaller, faster, and simpler.


1 Answers

Not really. See this unresolved issue.

Someone has patched an older protobuf version to not depend on pthreads, see here - which you might take a look at if you really need it, and possibly forward port.

Also note that you're supposed to use pkg_config to get the proper compiler and linker flags when using protobuf, e.g.

pkg-config --cflags protobuf         # compiler flags
pkg-config --libs protobuf           # linker flags
like image 194
nos Avatar answered Nov 11 '22 07:11

nos