Error faced while running make command in TensorFlow Lite C++ ( Image Classification) video
Opened this issue · 0 comments
ajithkumarmcw commented
HI Karthick,
I followed your tutorial everything was working fine
installing bazel to cmake command in this video https://www.youtube.com/watch?v=oyWvLG8ilX4&list=PLYV_j9XEhvorTV-ClcNA2xUb5YsdUHgRX&index=6 but when i run make command to build the 05_TFLite_Imageclassification i face following error. could you kindly let me know why this error is caused
25%] Building CXX object CMakeFiles/TFLiteImageClassification.dir/main.cpp.o
[ 50%] Linking CXX executable TFLiteImageClassification
/usr/bin/ld: CMakeFiles/TFLiteImageClassification.dir/main.cpp.o: in function `main':
main.cpp:(.text+0x250): undefined reference to `tflite::DefaultErrorReporter()'
/usr/bin/ld: main.cpp:(.text+0x26c): undefined reference to `tflite::FlatBufferModel::BuildFromFile(char const*, tflite::ErrorReporter*)'
/usr/bin/ld: main.cpp:(.text+0x2c8): undefined reference to `tflite::ops::builtin::BuiltinOpResolver::BuiltinOpResolver()'
/usr/bin/ld: main.cpp:(.text+0x2f3): undefined reference to `tflite::InterpreterBuilder::InterpreterBuilder(tflite::FlatBufferModel const&, tflite::OpResolver const&)'
/usr/bin/ld: main.cpp:(.text+0x30c): undefined reference to `tflite::InterpreterBuilder::operator()(std::unique_ptr<tflite::Interpreter, std::default_delete<tflite::Interpreter> >*)'
/usr/bin/ld: main.cpp:(.text+0x31b): undefined reference to `tflite::InterpreterBuilder::~InterpreterBuilder()'
/usr/bin/ld: main.cpp:(.text+0x374): undefined reference to `tflite::Interpreter::AllocateTensors()'
/usr/bin/ld: main.cpp:(.text+0x3c3): undefined reference to `tflite::Interpreter::SetAllowFp16PrecisionForFp32(bool)'
/usr/bin/ld: main.cpp:(.text+0x3df): undefined reference to `tflite::Interpreter::SetNumThreads(int)'
/usr/bin/ld: main.cpp:(.text+0x4a7): undefined reference to `cv::Mat::Mat()'
/usr/bin/ld: main.cpp:(.text+0x4f1): undefined reference to `cv::imread(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)'
/usr/bin/ld: main.cpp:(.text+0x51b): undefined reference to `cv::Mat::empty() const'
/usr/bin/ld: main.cpp:(.text+0x5bf): undefined reference to `cv::resize(cv::_InputArray const&, cv::_OutputArray const&, cv::Size_<int>, double, double, int)'
/usr/bin/ld: main.cpp:(.text+0x5ec): undefined reference to `cv::Mat::total() const'
/usr/bin/ld: main.cpp:(.text+0x66f): undefined reference to `tflite::Interpreter::Invoke()'
/usr/bin/ld: main.cpp:(.text+0x91e): undefined reference to `cv::putText(cv::_InputOutputArray const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, cv::Point_<int>, int, double, cv::Scalar_<double>, int, int, bool)'
/usr/bin/ld: main.cpp:(.text+0xb9b): undefined reference to `cv::putText(cv::_InputOutputArray const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, cv::Point_<int>, int, double, cv::Scalar_<double>, int, int, bool)'
/usr/bin/ld: main.cpp:(.text+0xc2c): undefined reference to `cv::imshow(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, cv::_InputArray const&)'
/usr/bin/ld: main.cpp:(.text+0xc63): undefined reference to `cv::waitKey(int)'
/usr/bin/ld: main.cpp:(.text+0xc92): undefined reference to `cv::Mat::~Mat()'
/usr/bin/ld: main.cpp:(.text+0xca1): undefined reference to `cv::Mat::~Mat()'
/usr/bin/ld: main.cpp:(.text+0xcfe): undefined reference to `tflite::InterpreterBuilder::~InterpreterBuilder()'
/usr/bin/ld: main.cpp:(.text+0xef0): undefined reference to `cv::Mat::~Mat()'
/usr/bin/ld: main.cpp:(.text+0xeff): undefined reference to `cv::Mat::~Mat()'
/usr/bin/ld: CMakeFiles/TFLiteImageClassification.dir/main.cpp.o: in function `tflite::MutableOpResolver::~MutableOpResolver()':
main.cpp:(.text._ZN6tflite17MutableOpResolverD2Ev[_ZN6tflite17MutableOpResolverD5Ev]+0x13): undefined reference to `vtable for tflite::MutableOpResolver'
/usr/bin/ld: CMakeFiles/TFLiteImageClassification.dir/main.cpp.o: in function `tflite::ops::builtin::BuiltinOpResolver::~BuiltinOpResolver()':
main.cpp:(.text._ZN6tflite3ops7builtin17BuiltinOpResolverD2Ev[_ZN6tflite3ops7builtin17BuiltinOpResolverD5Ev]+0x13): undefined reference to `vtable for tflite::ops::builtin::BuiltinOpResolver'
/usr/bin/ld: CMakeFiles/TFLiteImageClassification.dir/main.cpp.o: in function `std::default_delete<tflite::FlatBufferModel>::operator()(tflite::FlatBufferModel*) const':
main.cpp:(.text._ZNKSt14default_deleteIN6tflite15FlatBufferModelEEclEPS1_[_ZNKSt14default_deleteIN6tflite15FlatBufferModelEEclEPS1_]+0x22): undefined reference to `tflite::FlatBufferModel::~FlatBufferModel()'
/usr/bin/ld: CMakeFiles/TFLiteImageClassification.dir/main.cpp.o: in function `std::default_delete<tflite::Interpreter>::operator()(tflite::Interpreter*) const':
main.cpp:(.text._ZNKSt14default_deleteIN6tflite11InterpreterEEclEPS1_[_ZNKSt14default_deleteIN6tflite11InterpreterEEclEPS1_]+0x22): undefined reference to `tflite::Interpreter::~Interpreter()'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/TFLiteImageClassification.dir/build.make:97: TFLiteImageClassification] Error 1
make[1]: *** [CMakeFiles/Makefile2:85: CMakeFiles/TFLiteImageClassification.dir/all] Error 2
make: *** [Makefile:91: all] Error 2