Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make命令无法正常运行|版本问题 #8

Closed
volaking opened this issue Jan 3, 2024 · 4 comments
Closed

make命令无法正常运行|版本问题 #8

volaking opened this issue Jan 3, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@volaking
Copy link

volaking commented Jan 3, 2024

您好,我在执行make命令时会产生大量报错,在其他的代码上没有出现过这种现象。上网搜索了下原因,可能是与protobuf库相关,也许是版本与代码不兼容等问题,我尝试着重新安装了protobuf,但make命令仍然报错,请问应该怎么解决这个问题,能否给我一些建议呢。

ubantu版本:Ubuntu 20.04.6 LTS
cmake版本:3.28.1

下面是部分报错内容:
[ 3%] Building CXX object CMakeFiles/skip_list_on_raft.dir/src/rpc/mprpcchannel.cpp.o
In file included from /usr/include/google/protobuf/map_entry_lite.h:36,
from /usr/include/google/protobuf/generated_message_table_driven.h:35,
from /home/zhaozhuo/code/git/KVstorageBaseRaft-cpp/src/rpc/include/rpcheader.pb.h:26,
from /home/zhaozhuo/code/git/KVstorageBaseRaft-cpp/src/rpc/mprpcchannel.cpp:3:
/usr/include/google/protobuf/stubs/casts.h: In function ‘To google::protobuf::internal::bit_cast(const From&)’:
/usr/include/google/protobuf/stubs/casts.h:118:25: error: ‘bit_cast_with_different_sizes’ was not declared in this scope
118 | bit_cast_with_different_sizes);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/google/protobuf/stubs/casts.h:117:3: error: there are no arguments to ‘GOOGLE_COMPILE_ASSERT’ that depend on a template parameter, so a declaration of ‘GOOGLE_COMPILE_ASSERT’ must be available [-fpermissive]
117 | GOOGLE_COMPILE_ASSERT(sizeof(From) == sizeof(To),
| ^~~~~~~~~~~~~~~~~~~~~

image

@578223592
Copy link
Collaborator

你的protobuf的版本是多少?我认为这个比较重要
我这里给出我的版本信息:
protobuf

protoc --version                      
libprotoc 3.12.4

ubuntu

lsb_release -a

No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 22.04.3 LTS
Release:	22.04
Codename:	jammy

cmake

cmake --version    
cmake version 3.22.1

CMake suite maintained and supported by Kitware (kitware.com/cmake).

@volaking
Copy link
Author

volaking commented Jan 4, 2024

感谢您的建议,我按照您的版本重新安装了ubuntu和其他的库,现在可以成功运行了。
image

@578223592
Copy link
Collaborator

感谢您的建议,我按照您的版本重新安装了ubuntu和其他的库,现在可以成功运行了。 image

nice!!!
如果有时间欢迎分享一下你的环境安装过程,非常感谢。
我将关闭这个issue,如果有任何问题,欢迎再次打开提问。

@578223592 578223592 added the bug Something isn't working label Jan 8, 2024
@578223592 578223592 mentioned this issue Jan 12, 2024
@578223592 578223592 changed the title make命令无法正常运行 make命令无法正常运行|版本问题 Feb 5, 2024
@jueshixian
Copy link

补充:用源码编译和用命令行安装,anaconda中的protobuf冲突解决方案:https://blog.csdn.net/lilai619/article/details/105997911

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants