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

undefined reference to google::protobuf #96

Open
Miller-Xie opened this issue Apr 2, 2019 · 3 comments · Fixed by #134
Open

undefined reference to google::protobuf #96

Miller-Xie opened this issue Apr 2, 2019 · 3 comments · Fixed by #134

Comments

@Miller-Xie
Copy link

Hello, I am building Cura's build environment, but when I compile libArcus on Windows 7 virtual machine, I met the program link error. In the following section is the specific error message. On this basis, I have installed protobuf and also add it to environment variable.

C:\Cura262LiXianBianYiBao\Build260\libArcus-2.6\libArcus\build>mingw32-make
Scanning dependencies of target Arcus
[ 16%] Building CXX object CMakeFiles/Arcus.dir/src/Socket.cpp.obj
[ 33%] Linking CXX shared library libArcus.dll
CMakeFiles\Arcus.dir/objects.a(Socket.cpp.obj):Socket.cpp:(.text+0x2a3): undefin
ed reference to `google::protobuf::MessageLite::SerializeAsString[abi:cxx11]() c
onst'
CMakeFiles\Arcus.dir/objects.a(Socket.cpp.obj):Socket.cpp:(.text+0x2a25): undefi
ned reference to `google::protobuf::io::ArrayInputStream::ArrayInputStream(void
const*, int, int)'
CMakeFiles\Arcus.dir/objects.a(Socket.cpp.obj):Socket.cpp:(.text+0x2a9f): undefi
ned reference to `google::protobuf::io::CodedInputStream::Refresh()'
CMakeFiles\Arcus.dir/objects.a(Socket.cpp.obj):Socket.cpp:(.text+0x2ab2): undefi
ned reference to `google::protobuf::io::CodedInputStream::SetTotalBytesLimit(int
, int)'
CMakeFiles\Arcus.dir/objects.a(Socket.cpp.obj):Socket.cpp:(.text+0x2abf): undefi
ned reference to `google::protobuf::MessageLite::ParseFromCodedStream(google::pr
otobuf::io::CodedInputStream*)'
CMakeFiles\Arcus.dir/objects.a(Socket.cpp.obj):Socket.cpp:(.text+0x2b5a): undefi
ned reference to `google::protobuf::io::CodedInputStream::~CodedInputStream()'
CMakeFiles\Arcus.dir/objects.a(Socket.cpp.obj):Socket.cpp:(.text+0x2b62): undefi
ned reference to `google::protobuf::io::ArrayInputStream::~ArrayInputStream()'
CMakeFiles\Arcus.dir/objects.a(Socket.cpp.obj):Socket.cpp:(.text+0x2e04): undefi
ned reference to `google::protobuf::io::CodedInputStream::~CodedInputStream()'

This problem has been bothering me for a few days. If there is time, please give me some solutions.

Thank you!!!

@Ghostkeeper
Copy link
Contributor

Did you compile libArcus using the same compiler as Protobuf was compiled with?

@Miller-Xie
Copy link
Author

Did you compile libArcus using the same compiler as Protobuf was compiled with?

Yes, I used the same compiler mingw-64 to compile protobuf and libArcus.

@Ghostkeeper
Copy link
Contributor

Hmm, then maybe it's an issue with the version of Protobuf you're using? I really have no idea what could cause this (or how to fix it). Sometimes a clean-and-rebuild also works.

@jellespijker jellespijker linked a pull request Apr 12, 2022 that will close this issue
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants