YuvalNirkin / face_swap

End-to-end, automatic face swapping pipeline
GNU General Public License v3.0
825 stars 203 forks source link

conflict with Caffe(complied by gcc4.X), it confused me for a week ! #22

Closed lyycfairy closed 6 years ago

lyycfairy commented 6 years ago

I had tried many ways to compile this project in Ubuntu14.04,but all failed at the last. I have no idea about how to compile it.

face_swap needs gcc5.0+ for supporting C++11/14 but my Caffe was compiled by gcc4.X,protobuf2.5 was installed from apt-get face_swap make failed when linking, about protobuf

Linking CXX executable face_swap_batch _sequence_face_landmarks.pb.cc:(.text+0x48e): undefined reference to `google::protobuf::MessageFactory::InternalRegisterGeneratedFile(char const, void ()(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&))'

sequence_face_landmarks.pb.cc:(.text+0xdab): undefined reference to `google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(int, std::__cxx11::basic_string<char, std::chartraits, std::allocator > const&, google::protobuf::io::CodedOutputStream*)'

then, I tried to compile Caffe and Protobuf-2.5 with gcc5.5 from source but Caffe was failed the same in linking

Linking CXX executable compute_image_mean _compute_image_mean.cpp:(.text.startup+0x1bf): undefined reference to google::SetUsageMessage(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)' CMakeFiles/compute_image_mean.dir/compute_image_mean.cpp.o: In functionstd::cxx11::basic_string<char, std::char_traits, std::allocator > google::MakeCheckOpString<int, int>(int const&, int const&, char const)': compute_image_mean.cpp:(.text._ZN6google17MakeCheckOpStringIiiEEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKT_RKT0_PKc[_ZN6google17MakeCheckOpStringIiiEEPNSt7cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKT_RKT0_PKc]+0x43): undefined reference to google::base::CheckOpMessageBuilder::NewString[abi:cxx11]()' CMakeFiles/compute_image_mean.dir/compute_image_mean.cpp.o: In functionstd::__cxx11::basic_string<char, std::chartraits, std::allocator > google::MakeCheckOpString<unsigned long, int>(unsigned long const&, int const&, char const)':

I was very confused about how to choose the gcc version to avoid the conflict?

YuvalNirkin commented 6 years ago

Building this project and all it's dependencies is not easy I know. First of all the minimum version of Protobuf as required by sequence_face_landmarks is 3.0.0. I suggest you build all dependencies from source using CMake, make sure that you checkout stable releases and not the master branch (except for the face_swap project in which the master branch is preferable).

You can use the ldd command to understand where the linkage problems are coming from.

Good luck!