Ultimaker / CuraEngine

Powerful, fast and robust engine for converting 3D models into g-code instructions for 3D printers. It is part of the larger open source project Cura.
https://ultimaker.com/en/products/cura-software
GNU Affero General Public License v3.0
1.69k stars 886 forks source link

How can I use the indicated protobuf lib? #1018

Open thzhao opened 5 years ago

thzhao commented 5 years ago

I installed the protobuf in my home directory. There are two protobufs with different compiler in my system. It seems the link error. How can I indicate the protobuf I want?

[100%] Building CXX object CMakeFiles/CuraEngine.dir/src/main.cpp.o Linking CXX executable CuraEngine lib_CuraEngine.a(commandSocket.cpp.o): In function google::protobuf::internal::GetEmptyStringAlreadyInited[abi:cxx11]()': /usr/local/include/google/protobuf/message_lite.h:134: undefined reference togoogle::protobuf::internal::fixed_address_empty_string[abi:cxx11]' lib_CuraEngine.a(commandSocket.cpp.o): In function cura::Listener::error(Arcus::Error const&)': commandSocket.cpp:(.text._ZN4cura8Listener5errorERKN5Arcus5ErrorE[_ZN4cura8Listener5errorERKN5Arcus5ErrorE]+0x36): undefined reference toArcus::Error::toString[abi:cxx11]() const' commandSocket.cpp:(.text._ZN4cura8Listener5errorERKN5Arcus5ErrorE[_ZN4cura8Listener5errorERKN5Arcus5ErrorE]+0x75): undefined reference to `Arcus::Error::toString[abi:cxx11]() const'

rburema commented 5 years ago

@thzhao Did you do the configuration with CMake? You should be able to specify where protobuf is build in the CMake parameters.

LipuFei commented 5 years ago

@thzhao You can use certain cmake arguments such as CMAKE_PREFIX_PATH to make CMake look for where your libraries are installed first. See documentation: https://cmake.org/cmake/help/v3.12/variable/CMAKE_PREFIX_PATH.html

You can have a look at the links for find_package(), find_library(), etc. They explain how those functions behave, where do they look for things first.