TousakaRin commented on issue #1392:
URL: https://github.com/apache/brpc/issues/1392#issuecomment-1977903132

   @1797818494 一般这种undefined reference的问题,首先利用 gcc -print-search-dirs 或者 ld 
--verbose | grep SEARCH_DIR 找到系统里寻找 so 的路径,还有上面编译命令里指定的 -L 后面的路径,从这里路径里找到 
libprotobuf.so 这个文件,然后利用 objdump/nm 
命令确认它们是否包含了上面提到的符号(google::protobuf::internal::AssignDescriptors)。如果没有,那么大概率是protobuf版本不对,如果有多个libprotobuf.so,那么就是装了多个版本的protobuf,并且链接错了,这个时候可以卸载掉错误版本,或者使用LD_LIBRARY_PATH等手段提升正确版本的优先级。测试protofbuf.so是否正确的时候,可以把编译命令复制下来,使用/absolutely/path/of/protobuf.so
 替换 -lprotobuf。


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org
For additional commands, e-mail: dev-h...@brpc.apache.org

Reply via email to