chenshuo / muduo-protorpc

Google Protobuf RPC based on Muduo
Other
196 stars 106 forks source link

So many annoying undefined reference to protobuf interfaces, is there lacking definitions for them??? #5

Open richen666 opened 1 year ago

richen666 commented 1 year ago

What version of protobuf and what language are you using? Version: v3.12.4 Language: C++ "Please try updating to the latest version of protoc/runtime possible beforehand to attempt to resolve your problem?" I think it may not useful for me.

What operating system (Linux, Windows, ...) and version? Linux 5.19.0-35-generic, Ubuntu

What runtime / compiler are you using (e.g., python version or gcc version) gcc (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0 Python 3.10.6

What did you do? Steps to reproduce the behavior: 1.sudo apt-get install libprotoc-dev protobuf-compiler libprotobuf-dev image So I use the default version of the system, and protoc is also 3.12.4 (so there is no conflict between protoc and protobuf). image image

  1. But when I compile my project, cmake give me annoying errors as follows: **there are so many undefined references, I can't understand them. Please hele me!!! I think that their definitions have been in system files in /usr/lib, but why these errors?**

[cyf@vm ~/cpp-projects/muduo-protorpc]$ ./build.sh

What did you expect to see Hope to compile completely and produce library for my own use.

What did you see instead? I try all solutions mentioned from Internet, whether stackoverflow or google. For example: Add -D_GLIBCXX_USE_CXX11_ABI=0, or -lprotoc -lprotobuf -lpthread image image

or force to link static library libprotobuf.a. image

and other unuseful solutions.

Make sure you include information that can help us debug (full error message, exception listing, stack trace, logs).

Anything else we should know about your project / environment