I have a book, Modern C++ programming with Test-Driven Development and i want to build the examples from the book, im using google mock 1.6.0 and google test 1.6.0 and i get the following error when i try to build
please help!!
[ 14%] Linking CXX executable test
CMakeFiles/test.dir/CharUtilTest.cpp.o: In function `AChar_IsAVowelForSixSpecificLetters_Test::TestBody()':
CharUtilTest.cpp:(.text+0x78): undefined reference to `testing::internal::GetBoolAssertionFailureMessage(testing::AssertionResult const&, char const*, char const*, char const*)'
CharUtilTest.cpp:(.text+0x160): undefined reference to `testing::internal::GetBoolAssertionFailureMessage(testing::AssertionResult const&, char const*, char const*, char const*)'
CharUtilTest.cpp:(.text+0x248): undefined reference to `testing::internal::GetBoolAssertionFailureMessage(testing::AssertionResult const&, char const*, char const*, char const*)'
CharUtilTest.cpp:(.text+0x330): undefined reference to `testing::internal::GetBoolAssertionFailureMessage(testing::AssertionResult const&, char const*, char const*, char const*)'
CharUtilTest.cpp:(.text+0x418): undefined reference to `testing::internal::GetBoolAssertionFailureMessage(testing::AssertionResult const&, char const*, char const*, char const*)'
CMakeFiles/test.dir/CharUtilTest.cpp.o:CharUtilTest.cpp:(.text+0x500): more undefined references to `testing::internal::GetBoolAssertionFailureMessage(testing::AssertionResult const&, char const*, char const*, char const*)' follow
CMakeFiles/test.dir/CharUtilTest.cpp.o: In function `__static_initialization_and_destruction_0(int, int)':
CharUtilTest.cpp:(.text+0x18fc): undefined reference to `testing::internal::MakeAndRegisterTestInfo(char const*, char const*, char const*, char const*, void const*, void (*)(), void (*)(), testing::internal::TestFactoryBase*)'
CharUtilTest.cpp:(.text+0x1954): undefined reference to `testing::internal::MakeAndRegisterTestInfo(char const*, char const*, char const*, char const*, void const*, void (*)(), void (*)(), testing::internal::TestFactoryBase*)'
CharUtilTest.cpp:(.text+0x19ac): undefined reference to `testing::internal::MakeAndRegisterTestInfo(char const*, char const*, char const*, char const*, void const*, void (*)(), void (*)(), testing::internal::TestFactoryBase*)'
CharUtilTest.cpp:(.text+0x1a04): undefined reference to `testing::internal::MakeAndRegisterTestInfo(char const*, char const*, char const*, char const*, void const*, void (*)(), void (*)(), testing::internal::TestFactoryBase*)'
CharUtilTest.cpp:(.text+0x1a5c): undefined reference to `testing::internal::MakeAndRegisterTestInfo(char const*, char const*, char const*, char const*, void const*, void (*)(), void (*)(), testing::internal::TestFactoryBase*)'
CMakeFiles/test.dir/CharUtilTest.cpp.o:CharUtilTest.cpp:(.text+0x1ab4): more undefined references to `testing::internal::MakeAndRegisterTestInfo(char const*, char const*, char const*, char const*, void const*, void (*)(), void (*)(), testing::internal::TestFactoryBase*)' follow
/home/matthew/googlemock-release-1.6.0/mybuild/libgmock.a(gmock-all.cc.o): In function `testing::internal::Log(testing::internal::LogSeverity, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)':
gmock-all.cc:(.text+0xdc1): undefined reference to `testing::internal::GetCurrentOsStackTraceExceptTop(testing::UnitTest*, int)'
/home/matthew/googlemock-release-1.6.0/mybuild/libgmock.a(gmock-all.cc.o): In function `testing::internal::ParseGoogleMockFlagValue(char const*, char const*, bool)':
gmock-all.cc:(.text+0x44f2): undefined reference to `testing::internal::String::Format(char const*, ...)'
/home/matthew/googlemock-release-1.6.0/mybuild/libgmock.a(gmock-all.cc.o): In function `testing::internal::String::operator==(char const*) const':
gmock-all.cc:(.text._ZNK7testing8internal6StringeqEPKc[_ZNK7testing8internal6StringeqEPKc]+0x42): undefined reference to `testing::internal::String::Compare(testing::internal::String const&) const'
/home/matthew/googlemock-release-1.6.0/mybuild/libgmock.a(gmock-all.cc.o): In function `testing::Message::operator<<(wchar_t*)':
gmock-all.cc:(.text._ZN7testing7MessagelsEPw[_ZN7testing7MessagelsEPw]+0x2f): undefined reference to `testing::internal::String::ShowWideCString(wchar_t const*)'
collect2: error: ld returned 1 exit status
CMakeFiles/test.dir/build.make:158: recipe for target 'test' failed
make[2]: *** [test] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/test.dir/all' failed
make[1]: *** [CMakeFiles/test.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
.
matthew#Matthew:~/code/c2/40/build$ make VERBOSE=1
/usr/local/bin/cmake -H/home/matthew/code/c2/40 -B/home/matthew/code/c2/40/build --check-build-system CMakeFiles/Makefile.cmake 0
/usr/local/bin/cmake -E cmake_progress_start /home/matthew/code/c2/40/build/CMakeFiles /home/matthew/code/c2/40/build/CMakeFiles/progress.marks
make -f CMakeFiles/Makefile2 all
make[1]: Entering directory '/home/matthew/code/c2/40/build'
make -f CMakeFiles/test.dir/build.make CMakeFiles/test.dir/depend
make[2]: Entering directory '/home/matthew/code/c2/40/build'
cd /home/matthew/code/c2/40/build && /usr/local/bin/cmake -E cmake_depends "Unix Makefiles" /home/matthew/code/c2/40 /home/matthew/code/c2/40 /home/matthew/code/c2/40/build /home/matthew/code/c2/40/build /home/matthew/code/c2/40/build/CMakeFiles/test.dir/DependInfo.cmake --color=
make[2]: Leaving directory '/home/matthew/code/c2/40/build'
make -f CMakeFiles/test.dir/build.make CMakeFiles/test.dir/build
make[2]: Entering directory '/home/matthew/code/c2/40/build'
[ 14%] Linking CXX executable test
/usr/local/bin/cmake -E cmake_link_script CMakeFiles/test.dir/link.txt --verbose=1
/usr/bin/c++ -Wall -rdynamic CMakeFiles/test.dir/CharUtilTest.cpp.o CMakeFiles/test.dir/SoundexTest.cpp.o CMakeFiles/test.dir/StringUtilTest.cpp.o CMakeFiles/test.dir/main.cpp.o CMakeFiles/test.dir/CharUtil.cpp.o CMakeFiles/test.dir/StringUtil.cpp.o -o test -L/home/matthew/googletest-release-1.8.0/googlemock/build -L/home/matthew/googletest-release-1.8.0/googlemock/gtest/mybuild -Wl,-rpath,/home/matthew/googletest-release-1.8.0/googlemock/build:/home/matthew/googletest-release-1.8.0/googlemock/gtest/mybuild -lpthread -lgmock -lgtest
/usr/bin/ld: cannot find -lgmock
collect2: error: ld returned 1 exit status
CMakeFiles/test.dir/build.make:158: recipe for target 'test' failed
make[2]: *** [test] Error 1
make[2]: Leaving directory '/home/matthew/code/c2/40/build'
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/test.dir/all' failed
make[1]: *** [CMakeFiles/test.dir/all] Error 2
make[1]: Leaving directory '/home/matthew/code/c2/40/build'
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
Related
I am new to linux and c++. I am trying to run veins gym on Ubuntu-18.04. When I run snakemake -jall (see the link) I receive an error:
make: Entering directory '/home/rost/serpentine-env/src'
Creating executable: out/gcc-debug//experiment_dbg
/usr/bin/ld: cannot find -lprotobuf
collect2: error: ld returned 1 exit status
Makefile:96: recipe for target 'out/gcc-debug//experiment_dbg' failed
make: *** [out/gcc-debug//experiment_dbg] Error 1
make: Leaving directory '/home/rost/serpentine-env/src'
[Thu Dec 30 12:34:46 2021]
Error in rule build:
jobid: 1
output: src/experiment_dbg
shell:
make -j8 -C src MODE=debug
(one of the commands exited with non-zero exit code; note that snakemake uses bash strict mode!)
Shutting down, this might take some time.
Exiting because a job execution failed. Look above for error message
Complete log: /home/rost/serpentine-env/.snakemake/log/2021-12-30T123446.742985.snakemake.log
To obtain a little more information, I run (source)
ld -lprotobuf --verbose
and I get
attempt to open //usr/local/lib/x86_64-linux-gnu/libprotobuf.so failed
attempt to open //usr/local/lib/x86_64-linux-gnu/libprotobuf.a failed
attempt to open //lib/x86_64-linux-gnu/libprotobuf.so failed
attempt to open //lib/x86_64-linux-gnu/libprotobuf.a failed
attempt to open //usr/lib/x86_64-linux-gnu/libprotobuf.so failed
attempt to open //usr/lib/x86_64-linux-gnu/libprotobuf.a failed
attempt to open //usr/lib/x86_64-linux-gnu64/libprotobuf.so failed
attempt to open //usr/lib/x86_64-linux-gnu64/libprotobuf.a failed
attempt to open //usr/local/lib64/libprotobuf.so failed
attempt to open //usr/local/lib64/libprotobuf.a failed
attempt to open //lib64/libprotobuf.so failed
attempt to open //lib64/libprotobuf.a failed
attempt to open //usr/lib64/libprotobuf.so failed
attempt to open //usr/lib64/libprotobuf.a failed
attempt to open //usr/local/lib/libprotobuf.so failed
attempt to open //usr/local/lib/libprotobuf.a failed
attempt to open //lib/libprotobuf.so failed
attempt to open //lib/libprotobuf.a failed
attempt to open //usr/lib/libprotobuf.so failed
attempt to open //usr/lib/libprotobuf.a failed
attempt to open //usr/x86_64-linux-gnu/lib64/libprotobuf.so failed
attempt to open //usr/x86_64-linux-gnu/lib64/libprotobuf.a failed
attempt to open //usr/x86_64-linux-gnu/lib/libprotobuf.so failed
attempt to open //usr/x86_64-linux-gnu/lib/libprotobuf.a failed
ld: cannot find -lprotobuf
I guess, I would have to make symlink manually, but I do not find any .so files in the archives from protobuf. Or maybe my interpretation is wrong. If some information is missing - I will provide.
Thank you!
UPDATE:
after runningsudo apt install libprotobuf-dev, command snakemake -jall produces
make: Entering directory '/home/rost/serpentine-env/src'
Creating executable: out/gcc-debug//experiment_dbg
out/gcc-debug//protobuf/veinsgym.pb.o: In function `veinsgym::proto::Request::_InternalParse(char const*, google::protobuf::internal::ParseContext*)':
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.cc:563: undefined reference to `google::protobuf::internal::ParseContext::ParseMessage(google::protobuf::MessageLite*, char const*)'
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.cc:571: undefined reference to `google::protobuf::internal::ParseContext::ParseMessage(google::protobuf::MessageLite*, char const*)'
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.cc:579: undefined reference to `google::protobuf::internal::ParseContext::ParseMessage(google::protobuf::MessageLite*, char const*)'
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.cc:593: undefined reference to `google::protobuf::internal::UnknownFieldParse(unsigned long, google::protobuf::UnknownFieldSet*, char const*, google::protobuf::internal::ParseContext*)'
out/gcc-debug//protobuf/veinsgym.pb.o: In function `veinsgym::proto::Request::_InternalSerialize(unsigned char*, google::protobuf::io::EpsCopyOutputStream*) const':
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.cc:644: undefined reference to `google::protobuf::internal::WireFormat::InternalSerializeUnknownFieldsToArray(google::protobuf::UnknownFieldSet const&, unsigned char*, google::protobuf::io::EpsCopyOutputStream*)'
out/gcc-debug//protobuf/veinsgym.pb.o: In function `veinsgym::proto::Request::ByteSizeLong() const':
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.cc:690: undefined reference to `google::protobuf::Message::MaybeComputeUnknownFieldsSize(unsigned long, google::protobuf::internal::CachedSize*) const'
out/gcc-debug//protobuf/veinsgym.pb.o: In function `veinsgym::proto::Request::GetMetadata() const':
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.cc:757: undefined reference to `google::protobuf::internal::AssignDescriptors(google::protobuf::internal::DescriptorTable const* (*)(), std::once_flag*, google::protobuf::Metadata const&)'
out/gcc-debug//protobuf/veinsgym.pb.o: In function `veinsgym::proto::Reply::_InternalParse(char const*, google::protobuf::internal::ParseContext*)':
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.cc:946: undefined reference to `google::protobuf::internal::ParseContext::ParseMessage(google::protobuf::MessageLite*, char const*)'
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.cc:954: undefined reference to `google::protobuf::internal::ParseContext::ParseMessage(google::protobuf::MessageLite*, char const*)'
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.cc:962: undefined reference to `google::protobuf::internal::ParseContext::ParseMessage(google::protobuf::MessageLite*, char const*)'
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.cc:976: undefined reference to `google::protobuf::internal::UnknownFieldParse(unsigned long, google::protobuf::UnknownFieldSet*, char const*, google::protobuf::internal::ParseContext*)'
out/gcc-debug//protobuf/veinsgym.pb.o: In function `veinsgym::proto::Reply::_InternalSerialize(unsigned char*, google::protobuf::io::EpsCopyOutputStream*) const':
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.cc:1027: undefined reference to `google::protobuf::internal::WireFormat::InternalSerializeUnknownFieldsToArray(google::protobuf::UnknownFieldSet const&, unsigned char*, google::protobuf::io::EpsCopyOutputStream*)'
out/gcc-debug//protobuf/veinsgym.pb.o: In function `veinsgym::proto::Reply::ByteSizeLong() const':
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.cc:1073: undefined reference to `google::protobuf::Message::MaybeComputeUnknownFieldsSize(unsigned long, google::protobuf::internal::CachedSize*) const'
out/gcc-debug//protobuf/veinsgym.pb.o: In function `veinsgym::proto::Reply::GetMetadata() const':
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.cc:1140: undefined reference to `google::protobuf::internal::AssignDescriptors(google::protobuf::internal::DescriptorTable const* (*)(), std::once_flag*, google::protobuf::Metadata const&)'
out/gcc-debug//protobuf/veinsgym.pb.o: In function `veinsgym::proto::Init::Init(veinsgym::proto::Init const&)':
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.cc:1166: undefined reference to `google::protobuf::internal::ArenaStringPtr::Set(google::protobuf::internal::ArenaStringPtr::EmptyDefault, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, google::protobuf::Arena*)'
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.cc:1174: undefined reference to `google::protobuf::internal::ArenaStringPtr::Set(google::protobuf::internal::ArenaStringPtr::EmptyDefault, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, google::protobuf::Arena*)'
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.cc:1182: undefined reference to `google::protobuf::internal::ArenaStringPtr::Set(google::protobuf::internal::ArenaStringPtr::EmptyDefault, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, google::protobuf::Arena*)'
out/gcc-debug//protobuf/veinsgym.pb.o: In function `veinsgym::proto::Init::Clear()':
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.cc:1233: undefined reference to `google::protobuf::internal::ArenaStringPtr::ClearToEmpty()'
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.cc:1234: undefined reference to `google::protobuf::internal::ArenaStringPtr::ClearToEmpty()'
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.cc:1235: undefined reference to `google::protobuf::internal::ArenaStringPtr::ClearToEmpty()'
out/gcc-debug//protobuf/veinsgym.pb.o: In function `veinsgym::proto::Init::_InternalParse(char const*, google::protobuf::internal::ParseContext*)':
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.cc:1249: undefined reference to `google::protobuf::internal::InlineGreedyStringParser(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, char const*, google::protobuf::internal::ParseContext*)'
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.cc:1259: undefined reference to `google::protobuf::internal::InlineGreedyStringParser(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, char const*, google::protobuf::internal::ParseContext*)'
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.cc:1269: undefined reference to `google::protobuf::internal::InlineGreedyStringParser(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, char const*, google::protobuf::internal::ParseContext*)'
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.cc:1284: undefined reference to `google::protobuf::internal::UnknownFieldParse(unsigned long, google::protobuf::UnknownFieldSet*, char const*, google::protobuf::internal::ParseContext*)'
out/gcc-debug//protobuf/veinsgym.pb.o: In function `veinsgym::proto::Init::_InternalSerialize(unsigned char*, google::protobuf::io::EpsCopyOutputStream*) const':
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.cc:1335: undefined reference to `google::protobuf::internal::WireFormat::InternalSerializeUnknownFieldsToArray(google::protobuf::UnknownFieldSet const&, unsigned char*, google::protobuf::io::EpsCopyOutputStream*)'
out/gcc-debug//protobuf/veinsgym.pb.o: In function `veinsgym::proto::Init::ByteSizeLong() const':
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.cc:1371: undefined reference to `google::protobuf::Message::MaybeComputeUnknownFieldsSize(unsigned long, google::protobuf::internal::CachedSize*) const'
out/gcc-debug//protobuf/veinsgym.pb.o: In function `veinsgym::proto::Init::MergeFrom(veinsgym::proto::Init const&)':
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.h:2983: undefined reference to `google::protobuf::internal::ArenaStringPtr::Set(google::protobuf::internal::ArenaStringPtr::EmptyDefault, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, google::protobuf::Arena*)'
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.h:3034: undefined reference to `google::protobuf::internal::ArenaStringPtr::Set(google::protobuf::internal::ArenaStringPtr::EmptyDefault, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, google::protobuf::Arena*)'
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.h:3085: undefined reference to `google::protobuf::internal::ArenaStringPtr::Set(google::protobuf::internal::ArenaStringPtr::EmptyDefault, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, google::protobuf::Arena*)'
out/gcc-debug//protobuf/veinsgym.pb.o: In function `veinsgym::proto::Init::GetMetadata() const':
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.cc:1441: undefined reference to `google::protobuf::internal::AssignDescriptors(google::protobuf::internal::DescriptorTable const* (*)(), std::once_flag*, google::protobuf::Metadata const&)'
out/gcc-debug//protobuf/veinsgym.pb.o: In function `veinsgym::proto::Shutdown::Shutdown(veinsgym::proto::Shutdown const&)':
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.cc:1456: undefined reference to `google::protobuf::internal::ZeroFieldsBase::~ZeroFieldsBase()'
out/gcc-debug//protobuf/veinsgym.pb.o: In function `veinsgym::proto::Shutdown::GetMetadata() const':
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.cc:1480: undefined reference to `google::protobuf::internal::AssignDescriptors(google::protobuf::internal::DescriptorTable const* (*)(), std::once_flag*, google::protobuf::Metadata const&)'
out/gcc-debug//protobuf/veinsgym.pb.o: In function `veinsgym::proto::Step::_InternalParse(char const*, google::protobuf::internal::ParseContext*)':
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.cc:1580: undefined reference to `google::protobuf::internal::ParseContext::ParseMessage(google::protobuf::MessageLite*, char const*)'
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.cc:1588: undefined reference to `google::protobuf::internal::ParseContext::ParseMessage(google::protobuf::MessageLite*, char const*)'
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.cc:1602: undefined reference to `google::protobuf::internal::UnknownFieldParse(unsigned long, google::protobuf::UnknownFieldSet*, char const*, google::protobuf::internal::ParseContext*)'
out/gcc-debug//protobuf/veinsgym.pb.o: In function `veinsgym::proto::Step::_InternalSerialize(unsigned char*, google::protobuf::io::EpsCopyOutputStream*) const':
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.cc:1639: undefined reference to `google::protobuf::internal::WireFormat::InternalSerializeUnknownFieldsToArray(google::protobuf::UnknownFieldSet const&, unsigned char*, google::protobuf::io::EpsCopyOutputStream*)'
out/gcc-debug//protobuf/veinsgym.pb.o: In function `veinsgym::proto::Step::ByteSizeLong() const':
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.cc:1668: undefined reference to `google::protobuf::Message::MaybeComputeUnknownFieldsSize(unsigned long, google::protobuf::internal::CachedSize*) const'
out/gcc-debug//protobuf/veinsgym.pb.o: In function `veinsgym::proto::Step::GetMetadata() const':
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.cc:1724: undefined reference to `google::protobuf::internal::AssignDescriptors(google::protobuf::internal::DescriptorTable const* (*)(), std::once_flag*, google::protobuf::Metadata const&)'
out/gcc-debug//protobuf/veinsgym.pb.o: In function `veinsgym::proto::Space::_InternalParse(char const*, google::protobuf::internal::ParseContext*)':
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.cc:1992: undefined reference to `google::protobuf::internal::ParseContext::ParseMessage(google::protobuf::MessageLite*, char const*)'
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.cc:2000: undefined reference to `google::protobuf::internal::ParseContext::ParseMessage(google::protobuf::MessageLite*, char const*)'
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.cc:2008: undefined reference to `google::protobuf::internal::ParseContext::ParseMessage(google::protobuf::MessageLite*, char const*)'
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.cc:2016: undefined reference to `google::protobuf::internal::ParseContext::ParseMessage(google::protobuf::MessageLite*, char const*)'
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.cc:2024: undefined reference to `google::protobuf::internal::ParseContext::ParseMessage(google::protobuf::MessageLite*, char const*)'
out/gcc-debug//protobuf/veinsgym.pb.o:/home/rost/serpentine-env/src/protobuf/veinsgym.pb.cc:2032: more undefined references to `google::protobuf::internal::ParseContext::ParseMessage(google::protobuf::MessageLite*, char const*)' follow
out/gcc-debug//protobuf/veinsgym.pb.o: In function `veinsgym::proto::Space::_InternalParse(char const*, google::protobuf::internal::ParseContext*)':
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.cc:2046: undefined reference to `google::protobuf::internal::UnknownFieldParse(unsigned long, google::protobuf::UnknownFieldSet*, char const*, google::protobuf::internal::ParseContext*)'
out/gcc-debug//protobuf/veinsgym.pb.o: In function `veinsgym::proto::Space::_InternalSerialize(unsigned char*, google::protobuf::io::EpsCopyOutputStream*) const':
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.cc:2115: undefined reference to `google::protobuf::internal::WireFormat::InternalSerializeUnknownFieldsToArray(google::protobuf::UnknownFieldSet const&, unsigned char*, google::protobuf::io::EpsCopyOutputStream*)'
out/gcc-debug//protobuf/veinsgym.pb.o: In function `veinsgym::proto::Space::ByteSizeLong() const':
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.cc:2177: undefined reference to `google::protobuf::Message::MaybeComputeUnknownFieldsSize(unsigned long, google::protobuf::internal::CachedSize*) const'
out/gcc-debug//protobuf/veinsgym.pb.o: In function `veinsgym::proto::Space::GetMetadata() const':
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.cc:2252: undefined reference to `google::protobuf::internal::AssignDescriptors(google::protobuf::internal::DescriptorTable const* (*)(), std::once_flag*, google::protobuf::Metadata const&)'
out/gcc-debug//protobuf/veinsgym.pb.o: In function `veinsgym::proto::Box::Box(google::protobuf::Arena*, bool)':
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.cc:2264: undefined reference to `google::protobuf::RepeatedField<double>::RepeatedField(google::protobuf::Arena*)'
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.cc:2264: undefined reference to `google::protobuf::RepeatedField<double>::~RepeatedField()'
out/gcc-debug//protobuf/veinsgym.pb.o: In function `veinsgym::proto::Box::Box(veinsgym::proto::Box const&)':
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.cc:2273: undefined reference to `google::protobuf::RepeatedField<double>::RepeatedField(google::protobuf::RepeatedField<double> const&)'
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.cc:2273: undefined reference to `google::protobuf::RepeatedField<double>::~RepeatedField()'
out/gcc-debug//protobuf/veinsgym.pb.o: In function `veinsgym::proto::Box::~Box()':
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.cc:2281: undefined reference to `google::protobuf::RepeatedField<double>::~RepeatedField()'
out/gcc-debug//protobuf/veinsgym.pb.o: In function `veinsgym::proto::Box::Clear()':
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.cc:2308: undefined reference to `google::protobuf::RepeatedField<double>::Clear()'
out/gcc-debug//protobuf/veinsgym.pb.o: In function `veinsgym::proto::Box::_InternalParse(char const*, google::protobuf::internal::ParseContext*)':
/home/rost/serpentine-env/src/protobuf/veinsgym.pb.cc:2321: undefined reference to `google::protobuf::internal::PackedDoubleParser(void*, char const*, google::protobuf::internal::ParseContext*)'
...
/home/rost/serpentine-env/src/./protobuf/veinsgym.pb.h:780: undefined reference to `google::protobuf::internal::ZeroFieldsBase::InternalSwap(google::protobuf::internal::ZeroFieldsBase*)'
out/gcc-debug//serpentine/GymSplitter.o: In function `veinsgym::proto::Shutdown::CopyFrom(veinsgym::proto::Shutdown const&)':
/home/rost/serpentine-env/src/./protobuf/veinsgym.pb.h:835: undefined reference to `google::protobuf::internal::ZeroFieldsBase::CopyImpl(google::protobuf::Message*, google::protobuf::Message const&)'
out/gcc-debug//serpentine/GymSplitter.o: In function `veinsgym::proto::Box::set_values(int, double)':
/home/rost/serpentine-env/src/./protobuf/veinsgym.pb.h:3778: undefined reference to `google::protobuf::RepeatedField<double>::Set(int, double const&)'
out/gcc-debug//serpentine/GymSplitter.o: In function `void google::protobuf::RepeatedField<double>::Add<double const*>(double const*, double const*)':
/usr/local/include/google/protobuf/repeated_field.h:705: undefined reference to `google::protobuf::RepeatedField<double>::size() const'
/usr/local/include/google/protobuf/repeated_field.h:712: undefined reference to `google::protobuf::RepeatedField<double>::elements() const'
/usr/local/include/google/protobuf/repeated_field.h:712: undefined reference to `google::protobuf::RepeatedField<double>::size() const'
/usr/local/include/google/protobuf/repeated_field.h:713: undefined reference to `google::protobuf::RepeatedField<double>::size() const'
out/gcc-debug//serpentine/GymSplitter.o: In function `google::protobuf::RepeatedField<double>::FastAdderImpl<0, true>::FastAdderImpl(google::protobuf::RepeatedField<double>*)':
/usr/local/include/google/protobuf/repeated_field.h:448: undefined reference to `google::protobuf::RepeatedField<double>::unsafe_elements() const'
out/gcc-debug//serpentine/GymSplitter.o: In function `google::protobuf::RepeatedField<double>::FastAdderImpl<0, true>::Add(double)':
/usr/local/include/google/protobuf/repeated_field.h:457: undefined reference to `google::protobuf::RepeatedField<double>::unsafe_elements() const'
collect2: error: ld returned 1 exit status
Makefile:96: recipe for target 'out/gcc-debug//experiment_dbg' failed
make: *** [out/gcc-debug//experiment_dbg] Error 1
make: Leaving directory '/home/rost/serpentine-env/src'
I have downloaded the GTest sourcecode googletest-release-1.8.0.tar.gz (from : github ) and extracted it. (working on CentOS)
After that I ran following commands:
cd googletest-release-1.8.0\googletest.
cmake CMakeLists.txt.
Output:
-- Configuring done
-- Generating done
-- Build files have been written to: gtestframework/googletest-release-1.8.0/googletest
make.
Output:
[ 50%] Built target gtest
[100%] Built target gtest_main
After this I copied the file libgtest_main.a and libgtest.a into /usr/lib.
cd googletest-release-1.8.0\googlemock\gtest.
Copied libgtest_main.so libgtest.so libGTest.so in /usr/lib folder.
cd gtestframework\Testcode //{2 C++ files inside Testcode}
cmake CMakeLists.txt.
make.
I got this error:
Linking CXX executable runTests
CMakeFiles/runTests.dir/tests.cpp.o: In function `__static_initialization_and_destruction_0(int, int)':
tests.cpp:(.text+0x95a): undefined reference to `testing::internal::MakeAndRegisterTestInfo(char const*, char const*, char const*, char const*, testing::internal::CodeLocation, void const*, void (*)(), void (*)(), testing::internal::TestFactoryBase*)'
tests.cpp:(.text+0xa14): undefined reference to `testing::internal::MakeAndRegisterTestInfo(char const*, char const*, char const*, char const*, testing::internal::CodeLocation, void const*, void (*)(), void (*)(), testing::internal::TestFactoryBase*)'
CMakeFiles/runTests.dir/tests.cpp.o: In function `testing::AssertionResult testing::internal::CmpHelperEQFailure<int, double>(char const*, char const*, int const&, double const&)':
tests.cpp:(.text._ZN7testing8internal18CmpHelperEQFailureIidEENS_15AssertionResultEPKcS4_RKT_RKT0_[_ZN7testing8internal18CmpHelperEQFailureIidEENS_15AssertionResultEPKcS4_RKT_RKT0_]+0x6c): undefined reference to `testing::internal::EqFailure(char const*, char const*, std::string const&, std::string const&, bool)'
CMakeFiles/runTests.dir/tests.cpp.o: In function `testing::AssertionResult testing::internal::CmpHelperEQFailure<double, double>(char const*, char const*, double const&, double const&)':
tests.cpp:(.text._ZN7testing8internal18CmpHelperEQFailureIddEENS_15AssertionResultEPKcS4_RKT_RKT0_[_ZN7testing8internal18CmpHelperEQFailureIddEENS_15AssertionResultEPKcS4_RKT_RKT0_]+0x6c): undefined reference to `testing::internal::EqFailure(char const*, char const*, std::string const&, std::string const&, bool)'
collect2: error: ld returned 1 exit status
make[2]: *** [runTests] Error 1
make[1]: *** [CMakeFiles/runTests.dir/all] Error 2
make: *** [all] Error 2
CMakeLists.txt file content:
cmake_minimum_required(VERSION 2.6)
# Locate GTest
find_package(GTest REQUIRED)
include_directories(${GTEST_INCLUDE_DIRS})
# Link runTests with what we want to test and the GTest and pthread library
add_executable(runTests tests.cpp)
target_link_libraries(runTests ${GTEST_LIBRARIES} pthread)
recently I start study unit testing , and I want test my program with gtest. I install all with this order :
$ git clone https://github.com/google/googletest
$ cd googletest
$ cmake -DBUILD_SHARED_LIBS=ON .
$ make
$ cd googlemock
$ sudo cp ./libgmock_main.so ./gtest/libgtest.so gtest/libgtest_main.so ./libgmock.so /usr/lib/
$ sudo ldconfig
and now write code :
#include "gtest/gtest.h"
class Add
{
private:
int element;
public:
Add():element(0){}
~Add(){}
void setElement(int e){ element = e; }
int getElement() { return element; }
int adder(int e) { return element += e; }
};
class AddTest : public ::testing::Test
{
protected:
int abc(int a){
return a;
}
virtual void SetUp(){
add1.setElement(1);
add2.setElement(20);
}
virtual void TearDown(){}
Add add1;
Add add2;
};
TEST_F(AddTest, getTest)
{
EXPECT_EQ(1, add1.getElement());
EXPECT_EQ(20, add2.getElement());
}
int main(int argc, char **argv)
{
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
end when I run test i get this error :
CMakeFiles/mock2.dir/main.cpp.o: In function AddTest_getTest_Test::TestBody()':
/home/artem/CLionProjects/mock2/main.cpp:33: undefined reference totesting::Message::Message()'
/home/artem/CLionProjects/mock2/main.cpp:33: undefined reference to testing::internal::AssertHelper::AssertHelper(testing::TestPartResult::Type, char const*, int, char const*)'
/home/artem/CLionProjects/mock2/main.cpp:33: undefined reference totesting::internal::AssertHelper::operator=(testing::Message const&) const'
/home/artem/CLionProjects/mock2/main.cpp:33: undefined reference to testing::internal::AssertHelper::~AssertHelper()'
/home/artem/CLionProjects/mock2/main.cpp:34: undefined reference totesting::Message::Message()'
/home/artem/CLionProjects/mock2/main.cpp:34: undefined reference to testing::internal::AssertHelper::AssertHelper(testing::TestPartResult::Type, char const*, int, char const*)'
/home/artem/CLionProjects/mock2/main.cpp:34: undefined reference totesting::internal::AssertHelper::operator=(testing::Message const&) const'
/home/artem/CLionProjects/mock2/main.cpp:34: undefined reference to testing::internal::AssertHelper::~AssertHelper()'
/home/artem/CLionProjects/mock2/main.cpp:33: undefined reference totesting::internal::AssertHelper::~AssertHelper()'
/home/artem/CLionProjects/mock2/main.cpp:34: undefined reference to testing::internal::AssertHelper::~AssertHelper()'
CMakeFiles/mock2.dir/main.cpp.o: In functionmain':
/home/artem/CLionProjects/mock2/main.cpp:39: undefined reference to testing::InitGoogleTest(int*, char**)'
CMakeFiles/mock2.dir/main.cpp.o: In function__static_initialization_and_destruction_0(int, int)':
/home/artem/CLionProjects/mock2/main.cpp:31: undefined reference to testing::internal::MakeAndRegisterTestInfo(char const*, char const*, char const*, char const*, testing::internal::CodeLocation, void const*, void (*)(), void (*)(), testing::internal::TestFactoryBase*)'
CMakeFiles/mock2.dir/main.cpp.o: In functionRUN_ALL_TESTS()':
/usr/local/include/gtest/gtest.h:2235: undefined reference to testing::UnitTest::GetInstance()'
/usr/local/include/gtest/gtest.h:2235: undefined reference totesting::UnitTest::Run()'
CMakeFiles/mock2.dir/main.cpp.o: In function AddTest::AddTest()':
/home/artem/CLionProjects/mock2/main.cpp:15: undefined reference totesting::Test::Test()'
CMakeFiles/mock2.dir/main.cpp.o: In function AddTest::~AddTest()':
/home/artem/CLionProjects/mock2/main.cpp:15: undefined reference totesting::Test::~Test()'
CMakeFiles/mock2.dir/main.cpp.o: In function testing::internal::scoped_ptr<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::reset(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*)':
/usr/local/include/gtest/internal/gtest-port.h:1172: undefined reference totesting::internal::IsTrue(bool)'
CMakeFiles/mock2.dir/main.cpp.o: In function testing::internal::scoped_ptr<std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> > >::reset(std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >*)':
/usr/local/include/gtest/internal/gtest-port.h:1172: undefined reference totesting::internal::IsTrue(bool)'
CMakeFiles/mock2.dir/main.cpp.o: In function testing::AssertionResult testing::internal::CmpHelperEQ<int, int>(char const*, char const*, int const&, int const&)':
/usr/local/include/gtest/gtest.h:1394: undefined reference totesting::AssertionSuccess()'
CMakeFiles/mock2.dir/main.cpp.o: In function testing::AssertionResult testing::internal::CmpHelperEQFailure<int, int>(char const*, char const*, int const&, int const&)':
/usr/local/include/gtest/gtest.h:1384: undefined reference totesting::internal::EqFailure(char const*, char const*, std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&, bool)'
CMakeFiles/mock2.dir/main.cpp.o:(.rodata._ZTI7AddTest[_ZTI7AddTest]+0x10): undefined reference to `typeinfo for testing::Test'
collect2: error: ld returned 1 exit status
CMakeFiles/mock2.dir/build.make:94: recipe for target 'mock2' failed
make[3]: * [mock2] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/mock2.dir/all' failed
make[2]: [CMakeFiles/mock2.dir/all] Error 2
CMakeFiles/Makefile2:79: recipe for target 'CMakeFiles/mock2.dir/rule' failed
make[1]: [CMakeFiles/mock2.dir/rule] Error 2
Makefile:118: recipe for target 'mock2' failed
make: * [mock2] Error 2
but when use command
g++ main.cpp -o test -lgtest -lpthread
everytheng is good. How can I fix it and run it not in command line ?
If you are using CLion then you may have a CMakeLists.txt file you should add rules to link to the libraries. To do this add the following line to your CMakeLists.txt
enable_testing()
find_package(GTest REQUIRED) # Find the google testing framework on your system
include_directories(${GTEST_INCLUDE_DIRS})
target_link_libraries(${PROJECT_NAME} ${GTEST_LIBRARIES}) # Replace ${PROJECT_NAME} with your target name
For more details go here.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
I'm trying to build OpenCV 3.1 on Linux (Ubuntu 15.10), but am getting the following errors:
cd /home/rob/Libraries/OpenCV3/opencv-3.1.0/build/modules/cudev/test && /usr/bin/cmake -E cmake_link_script CMakeFiles/opencv_test_cudev.dir/link.txt --verbose=1
/usr/lib/ccache/c++ -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Winit-self -Wpointer-arith -Wno-narrowing -Wno-delete-non-virtual-dtor -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -msse -msse2 -mno-avx -msse3 -mno-ssse3 -mno-sse4.1 -mno-sse4.2 -ffunction-sections -fvisibility=hidden -Wno-undef -Wno-missing-declarations -Wno-unused-function -Wno-unused-variable -Wno-enum-compare -Wno-shadow -O3 -DNDEBUG -DNDEBUG CMakeFiles/opencv_test_cudev.dir/test_main.cpp.o CMakeFiles/opencv_test_cudev.dir/opencv_test_cudev_generated_test_lut.cu.o CMakeFiles/opencv_test_cudev.dir/opencv_test_cudev_generated_test_cvt.cu.o CMakeFiles/opencv_test_cudev.dir/opencv_test_cudev_generated_test_arithm_op.cu.o CMakeFiles/opencv_test_cudev.dir/opencv_test_cudev_generated_test_reduction.cu.o CMakeFiles/opencv_test_cudev.dir/opencv_test_cudev_generated_test_warp.cu.o CMakeFiles/opencv_test_cudev.dir/opencv_test_cudev_generated_test_color_cvt.cu.o CMakeFiles/opencv_test_cudev.dir/opencv_test_cudev_generated_test_split_merge.cu.o CMakeFiles/opencv_test_cudev.dir/opencv_test_cudev_generated_test_pyramids.cu.o CMakeFiles/opencv_test_cudev.dir/opencv_test_cudev_generated_test_bitwize_op.cu.o CMakeFiles/opencv_test_cudev.dir/opencv_test_cudev_generated_test_deriv.cu.o CMakeFiles/opencv_test_cudev.dir/opencv_test_cudev_generated_test_arithm_func.cu.o CMakeFiles/opencv_test_cudev.dir/opencv_test_cudev_generated_test_integral.cu.o CMakeFiles/opencv_test_cudev.dir/opencv_test_cudev_generated_transpose.cu.o CMakeFiles/opencv_test_cudev.dir/opencv_test_cudev_generated_test_cmp_op.cu.o -o ../../../bin/opencv_test_cudev -L/usr/local/cuda/lib64 -rdynamic -lcudart ../../../lib/libopencv_ts.a ../../../lib/libopencv_highgui.so.3.1.0 -ldl -lm -lpthread -lrt ../../../../3rdparty/ippicv/unpack/ippicv_lnx/lib/intel64/libippicv.a -lcudart -lnppc -lnppi -lnpps -lcufft -L/usr/local/cuda/lib64 -lcudart ../../../lib/libopencv_videoio.so.3.1.0 ../../../lib/libopencv_imgcodecs.so.3.1.0 ../../../lib/libopencv_imgproc.so.3.1.0 ../../../lib/libopencv_core.so.3.1.0 ../../../lib/libopencv_cudev.so.3.1.0 -lnppc -lnppi -lnpps -lcufft -Wl,-rpath,/usr/local/cuda/lib64:/home/rob/Libraries/OpenCV3/opencv-3.1.0/build/lib
CMakeFiles/opencv_test_cudev.dir/opencv_test_cudev_generated_test_lut.cu.o: In function `testing::internal::TypeParameterizedTest<LutTest, testing::internal::TemplateSel<LutTest_GpuMat_Test>, testing::internal::Types1<unsigned char> >::Register(char const*, char const*, char const*, int)':
tmpxft_00006387_00000000-10_test_lut.compute_20.cudafe1.cpp:(.text._ZN7testing8internal21TypeParameterizedTestI7LutTestNS0_11TemplateSelI19LutTest_GpuMat_TestEENS0_6Types1IhEEE8RegisterEPKcSA_SA_i[_ZN7testing8internal21TypeParameterizedTestI7LutTestNS0_11TemplateSelI19LutTest_GpuMat_TestEENS0_6Types1IhEEE8RegisterEPKcSA_SA_i]+0x14b): undefined reference to `testing::Message::GetString() const'
CMakeFiles/opencv_test_cudev.dir/opencv_test_cudev_generated_test_cvt.cu.o: In function `testing::internal::TypeParameterizedTest<CvtTest, testing::internal::TemplateSel<CvtTest_GpuMat_Test>, testing::internal::Types2<int, float> >::Register(char const*, char const*, char const*, int)':
tmpxft_000063d6_00000000-10_test_cvt.compute_20.cudafe1.cpp:(.text._ZN7testing8internal21TypeParameterizedTestI7CvtTestNS0_11TemplateSelI19CvtTest_GpuMat_TestEENS0_6Types2IifEEE8RegisterEPKcSA_SA_i[_ZN7testing8internal21TypeParameterizedTestI7CvtTestNS0_11TemplateSelI19CvtTest_GpuMat_TestEENS0_6Types2IifEEE8RegisterEPKcSA_SA_i]+0x141): undefined reference to `testing::Message::GetString() const'
tmpxft_000063d6_00000000-10_test_cvt.compute_20.cudafe1.cpp:(.text._ZN7testing8internal21TypeParameterizedTestI7CvtTestNS0_11TemplateSelI19CvtTest_GpuMat_TestEENS0_6Types2IifEEE8RegisterEPKcSA_SA_i[_ZN7testing8internal21TypeParameterizedTestI7CvtTestNS0_11TemplateSelI19CvtTest_GpuMat_TestEENS0_6Types2IifEEE8RegisterEPKcSA_SA_i]+0x452): undefined reference to `testing::Message::GetString() const'
CMakeFiles/opencv_test_cudev.dir/opencv_test_cudev_generated_test_cvt.cu.o: In function `testing::internal::TypeParameterizedTest<CvtTest, testing::internal::TemplateSel<CvtTest_GpuMat_Test>, testing::internal::Types4<unsigned short, short, int, float> >::Register(char const*, char const*, char const*, int)':
tmpxft_000063d6_00000000-10_test_cvt.compute_20.cudafe1.cpp:(.text._ZN7testing8internal21TypeParameterizedTestI7CvtTestNS0_11TemplateSelI19CvtTest_GpuMat_TestEENS0_6Types4ItsifEEE8RegisterEPKcSA_SA_i[_ZN7testing8internal21TypeParameterizedTestI7CvtTestNS0_11TemplateSelI19CvtTest_GpuMat_TestEENS0_6Types4ItsifEEE8RegisterEPKcSA_SA_i]+0x152): undefined reference to `testing::Message::GetString() const'
tmpxft_000063d6_00000000-10_test_cvt.compute_20.cudafe1.cpp:(.text._ZN7testing8internal21TypeParameterizedTestI7CvtTestNS0_11TemplateSelI19CvtTest_GpuMat_TestEENS0_6Types4ItsifEEE8RegisterEPKcSA_SA_i[_ZN7testing8internal21TypeParameterizedTestI7CvtTestNS0_11TemplateSelI19CvtTest_GpuMat_TestEENS0_6Types4ItsifEEE8RegisterEPKcSA_SA_i]+0x472): undefined reference to `testing::Message::GetString() const'
CMakeFiles/opencv_test_cudev.dir/opencv_test_cudev_generated_test_cvt.cu.o:tmpxft_000063d6_00000000-10_test_cvt.compute_20.cudafe1.cpp:(.text._ZN7testing8internal21TypeParameterizedTestI7CvtTestNS0_11TemplateSelI19CvtTest_GpuMat_TestEENS0_6Types5IhtsifEEE8RegisterEPKcSA_SA_i[_ZN7testing8internal21TypeParameterizedTestI7CvtTestNS0_11TemplateSelI19CvtTest_GpuMat_TestEENS0_6Types5IhtsifEEE8RegisterEPKcSA_SA_i]+0x140): more undefined references to `testing::Message::GetString() const' follow
CMakeFiles/opencv_test_cudev.dir/opencv_test_cudev_generated_test_reduction.cu.o: In function `testing::AssertionResult testing::internal::CmpHelperFloatingPointEQ<float>(char const*, char const*, float, float)':
tmpxft_000063c4_00000000-10_test_reduction.compute_20.cudafe1.cpp:(.text._ZN7testing8internal24CmpHelperFloatingPointEQIfEENS_15AssertionResultEPKcS4_T_S5_[_ZN7testing8internal24CmpHelperFloatingPointEQIfEENS_15AssertionResultEPKcS4_T_S5_]+0x12a): undefined reference to `testing::internal::StringStreamToString(std::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >*)'
tmpxft_000063c4_00000000-10_test_reduction.compute_20.cudafe1.cpp:(.text._ZN7testing8internal24CmpHelperFloatingPointEQIfEENS_15AssertionResultEPKcS4_T_S5_[_ZN7testing8internal24CmpHelperFloatingPointEQIfEENS_15AssertionResultEPKcS4_T_S5_]+0x139): undefined reference to `testing::internal::StringStreamToString(std::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >*)'
tmpxft_000063c4_00000000-10_test_reduction.compute_20.cudafe1.cpp:(.text._ZN7testing8internal24CmpHelperFloatingPointEQIfEENS_15AssertionResultEPKcS4_T_S5_[_ZN7testing8internal24CmpHelperFloatingPointEQIfEENS_15AssertionResultEPKcS4_T_S5_]+0x154): undefined reference to `testing::internal::EqFailure(char const*, char const*, std::string const&, std::string const&, bool)'
CMakeFiles/opencv_test_cudev.dir/opencv_test_cudev_generated_test_warp.cu.o: In function `testing::AssertionResult testing::internal::CmpHelperEQ<int, int>(char const*, char const*, int const&, int const&)':
tmpxft_000063ba_00000000-10_test_warp.compute_20.cudafe1.cpp:(.text._ZN7testing8internal11CmpHelperEQIiiEENS_15AssertionResultEPKcS4_RKT_RKT0_[_ZN7testing8internal11CmpHelperEQIiiEENS_15AssertionResultEPKcS4_RKT_RKT0_]+0x5c): undefined reference to `testing::internal::EqFailure(char const*, char const*, std::string const&, std::string const&, bool)'
CMakeFiles/opencv_test_cudev.dir/opencv_test_cudev_generated_test_warp.cu.o: In function `testing::AssertionResult& testing::AssertionResult::operator<< <char [12]>(char const (&) [12])':
tmpxft_000063ba_00000000-10_test_warp.compute_20.cudafe1.cpp:(.text._ZN7testing15AssertionResultlsIA12_cEERS0_RKT_[_ZN7testing15AssertionResultlsIA12_cEERS0_RKT_]+0x66): undefined reference to `testing::Message::GetString() const'
CMakeFiles/opencv_test_cudev.dir/opencv_test_cudev_generated_test_warp.cu.o: In function `testing::AssertionResult& testing::AssertionResult::operator<< <char const*>(char const* const&)':
tmpxft_000063ba_00000000-10_test_warp.compute_20.cudafe1.cpp:(.text._ZN7testing15AssertionResultlsIPKcEERS0_RKT_[_ZN7testing15AssertionResultlsIPKcEERS0_RKT_]+0x67): undefined reference to `testing::Message::GetString() const'
CMakeFiles/opencv_test_cudev.dir/opencv_test_cudev_generated_test_warp.cu.o: In function `testing::AssertionResult& testing::AssertionResult::operator<< <char [7]>(char const (&) [7])':
tmpxft_000063ba_00000000-10_test_warp.compute_20.cudafe1.cpp:(.text._ZN7testing15AssertionResultlsIA7_cEERS0_RKT_[_ZN7testing15AssertionResultlsIA7_cEERS0_RKT_]+0x66): undefined reference to `testing::Message::GetString() const'
CMakeFiles/opencv_test_cudev.dir/opencv_test_cudev_generated_test_warp.cu.o: In function `testing::AssertionResult& testing::AssertionResult::operator<< <std::string>(std::string const&)':
tmpxft_000063ba_00000000-10_test_warp.compute_20.cudafe1.cpp:(.text._ZN7testing15AssertionResultlsISsEERS0_RKT_[_ZN7testing15AssertionResultlsISsEERS0_RKT_]+0x54): undefined reference to `testing::Message::GetString() const'
CMakeFiles/opencv_test_cudev.dir/opencv_test_cudev_generated_test_warp.cu.o: In function `testing::AssertionResult& testing::AssertionResult::operator<< <char [5]>(char const (&) [5])':
tmpxft_000063ba_00000000-10_test_warp.compute_20.cudafe1.cpp:(.text._ZN7testing15AssertionResultlsIA5_cEERS0_RKT_[_ZN7testing15AssertionResultlsIA5_cEERS0_RKT_]+0x66): undefined reference to `testing::Message::GetString() const'
CMakeFiles/opencv_test_cudev.dir/opencv_test_cudev_generated_test_warp.cu.o: In function `testing::AssertionResult testing::internal::CmpHelperEQ<cv::Size_<int>, cv::Size_<int> >(char const*, char const*, cv::Size_<int> const&, cv::Size_<int> const&)':
tmpxft_000063ba_00000000-10_test_warp.compute_20.cudafe1.cpp:(.text._ZN7testing8internal11CmpHelperEQIN2cv5Size_IiEES4_EENS_15AssertionResultEPKcS7_RKT_RKT0_[_ZN7testing8internal11CmpHelperEQIN2cv5Size_IiEES4_EENS_15AssertionResultEPKcS7_RKT_RKT0_]+0x5c): undefined reference to `testing::internal::EqFailure(char const*, char const*, std::string const&, std::string const&, bool)'
CMakeFiles/opencv_test_cudev.dir/opencv_test_cudev_generated_test_bitwize_op.cu.o: In function `testing::internal::TypeParameterizedTest<LShiftTest, testing::internal::TemplateSel<LShiftTest_Accuracy_Test>, testing::internal::Types1<int> >::Register(char const*, char const*, char const*, int)':
tmpxft_000063f1_00000000-10_test_bitwize_op.compute_20.cudafe1.cpp:(.text._ZN7testing8internal21TypeParameterizedTestI10LShiftTestNS0_11TemplateSelI24LShiftTest_Accuracy_TestEENS0_6Types1IiEEE8RegisterEPKcSA_SA_i[_ZN7testing8internal21TypeParameterizedTestI10LShiftTestNS0_11TemplateSelI24LShiftTest_Accuracy_TestEENS0_6Types1IiEEE8RegisterEPKcSA_SA_i]+0xdc): undefined reference to `testing::Message::GetString() const'
CMakeFiles/opencv_test_cudev.dir/opencv_test_cudev_generated_test_bitwize_op.cu.o: In function `testing::internal::TypeParameterizedTest<BitNotTest, testing::internal::TemplateSel<BitNotTest_GpuMat_Test>, testing::internal::Types1<int> >::Register(char const*, char const*, char const*, int)':
tmpxft_000063f1_00000000-10_test_bitwize_op.compute_20.cudafe1.cpp:(.text._ZN7testing8internal21TypeParameterizedTestI10BitNotTestNS0_11TemplateSelI22BitNotTest_GpuMat_TestEENS0_6Types1IiEEE8RegisterEPKcSA_SA_i[_ZN7testing8internal21TypeParameterizedTestI10BitNotTestNS0_11TemplateSelI22BitNotTest_GpuMat_TestEENS0_6Types1IiEEE8RegisterEPKcSA_SA_i]+0x14b): undefined reference to `testing::Message::GetString() const'
CMakeFiles/opencv_test_cudev.dir/opencv_test_cudev_generated_test_bitwize_op.cu.o: In function `testing::internal::TypeParameterizedTest<BitNotTest, testing::internal::TemplateSel<BitNotTest_GpuMat_Test>, testing::internal::Types2<short, int> >::Register(char const*, char const*, char const*, int)':
tmpxft_000063f1_00000000-10_test_bitwize_op.compute_20.cudafe1.cpp:(.text._ZN7testing8internal21TypeParameterizedTestI10BitNotTestNS0_11TemplateSelI22BitNotTest_GpuMat_TestEENS0_6Types2IsiEEE8RegisterEPKcSA_SA_i[_ZN7testing8internal21TypeParameterizedTestI10BitNotTestNS0_11TemplateSelI22BitNotTest_GpuMat_TestEENS0_6Types2IsiEEE8RegisterEPKcSA_SA_i]+0x140): undefined reference to `testing::Message::GetString() const'
CMakeFiles/opencv_test_cudev.dir/opencv_test_cudev_generated_test_bitwize_op.cu.o: In function `testing::internal::TypeParameterizedTest<BitNotTest, testing::internal::TemplateSel<BitNotTest_GpuMat_Test>, testing::internal::Types3<unsigned short, short, int> >::Register(char const*, char const*, char const*, int)':
tmpxft_000063f1_00000000-10_test_bitwize_op.compute_20.cudafe1.cpp:(.text._ZN7testing8internal21TypeParameterizedTestI10BitNotTestNS0_11TemplateSelI22BitNotTest_GpuMat_TestEENS0_6Types3ItsiEEE8RegisterEPKcSA_SA_i[_ZN7testing8internal21TypeParameterizedTestI10BitNotTestNS0_11TemplateSelI22BitNotTest_GpuMat_TestEENS0_6Types3ItsiEEE8RegisterEPKcSA_SA_i]+0x140): undefined reference to `testing::Message::GetString() const'
CMakeFiles/opencv_test_cudev.dir/opencv_test_cudev_generated_test_bitwize_op.cu.o: In function `testing::internal::TypeParameterizedTest<BitNotTest, testing::internal::TemplateSel<BitNotTest_GpuMat_Test>, testing::internal::Types4<unsigned char, unsigned short, short, int> >::Register(char const*, char const*, char const*, int)':
tmpxft_000063f1_00000000-10_test_bitwize_op.compute_20.cudafe1.cpp:(.text._ZN7testing8internal21TypeParameterizedTestI10BitNotTestNS0_11TemplateSelI22BitNotTest_GpuMat_TestEENS0_6Types4IhtsiEEE8RegisterEPKcSA_SA_i[_ZN7testing8internal21TypeParameterizedTestI10BitNotTestNS0_11TemplateSelI22BitNotTest_GpuMat_TestEENS0_6Types4IhtsiEEE8RegisterEPKcSA_SA_i]+0x140): undefined reference to `testing::Message::GetString() const'
CMakeFiles/opencv_test_cudev.dir/opencv_test_cudev_generated_test_bitwize_op.cu.o:tmpxft_000063f1_00000000-10_test_bitwize_op.compute_20.cudafe1.cpp:(.text._ZN7testing8internal21TypeParameterizedTestI10BitAndTestNS0_11TemplateSelI29BitAndTest_GpuMat_GpuMat_TestEENS0_6Types1IiEEE8RegisterEPKcSA_SA_i[_ZN7testing8internal21TypeParameterizedTestI10BitAndTestNS0_11TemplateSelI29BitAndTest_GpuMat_GpuMat_TestEENS0_6Types1IiEEE8RegisterEPKcSA_SA_i]+0x14b): more undefined references to `testing::Message::GetString() const' follow
collect2: error: ld returned 1 exit status
modules/cudev/test/CMakeFiles/opencv_test_cudev.dir/build.make:5441: recipe for target 'bin/opencv_test_cudev' failed
make[2]: *** [bin/opencv_test_cudev] Error 1
make[2]: Leaving directory '/home/rob/Libraries/OpenCV3/opencv-3.1.0/build'
CMakeFiles/Makefile2:1834: recipe for target 'modules/cudev/test/CMakeFiles/opencv_test_cudev.dir/all' failed
make[1]: *** [modules/cudev/test/CMakeFiles/opencv_test_cudev.dir/all] Error 2
make[1]: Leaving directory '/home/rob/Libraries/OpenCV3/opencv-3.1.0/build'
Makefile:146: recipe for target 'all' failed
make: *** [all] Error 2
It seems it's in a testing module.
Using CUDA 7.5, GCC-5.2.1 for OpenCV and GCC-4.7 For CUDA specific parts (you've always needed to use two different compilers)
Does anyone a fix or just a way to disable the module since it's only testing?
I had the same problem. I subsequently disabled compiling the testing modules with the cmake option "-DBUILD_TESTS=OFF". Then the opencv build seems to proceed without a problem.
Hope this helps.
I have some problem with compile correct application in fresh-installed Clion IDE. Earlier I used Code::Blocks and all compiling successfully. Project use pthread and Crypto++ library. I'm already have them installed on my Ubuntu 15.04. And compile Clion project with -pthread flag. But it can't find crypto++ library. How to fix this?
My CMake file:
cmake_minimum_required(VERSION 3.3)
project(Chat)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -pthread")
set(SOURCE_FILES
include/Chat.h
include/Checker.h
include/Client.h
include/DataTransferingInterface.h
include/EncryptorDES.h
include/EncryptorRSA.h
include/Logger.h
include/OwnerClientInterface.h
include/OwnerServerInterface.h
include/Parser.h
include/SecureChat.h
include/Server.h
src/Chat.cpp
src/Checker.cpp
src/Client.cpp
src/DataTransferingInterface.cpp
src/EncryptorDES.cpp
src/EncryptorRSA.cpp
src/Logger.cpp
src/OwnerClientInterface.cpp
src/OwnerServerInterface.cpp
src/Parser.cpp
src/SecureChat.cpp
src/Server.cpp
main.cpp)
add_executable(Chat ${SOURCE_FILES})
Compile errors:
/usr/include/cryptopp/integer.h:26: undefined reference to `vtable for CryptoPP::Integer'
CMakeFiles/Chat.dir/src/EncryptorRSA.cpp.o: In function `CryptoPP::AbstractRing<CryptoPP::Integer>::MultiplicativeGroupT::~MultiplicativeGroupT()':
/usr/include/cryptopp/algebra.h:70: undefined reference to `vtable for CryptoPP::AbstractRing<CryptoPP::Integer>::MultiplicativeGroupT'
/usr/include/cryptopp/algebra.h:70: undefined reference to `CryptoPP::AbstractGroup<CryptoPP::Integer>::~AbstractGroup()'
CMakeFiles/Chat.dir/src/EncryptorRSA.cpp.o: In function `CryptoPP::FileStore::~FileStore()':
/usr/include/cryptopp/files.h:14: undefined reference to `vtable for CryptoPP::FileStore'
/usr/include/cryptopp/files.h:14: undefined reference to `vtable for CryptoPP::FileStore'
CMakeFiles/Chat.dir/src/EncryptorRSA.cpp.o: In function `CryptoPP::FileSink::~FileSink()':
/usr/include/cryptopp/files.h:77: undefined reference to `vtable for CryptoPP::FileSink'
/usr/include/cryptopp/files.h:77: undefined reference to `vtable for CryptoPP::FileSink'
CMakeFiles/Chat.dir/src/EncryptorRSA.cpp.o: In function `CryptoPP::HMAC_Base::~HMAC_Base()':
/usr/include/cryptopp/hmac.h:12: undefined reference to `vtable for CryptoPP::HMAC_Base'
/usr/include/cryptopp/hmac.h:12: undefined reference to `vtable for CryptoPP::HMAC_Base'
CMakeFiles/Chat.dir/src/EncryptorRSA.cpp.o: In function `CryptoPP::AlgorithmParametersTemplate<char const*>::AssignValue(char const*, std::type_info const&, void*) const':
/usr/include/cryptopp/algparam.h:313: undefined reference to `CryptoPP::g_pAssignIntToInteger'
/usr/include/cryptopp/algparam.h:313: undefined reference to `CryptoPP::g_pAssignIntToInteger'
CMakeFiles/Chat.dir/src/EncryptorRSA.cpp.o: In function `CryptoPP::DL_EncryptorBase<CryptoPP::ECPPoint>::Encrypt(CryptoPP::RandomNumberGenerator&, unsigned char const*, unsigned long, unsigned char*, CryptoPP::NameValuePairs const&) const':
/usr/include/cryptopp/integer.h:118: undefined reference to `CryptoPP::Integer::One()'
/usr/include/cryptopp/integer.h:118: undefined reference to `CryptoPP::Integer::Zero()'
CMakeFiles/Chat.dir/src/EncryptorRSA.cpp.o: In function `CryptoPP::DL_EncryptorBase<CryptoPP::ECPPoint>::Encrypt(CryptoPP::RandomNumberGenerator&, unsigned char const*, unsigned long, unsigned char*, CryptoPP::NameValuePairs const&) const':
/usr/include/cryptopp/pubkey.h:1228: undefined reference to `CryptoPP::Integer::One()'
/usr/include/cryptopp/pubkey.h:1228: undefined reference to `CryptoPP::Integer::Integer(CryptoPP::RandomNumberGenerator&, CryptoPP::Integer const&, CryptoPP::Integer const&, CryptoPP::Integer::RandomNumberType, CryptoPP::Integer const&, CryptoPP::Integer const&)'
CMakeFiles/Chat.dir/src/EncryptorRSA.cpp.o: In function `CryptoPP::SourceTemplate<CryptoPP::FileStore>::Pump2(unsigned long long&, bool)':
/usr/include/cryptopp/filters.h:763: undefined reference to `CryptoPP::DEFAULT_CHANNEL'
/usr/include/cryptopp/filters.h:763: undefined reference to `CryptoPP::FileStore::TransferTo2(CryptoPP::BufferedTransformation&, unsigned long long&, std::string const&, bool)'
CMakeFiles/Chat.dir/src/EncryptorRSA.cpp.o: In function `CryptoPP::SourceTemplate<CryptoPP::FileStore>::PumpMessages2(unsigned int&, bool)':
/usr/include/cryptopp/filters.h:765: undefined reference to `CryptoPP::DEFAULT_CHANNEL'
/usr/include/cryptopp/filters.h:765: undefined reference to `CryptoPP::BufferedTransformation::TransferMessagesTo2(CryptoPP::BufferedTransformation&, unsigned int&, std::string const&, bool)'
CMakeFiles/Chat.dir/src/EncryptorRSA.cpp.o: In function `CryptoPP::SourceTemplate<CryptoPP::FileStore>::PumpAll2(bool)':
/usr/include/cryptopp/filters.h:767: undefined reference to `CryptoPP::DEFAULT_CHANNEL'
/usr/include/cryptopp/filters.h:767: undefined reference to `CryptoPP::BufferedTransformation::TransferAllTo2(CryptoPP::BufferedTransformation&, std::string const&, bool)'
CMakeFiles/Chat.dir/src/EncryptorRSA.cpp.o: In function `CryptoPP::SourceTemplate<CryptoPP::FileStore>::SourceExhausted() const':
/usr/include/cryptopp/filters.h:769: undefined reference to `CryptoPP::BufferedTransformation::AnyRetrievable() const'
/usr/include/cryptopp/filters.h:769: undefined reference to `CryptoPP::BufferedTransformation::AnyMessages() const'
CMakeFiles/Chat.dir/src/EncryptorRSA.cpp.o: In function `CryptoPP::DL_EncryptionAlgorithm_Xor<CryptoPP::HMAC<CryptoPP::SHA1>, false>::SymmetricEncrypt(CryptoPP::RandomNumberGenerator&, unsigned char const*, unsigned char const*, unsigned long, unsigned char*, CryptoPP::NameValuePairs const&) const':
/usr/include/cryptopp/gfpcrypt.h:439: undefined reference to `CryptoPP::xorbuf(unsigned char*, unsigned char const*, unsigned char const*, unsigned long)'
/usr/include/cryptopp/gfpcrypt.h:441: undefined reference to `CryptoPP::HMAC_Base::Update(unsigned char const*, unsigned long)'
/usr/include/cryptopp/gfpcrypt.h:442: undefined reference to `CryptoPP::HMAC_Base::Update(unsigned char const*, unsigned long)'
CMakeFiles/Chat.dir/src/EncryptorRSA.cpp.o: In function `CryptoPP::DL_EncryptionAlgorithm_Xor<CryptoPP::HMAC<CryptoPP::SHA1>, false>::SymmetricDecrypt(unsigned char const*, unsigned char const*, unsigned long, unsigned char*, CryptoPP::NameValuePairs const&) const':
/usr/include/cryptopp/gfpcrypt.h:470: undefined reference to `CryptoPP::HMAC_Base::Update(unsigned char const*, unsigned long)'
/usr/include/cryptopp/gfpcrypt.h:471: undefined reference to `CryptoPP::HMAC_Base::Update(unsigned char const*, unsigned long)'
/usr/include/cryptopp/gfpcrypt.h:481: undefined reference to `CryptoPP::xorbuf(unsigned char*, unsigned char const*, unsigned char const*, unsigned long)'
CMakeFiles/Chat.dir/src/EncryptorRSA.cpp.o: In function `CryptoPP::DL_KeyAgreementAlgorithm_DH<CryptoPP::ECPPoint, CryptoPP::EnumToType<CryptoPP::CofactorMultiplicationOption, 0> >::AgreeWithEphemeralPrivateKey(CryptoPP::DL_GroupParameters<CryptoPP::ECPPoint> const&, CryptoPP::DL_FixedBasePrecomputation<CryptoPP::ECPPoint> const&, CryptoPP::Integer const&) const':
/usr/include/cryptopp/pubkey.h:1445: undefined reference to `CryptoPP::Integer::Integer(CryptoPP::Integer const&)'
CMakeFiles/Chat.dir/src/EncryptorRSA.cpp.o: In function `CryptoPP::DL_KeyAgreementAlgorithm_DH<CryptoPP::ECPPoint, CryptoPP::EnumToType<CryptoPP::CofactorMultiplicationOption, 0> >::AgreeWithStaticPrivateKey(CryptoPP::DL_GroupParameters<CryptoPP::ECPPoint> const&, CryptoPP::ECPPoint const&, bool, CryptoPP::Integer const&) const':
/usr/include/cryptopp/pubkey.h:1473: undefined reference to `CryptoPP::Integer::Integer(CryptoPP::Integer const&)'
/usr/include/cryptopp/pubkey.h:1473: undefined reference to `CryptoPP::Integer::Integer(CryptoPP::Integer const&)'
CMakeFiles/Chat.dir/src/EncryptorRSA.cpp.o: In function `CryptoPP::HMAC<CryptoPP::SHA1>::HMAC(unsigned char const*, unsigned long)':
/usr/include/cryptopp/hmac.h:48: undefined reference to `CryptoPP::g_nullNameValuePairs'
/usr/include/cryptopp/hmac.h:48: undefined reference to `CryptoPP::SimpleKeyingInterface::SetKey(unsigned char const*, unsigned long, CryptoPP::NameValuePairs const&)'
CMakeFiles/Chat.dir/src/EncryptorRSA.cpp.o: In function `CryptoPP::P1363_KDF2<CryptoPP::SHA1>::DeriveKey(unsigned char*, unsigned long, unsigned char const*, unsigned long, unsigned char const*, unsigned long)':
/usr/include/cryptopp/pubkey.h:506: undefined reference to `CryptoPP::P1363_MGF1KDF2_Common(CryptoPP::HashTransformation&, unsigned char*, unsigned long, unsigned char const*, unsigned long, unsigned char const*, unsigned long, bool, unsigned int)'
CMakeFiles/Chat.dir/src/EncryptorRSA.cpp.o: In function `CryptoPP::IteratedHashWithStaticTransform<unsigned int, CryptoPP::EnumToType<CryptoPP::ByteOrder, 1>, 64u, 20u, CryptoPP::SHA1, 0u, false>::Init()':
/usr/include/cryptopp/iterhash.h:90: undefined reference to `CryptoPP::SHA1::InitState(unsigned int*)'
CMakeFiles/Chat.dir/src/EncryptorRSA.cpp.o:(.rodata._ZTIN8CryptoPP16IteratedHashBaseIjNS_18HashTransformationEEE[_ZTIN8CryptoPP16IteratedHashBaseIjNS_18HashTransformationEEE]+0x10): undefined reference to `typeinfo for CryptoPP::HashTransformation'
CMakeFiles/Chat.dir/src/EncryptorRSA.cpp.o:(.rodata._ZTIN8CryptoPP25SimpleKeyingInterfaceImplINS_9HMAC_BaseENS_4HMACINS_4SHA1EEEEE[_ZTIN8CryptoPP25SimpleKeyingInterfaceImplINS_9HMAC_BaseENS_4HMACINS_4SHA1EEEEE]+0x10): undefined reference to `typeinfo for CryptoPP::HMAC_Base'
CMakeFiles/Chat.dir/src/EncryptorRSA.cpp.o: In function `CryptoPP::HashTransformation::HashTransformation(CryptoPP::HashTransformation const&)':
/usr/include/cryptopp/cryptlib.h:531: undefined reference to `vtable for CryptoPP::HashTransformation'
CMakeFiles/Chat.dir/src/EncryptorRSA.cpp.o: In function `CryptoPP::IteratedHashWithStaticTransform<unsigned int, CryptoPP::EnumToType<CryptoPP::ByteOrder, 1>, 64u, 20u, CryptoPP::SHA1, 0u, false>::HashEndianCorrectedBlock(unsigned int const*)':
/usr/include/cryptopp/iterhash.h:89: undefined reference to `CryptoPP::SHA1::Transform(unsigned int*, unsigned int const*)'
collect2: error: ld returned 1 exit status
CMakeFiles/Chat.dir/build.make:406: recipe for target 'Chat' failed
make[2]: *** [Chat] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/Chat.dir/all' failed
make[1]: *** [CMakeFiles/Chat.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
I performed the following after add_executable in my CMakeLists.txt to resolve the issue:
target_link_libraries(Chat /usr/lib/libcrypto++.a)