Ultimaker / libArcus

Communication library between internal components for Ultimaker software

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

protobuf problem when using cmake gui

yingzhang1109 opened this issue · comments

I am trying to use cmake gui to generate the cmake files. here is my error. could anyone help me on that? thanks in advance
image

Don't build the tests.

@nallath thank you for your response! and how can I do it?

One of the options in the CMake config is something along the lines of BUILD_TESTING or protobuf_BUILD_TESTS or so. Disable that one to disable building the tests.

@awhiemstra thank you for your response. I have another question. I sussesfully installed the protobuf with no error, but I met the problem in installing the LibArcus. It's said Could NOT find Protobuf.
image
do you have any idea about this?

I can also find the protobuf fold in my C disk
image
do you think I need to add it to my system path?

You can use cmake-gui to point Arcus' build system at the right location for protobuf. It should have the two mentioned variables (Protobuf_LIBRARIES and Protobuf_INCLUDE_DIR) that you can set.

@awhiemstra thanks for your reply, and I have another problem that, when I run mingw32-make
that's what I have
image
I manually add the file to the folder, then I have this

[ 5%] Linking CXX shared library libArcus.dll
CMakeFiles\Arcus.dir/objects.a(Socket.cpp.obj):Socket.cpp:(.text+0x10e4): undefined reference to google::protobuf::MessageLite::SerializeAsString[abi:cxx11]() const' CMakeFiles\Arcus.dir/objects.a(Socket.cpp.obj):Socket.cpp:(.text+0x1bd5): undefined reference to google::protobuf::io::ArrayInputStream::ArrayInputStream(void const*, int, int)'
CMakeFiles\Arcus.dir/objects.a(Socket.cpp.obj):Socket.cpp:(.text+0x1c0a): undefined reference to google::protobuf::io::CodedInputStream::SetTotalBytesLimit(int, int)' CMakeFiles\Arcus.dir/objects.a(Socket.cpp.obj):Socket.cpp:(.text+0x1c29): undefined reference to google::protobuf::MessageLite::ParseFromCodedStream(google::protobuf::io::CodedInputStream*)'
CMakeFiles\Arcus.dir/objects.a(Socket.cpp.obj):Socket.cpp:(.text+0x1d8f): undefined reference to google::protobuf::io::CodedInputStream::~CodedInputStream()' CMakeFiles\Arcus.dir/objects.a(Socket.cpp.obj):Socket.cpp:(.text+0x1dab): undefined reference to google::protobuf::io::ArrayInputStream::~ArrayInputStream()'
CMakeFiles\Arcus.dir/objects.a(Socket.cpp.obj):Socket.cpp:(.text+0x1e2c): undefined reference to google::protobuf::io::CodedInputStream::~CodedInputStream()' CMakeFiles\Arcus.dir/objects.a(Socket.cpp.obj):Socket.cpp:(.text+0x1e3a): undefined reference to google::protobuf::io::ArrayInputStream::~ArrayInputStream()'
CMakeFiles\Arcus.dir/objects.a(Socket.cpp.obj):Socket.cpp:(.text$_ZN6google8protobuf8internal9ToIntSizeEj[__ZN6google8protobuf8internal9ToIntSizeEj]+0x35): undefined reference to google::protobuf::internal::LogMessage::LogMessage(google::protobuf::LogLevel, char const*, int)' CMakeFiles\Arcus.dir/objects.a(Socket.cpp.obj):Socket.cpp:(.text$_ZN6google8protobuf8internal9ToIntSizeEj[__ZN6google8protobuf8internal9ToIntSizeEj]+0x4e): undefined reference to google::protobuf::internal::LogMessage::operator<<(char const*)'
CMakeFiles\Arcus.dir/objects.a(Socket.cpp.obj):Socket.cpp:(.text$_ZN6google8protobuf8internal9ToIntSizeEj[__ZN6google8protobuf8internal9ToIntSizeEj]+0x64): undefined reference to google::protobuf::internal::LogFinisher::operator=(google::protobuf::internal::LogMessage&)' CMakeFiles\Arcus.dir/objects.a(Socket.cpp.obj):Socket.cpp:(.text$_ZN6google8protobuf8internal9ToIntSizeEj[__ZN6google8protobuf8internal9ToIntSizeEj]+0x7a): undefined reference to google::protobuf::internal::LogMessage::~LogMessage()'
CMakeFiles\Arcus.dir/objects.a(Socket.cpp.obj):Socket.cpp:(.text$_ZN6google8protobuf8internal9ToIntSizeEj[_ZN6google8protobuf8internal9ToIntSizeEj]+0x97): undefined reference to google::protobuf::internal::LogMessage::~LogMessage()' CMakeFiles\Arcus.dir/objects.a(Socket.cpp.obj):Socket.cpp:(.text$_ZN6google8protobuf2io16CodedInputStreamC1EPNS1_19ZeroCopyInputStreamE[__ZN6google8protobuf2io16CodedInputStreamC1EPNS1_19ZeroCopyInputStreamE]+0x71): undefined reference to google::protobuf::io::CodedInputStream::default_recursion_limit'
CMakeFiles\Arcus.dir/objects.a(Socket.cpp.obj):Socket.cpp:(.text$_ZN6google8protobuf2io16CodedInputStreamC1EPNS1_19ZeroCopyInputStreamE[__ZN6google8protobuf2io16CodedInputStreamC1EPNS1_19ZeroCopyInputStreamE]+0x7d): undefined reference to google::protobuf::io::CodedInputStream::default_recursion_limit_' CMakeFiles\Arcus.dir/objects.a(Socket.cpp.obj):Socket.cpp:(.text$_ZN6google8protobuf2io16CodedInputStreamC1EPNS1_19ZeroCopyInputStreamE[__ZN6google8protobuf2io16CodedInputStreamC1EPNS1_19ZeroCopyInputStreamE]+0xa8): undefined reference to google::protobuf::io::CodedInputStream::Refresh()'
CMakeFiles\Arcus.dir/objects.a(MessageTypeStore.cpp.obj):MessageTypeStore.cpp:(.text+0x5cb): undefined reference to google::protobuf::compiler::DiskSourceTree::MapPath(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)' CMakeFiles\Arcus.dir/objects.a(MessageTypeStore.cpp.obj):MessageTypeStore.cpp:(.text+0x64f): undefined reference to google::protobuf::compiler::DiskSourceTree::MapPath(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&)'
CMakeFiles\Arcus.dir/objects.a(MessageTypeStore.cpp.obj):MessageTypeStore.cpp:(.text+0x73c): undefined reference to google::protobuf::compiler::Importer::Import(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)' CMakeFiles\Arcus.dir/objects.a(MessageTypeStore.cpp.obj):MessageTypeStore.cpp:(.text$_ZN6google8protobuf8compiler23MultiFileErrorCollectorC2Ev[__ZN6google8protobuf8compiler23MultiFileErrorCollectorC2Ev]+0xa): undefined reference to vtable for google::protobuf::compiler::MultiFileErrorCollector'
CMakeFiles\Arcus.dir/objects.a(MessageTypeStore.cpp.obj):MessageTypeStore.cpp:(.text$_ZN14ErrorCollectorC1Ev[__ZN14ErrorCollectorC1Ev]+0x5e): undefined reference to google::protobuf::compiler::MultiFileErrorCollector::~MultiFileErrorCollector()' CMakeFiles\Arcus.dir/objects.a(MessageTypeStore.cpp.obj):MessageTypeStore.cpp:(.text$_ZN9__gnu_cxx13new_allocatorIN6google8protobuf8compiler14DiskSourceTreeEE9constructIS4_JEEEvPT_DpOT0_[__ZN9__gnu_cxx13new_allocatorIN6google8protobuf8compiler14DiskSourceTreeEE9constructIS4_JEEEvPT_DpOT0_]+0x28): undefined reference to google::protobuf::compiler::DiskSourceTree::DiskSourceTree()'
CMakeFiles\Arcus.dir/objects.a(MessageTypeStore.cpp.obj):MessageTypeStore.cpp:(.text$ZN9__gnu_cxx13new_allocatorIN6google8protobuf8compiler8ImporterEE9constructIS4_JPNS3_14DiskSourceTreeEP14ErrorCollectorEEEvPT_DpOT0[_ZN9__gnu_cxx13new_allocatorIN6google8protobuf8compiler8ImporterEE9constructIS4_JPNS3_14DiskSourceTreeEP14ErrorCollectorEEEvPT_DpOT0]+0x4f): undefined reference to google::protobuf::compiler::Importer::Importer(google::protobuf::compiler::SourceTree*, google::protobuf::compiler::MultiFileErrorCollector*)' CMakeFiles\Arcus.dir/objects.a(MessageTypeStore.cpp.obj):MessageTypeStore.cpp:(.text$_ZN9__gnu_cxx13new_allocatorIN6google8protobuf21DynamicMessageFactoryEE9constructIS3_JEEEvPT_DpOT0_[__ZN9__gnu_cxx13new_allocatorIN6google8protobuf21DynamicMessageFactoryEE9constructIS3_JEEEvPT_DpOT0_]+0x28): undefined reference to google::protobuf::DynamicMessageFactory::DynamicMessageFactory()'
CMakeFiles\Arcus.dir/objects.a(MessageTypeStore.cpp.obj):MessageTypeStore.cpp:(.text$_ZN14ErrorCollectorD1Ev[__ZN14ErrorCollectorD1Ev]+0x26): undefined reference to google::protobuf::compiler::MultiFileErrorCollector::~MultiFileErrorCollector()' CMakeFiles\Arcus.dir/objects.a(MessageTypeStore.cpp.obj):MessageTypeStore.cpp:(.text$_ZN9__gnu_cxx13new_allocatorIN6google8protobuf8compiler8ImporterEE7destroyIS4_EEvPT_[__ZN9__gnu_cxx13new_allocatorIN6google8protobuf8compiler8ImporterEE7destroyIS4_EEvPT_]+0xd): undefined reference to google::protobuf::compiler::Importer::~Importer()'
collect2.exe: error: ld returned 1 exit status
CMakeFiles\Arcus.dir\build.make:204: recipe for target 'libArcus.dll' failed
mingw32-make[2]: *** [libArcus.dll] Error 1
CMakeFiles\Makefile2:66: recipe for target 'CMakeFiles/Arcus.dir/all' failed
mingw32-make[1]: *** [CMakeFiles/Arcus.dir/all] Error 2
Makefile:150: recipe for target 'all' failed
mingw32-make: *** [all] Error 2
PS D:\Engine\libArcus-2.7\build>

Here is the cmake-gui page I have
image

I figured it out

What was your solution? It looks like something with mixing up different compilers.

@Ghostkeeper yes, it's because of the compulers