undefined reference to `cv::Mat::~Mat()' - c++

I want to run through this demo, https://github.com/sea2357/HeDemo
I installed OpencV4.6 and made sure it was compiled and installed successfully, Since it can display images using g++ command line.
enter image description here
But when I was compiling the HeDemo project, I got an error
/home/caesar/code/HeDemo/knn.cpp:39: undefined reference to cv::Mat::Mat()' ... /usr/bin/ld: /usr/local/include/opencv4/opencv2/core/mat.hpp:3563: undefined reference to cv::Mat::~Mat()'
====================[ Build | main | Debug ]====================================
/home/caesar/clion-2020.1.3/bin/cmake/linux/bin/cmake --build /home/caesar/code/HeDemo/cmake-build-debug --target main -- -j 8
gmake[1]: Entering directory '/home/caesar/code/HeDemo/cmake-build-debug'
gmake[2]: Entering directory '/home/caesar/code/HeDemo/cmake-build-debug'
gmake[3]: Entering directory '/home/caesar/code/HeDemo/cmake-build-debug'
gmake[3]: Leaving directory '/home/caesar/code/HeDemo/cmake-build-debug'
gmake[3]: Entering directory '/home/caesar/code/HeDemo/cmake-build-debug'
[ 33%] Linking CXX executable main
/usr/bin/ld: CMakeFiles/main.dir/knn.cpp.o: in function `KNN::read_mnist_image(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, unsigned long)':
/home/caesar/code/HeDemo/knn.cpp:39: undefined reference to `cv::Mat::Mat()'
/usr/bin/ld: /home/caesar/code/HeDemo/knn.cpp:57: undefined reference to `cv::Mat::zeros(int, int, int)'
/usr/bin/ld: /home/caesar/code/HeDemo/knn.cpp:79: undefined reference to `cv::Mat::~Mat()'
/usr/bin/ld: CMakeFiles/main.dir/knn.cpp.o: in function `KNN::read_mnist_label(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, unsigned long)':
/home/caesar/code/HeDemo/knn.cpp:86: undefined reference to `cv::Mat::Mat()'
/usr/bin/ld: /home/caesar/code/HeDemo/knn.cpp:99: undefined reference to `cv::Mat::zeros(int, int, int)'
/usr/bin/ld: /home/caesar/code/HeDemo/knn.cpp:116: undefined reference to `cv::Mat::~Mat()'
/usr/bin/ld: CMakeFiles/main.dir/knn.cpp.o: in function `KNN::test(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned long)':
/home/caesar/code/HeDemo/knn.cpp:148: undefined reference to `cv::Mat::~Mat()'
/usr/bin/ld: /home/caesar/code/HeDemo/knn.cpp:161: undefined reference to `cv::Mat::~Mat()'
/usr/bin/ld: /home/caesar/code/HeDemo/knn.cpp:161: undefined reference to `cv::Mat::~Mat()'
/usr/bin/ld: /home/caesar/code/HeDemo/knn.cpp:161: undefined reference to `cv::Mat::~Mat()'
/usr/bin/ld: CMakeFiles/main.dir/knn.cpp.o:/home/caesar/code/HeDemo/knn.cpp:161: more undefined references to `cv::Mat::~Mat()' follow
/usr/bin/ld: CMakeFiles/main.dir/knn.cpp.o: in function `KNN::recognize(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&, unsigned long)':
/home/caesar/code/HeDemo/knn.cpp:171: undefined reference to `cv::imread(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)'
/usr/bin/ld: /home/caesar/code/HeDemo/knn.cpp:177: undefined reference to `cv::Mat::Mat()'
/usr/bin/ld: /home/caesar/code/HeDemo/knn.cpp:178: undefined reference to `cv::resize(cv::_InputArray const&, cv::_OutputArray const&, cv::Size_<int>, double, double, int)'
/usr/bin/ld: /home/caesar/code/HeDemo/knn.cpp:179: undefined reference to `cv::Mat::zeros(int, int, int)'
/usr/bin/ld: /home/caesar/code/HeDemo/knn.cpp:180: undefined reference to `cv::threshold(cv::_InputArray const&, cv::_OutputArray const&, double, double, int)'
/usr/bin/ld: /home/caesar/code/HeDemo/knn.cpp:181: undefined reference to `cv::Mat::zeros(int, int, int)'
/usr/bin/ld: /home/caesar/code/HeDemo/knn.cpp:218: undefined reference to `cv::Mat::~Mat()'
/usr/bin/ld: /home/caesar/code/HeDemo/knn.cpp:218: undefined reference to `cv::Mat::~Mat()'
/usr/bin/ld: /home/caesar/code/HeDemo/knn.cpp:218: undefined reference to `cv::Mat::~Mat()'
/usr/bin/ld: /home/caesar/code/HeDemo/knn.cpp:218: undefined reference to `cv::Mat::~Mat()'
/usr/bin/ld: /home/caesar/code/HeDemo/knn.cpp:218: undefined reference to `cv::Mat::~Mat()'
/usr/bin/ld: CMakeFiles/main.dir/knn.cpp.o:/home/caesar/code/HeDemo/knn.cpp:218: more undefined references to `cv::Mat::~Mat()' follow
/usr/bin/ld: CMakeFiles/main.dir/knn.cpp.o: in function `KNN::ciphertext_recognize(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&, unsigned long)':
/home/caesar/code/HeDemo/knn.cpp:255: undefined reference to `cv::imread(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)'
/usr/bin/ld: /home/caesar/code/HeDemo/knn.cpp:261: undefined reference to `cv::Mat::Mat()'
/usr/bin/ld: /home/caesar/code/HeDemo/knn.cpp:262: undefined reference to `cv::resize(cv::_InputArray const&, cv::_OutputArray const&, cv::Size_<int>, double, double, int)'
/usr/bin/ld: /home/caesar/code/HeDemo/knn.cpp:263: undefined reference to `cv::Mat::zeros(int, int, int)'
/usr/bin/ld: /home/caesar/code/HeDemo/knn.cpp:264: undefined reference to `cv::threshold(cv::_InputArray const&, cv::_OutputArray const&, double, double, int)'
/usr/bin/ld: /home/caesar/code/HeDemo/knn.cpp:265: undefined reference to `cv::Mat::zeros(int, int, int)'
/usr/bin/ld: /home/caesar/code/HeDemo/knn.cpp:355: undefined reference to `cv::Mat::~Mat()'
/usr/bin/ld: /home/caesar/code/HeDemo/knn.cpp:355: undefined reference to `cv::Mat::~Mat()'
/usr/bin/ld: /home/caesar/code/HeDemo/knn.cpp:355: undefined reference to `cv::Mat::~Mat()'
/usr/bin/ld: /home/caesar/code/HeDemo/knn.cpp:355: undefined reference to `cv::Mat::~Mat()'
/usr/bin/ld: /home/caesar/code/HeDemo/knn.cpp:355: undefined reference to `cv::Mat::~Mat()'
/usr/bin/ld: CMakeFiles/main.dir/knn.cpp.o:/home/caesar/code/HeDemo/knn.cpp:355: more undefined references to `cv::Mat::~Mat()' follow
/usr/bin/ld: CMakeFiles/main.dir/knn.cpp.o: in function `KNN::ciphertext_recognize_compressed(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&)':
/home/caesar/code/HeDemo/knn.cpp:393: undefined reference to `cv::imread(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)'
/usr/bin/ld: /home/caesar/code/HeDemo/knn.cpp:399: undefined reference to `cv::Mat::Mat()'
/usr/bin/ld: /home/caesar/code/HeDemo/knn.cpp:400: undefined reference to `cv::resize(cv::_InputArray const&, cv::_OutputArray const&, cv::Size_<int>, double, double, int)'
/usr/bin/ld: /home/caesar/code/HeDemo/knn.cpp:401: undefined reference to `cv::Mat::zeros(int, int, int)'
/usr/bin/ld: /home/caesar/code/HeDemo/knn.cpp:402: undefined reference to `cv::threshold(cv::_InputArray const&, cv::_OutputArray const&, double, double, int)'
/usr/bin/ld: /home/caesar/code/HeDemo/knn.cpp:403: undefined reference to `cv::Mat::zeros(int, int, int)'
/usr/bin/ld: /home/caesar/code/HeDemo/knn.cpp:506: undefined reference to `cv::Mat::~Mat()'
/usr/bin/ld: /home/caesar/code/HeDemo/knn.cpp:506: undefined reference to `cv::Mat::~Mat()'
/usr/bin/ld: /home/caesar/code/HeDemo/knn.cpp:506: undefined reference to `cv::Mat::~Mat()'
/usr/bin/ld: /home/caesar/code/HeDemo/knn.cpp:506: undefined reference to `cv::Mat::~Mat()'
/usr/bin/ld: /home/caesar/code/HeDemo/knn.cpp:506: undefined reference to `cv::Mat::~Mat()'
/usr/bin/ld: CMakeFiles/main.dir/knn.cpp.o:/home/caesar/code/HeDemo/knn.cpp:506: more undefined references to `cv::Mat::~Mat()' follow
/usr/bin/ld: CMakeFiles/main.dir/knn.cpp.o: in function `cv::Mat::row(int) const':
/usr/local/include/opencv4/opencv2/core/mat.inl.hpp:597: undefined reference to `cv::Mat::Mat(cv::Mat const&, cv::Range const&, cv::Range const&)'
/usr/bin/ld: CMakeFiles/main.dir/knn.cpp.o: in function `cv::MatExpr::operator cv::Mat() const':
/usr/local/include/opencv4/opencv2/core/mat.inl.hpp:3077: undefined reference to `cv::Mat::Mat()'
/usr/bin/ld: /usr/local/include/opencv4/opencv2/core/mat.inl.hpp:3080: undefined reference to `cv::Mat::~Mat()'
/usr/bin/ld: CMakeFiles/main.dir/knn.cpp.o: in function `cv::MatExpr::~MatExpr()':
/usr/local/include/opencv4/opencv2/core/mat.hpp:3563: undefined reference to `cv::Mat::~Mat()'
/usr/bin/ld: /usr/local/include/opencv4/opencv2/core/mat.hpp:3563: undefined reference to `cv::Mat::~Mat()'
/usr/bin/ld: /usr/local/include/opencv4/opencv2/core/mat.hpp:3563: undefined reference to `cv::Mat::~Mat()'
collect2: error: ld returned 1 exit status
gmake[3]: *** [CMakeFiles/main.dir/build.make:101: main] Error 1
gmake[3]: Leaving directory '/home/caesar/code/HeDemo/cmake-build-debug'
gmake[2]: *** [CMakeFiles/Makefile2:76: CMakeFiles/main.dir/all] Error 2
gmake[2]: Leaving directory '/home/caesar/code/HeDemo/cmake-build-debug'
gmake[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/main.dir/rule] Error 2
gmake[1]: Leaving directory '/home/caesar/code/HeDemo/cmake-build-debug'
gmake: *** [Makefile:118: main] Error 2
I can run through the demo showing the images, so I think cmakelist.txt is not written properly
The include directory in cmakelist.txt is configured
So I think maybe the dynamic library is not set up properly
But I do not know how to write the right, check some data did not solve

Related

unable to run mpicc in linux

My code was working fine on windows, now that I am trying to compile on ubuntu 20.4; I am getting this error; I am copying part of the error as there are a lot:
after runing : mpicc C.cpp -o C
usr/bin/ld: C.cpp:(.text._ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPcEEvT_S7_St20forward_iterator_tag[_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPcEEvT_S7_St20forward_iterator_tag]+0xb8): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_capacity(unsigned long)'
/usr/bin/ld: C.cpp:(.text._ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPcEEvT_S7_St20forward_iterator_tag[_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPcEEvT_S7_St20forward_iterator_tag]+0xc4): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_data() const'
/usr/bin/ld: C.cpp:(.text._ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPcEEvT_S7_St20forward_iterator_tag[_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPcEEvT_S7_St20forward_iterator_tag]+0xda): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_S_copy_chars(char*, char*, char*)'
/usr/bin/ld: C.cpp:(.text._ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPcEEvT_S7_St20forward_iterator_tag[_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPcEEvT_S7_St20forward_iterator_tag]+0xed): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_set_length(unsigned long)'
/usr/bin/ld: C.cpp:(.text._ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPcEEvT_S7_St20forward_iterator_tag[_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPcEEvT_S7_St20forward_iterator_tag]+0x10b): undefined reference to `__cxa_begin_catch'
/usr/bin/ld: C.cpp:(.text._ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPcEEvT_S7_St20forward_iterator_tag[_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPcEEvT_S7_St20forward_iterator_tag]+0x117): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_dispose()'
/usr/bin/ld: C.cpp:(.text._ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPcEEvT_S7_St20forward_iterator_tag[_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPcEEvT_S7_St20forward_iterator_tag]+0x11c): undefined reference to `__cxa_rethrow'
/usr/bin/ld: C.cpp:(.text._ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPcEEvT_S7_St20forward_iterator_tag[_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPcEEvT_S7_St20forward_iterator_tag]+0x128): undefined reference to `__cxa_end_catch'
/usr/bin/ld: /tmp/ccNx3sbm.o: in function `__gnu_cxx::new_allocator<int>::deallocate(int*, unsigned long)':
C.cpp:(.text._ZN9__gnu_cxx13new_allocatorIiE10deallocateEPim[_ZN9__gnu_cxx13new_allocatorIiE10deallocateEPim]+0x20): undefined reference to `operator delete(void*)'
/usr/bin/ld: /tmp/ccNx3sbm.o: in function `__gnu_cxx::new_allocator<int>::allocate(unsigned long, void const*)':
C.cpp:(.text._ZN9__gnu_cxx13new_allocatorIiE8allocateEmPKv[_ZN9__gnu_cxx13new_allocatorIiE8allocateEmPKv]+0x30): undefined reference to `std::__throw_bad_alloc()'
/usr/bin/ld: C.cpp:(.text._ZN9__gnu_cxx13new_allocatorIiE8allocateEmPKv[_ZN9__gnu_cxx13new_allocatorIiE8allocateEmPKv]+0x40): undefined reference to `operator new(unsigned long)'
/usr/bin/ld: /tmp/ccNx3sbm.o:(.data.rel.ro._ZTVN3MPI3WinE[_ZTVN3MPI3WinE]+0x48): undefined reference to `MPI::Win::Free()'
/usr/bin/ld: /tmp/ccNx3sbm.o: in function `MPI::Intercomm::~Intercomm()':
C.cpp:(.text._ZN3MPI9IntercommD0Ev[_ZN3MPI9IntercommD5Ev]+0x29): undefined reference to `operator delete(void*, unsigned long)'
/usr/bin/ld: /tmp/ccNx3sbm.o: in function `MPI::Graphcomm::~Graphcomm()':
C.cpp:(.text._ZN3MPI9GraphcommD0Ev[_ZN3MPI9GraphcommD5Ev]+0x29): undefined reference to `operator delete(void*, unsigned long)'
/usr/bin/ld: /tmp/ccNx3sbm.o: in function `MPI::Cartcomm::~Cartcomm()':
when I check mpirun --version: I get this : mpirun (Open MPI) 4.0.3
This error:
usr/bin/ld: C.cpp:(.text._ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPcEEvT_S7_St20forward_iterator_tag[_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPcEEvT_S7_St20forward_iterator_tag]+0xb8): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_capacity(unsigned long)'
/usr/bin/ld: C.cpp:(.text._ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPcEEvT_S7_St20forward_iterator_tag[_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPcEEvT_S7_St20forward_iterator_tag]+0xc4): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_data() const'
/usr/bin/ld: C.cpp:(.text._ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPcEEvT_S7_St20forward_iterator_tag[_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPcEEvT_S7_St20forward_iterator_tag]+0xda): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_S_copy_chars(char*, char*, char*)'
/usr/bin/ld: C.cpp:(.text._ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPcEEvT_S7_St20forward_iterator_tag[_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPcEEvT_S7_St20forward_iterator_tag]+0xed): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_set_length(unsigned long)'
/usr/bin/ld: C.cpp:(.text._ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPcEEvT_S7_St20forward_iterator_tag[_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPcEEvT_S7_St20forward_iterator_tag]+0x10b): undefined reference to `__cxa_begin_catch'
/usr/bin/ld: C.cpp:(.text._ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPcEEvT_S7_St20forward_iterator_tag[_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPcEEvT_S7_St20forward_iterator_tag]+0x117): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_dispose()'
/usr/bin/ld: C.cpp:(.text._ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPcEEvT_S7_St20forward_iterator_tag[_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPcEEvT_S7_St20forward_iterator_tag]+0x11c): undefined reference to `__cxa_rethrow'
/usr/bin/ld: C.cpp:(.text._ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPcEEvT_S7_St20forward_iterator_tag[_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPcEEvT_S7_St20forward_iterator_tag]+0x128): undefined reference to `__cxa_end_catch'
/usr/bin/ld: /tmp/ccNx3sbm.o: in function `__gnu_cxx::new_allocator<int>::deallocate(int*, unsigned long)':
C.cpp:(.text._ZN9__gnu_cxx13new_allocatorIiE10deallocateEPim[_ZN9__gnu_cxx13new_allocatorIiE10deallocateEPim]+0x20): undefined reference to `operator delete(void*)'
/usr/bin/ld: /tmp/ccNx3sbm.o: in function `__gnu_cxx::new_allocator<int>::allocate(unsigned long, void const*)':
C.cpp:(.text._ZN9__gnu_cxx13new_allocatorIiE8allocateEmPKv[_ZN9__gnu_cxx13new_allocatorIiE8allocateEmPKv]+0x30): undefined reference to `std::__throw_bad_alloc()'
/usr/bin/ld: C.cpp:(.text._ZN9__gnu_cxx13new_allocatorIiE8allocateEmPKv[_ZN9__gnu_cxx13new_allocatorIiE8allocateEmPKv]+0x40): undefined reference to `operator new(unsigned long)'
/usr/bin/ld: /tmp/ccNx3sbm.o:(.data.rel.ro._ZTVN3MPI3WinE[_ZTVN3MPI3WinE]+0x48): undefined reference to `MPI::Win::Free()'
/usr/bin/ld: /tmp/ccNx3sbm.o: in function `MPI::Intercomm::~Intercomm()':
C.cpp:(.text._ZN3MPI9IntercommD0Ev[_ZN3MPI9IntercommD5Ev]+0x29): undefined reference to `operator delete(void*, unsigned long)'
/usr/bin/ld: /tmp/ccNx3sbm.o: in function `MPI::Graphcomm::~Graphcomm()':
C.cpp:(.text._ZN3MPI9GraphcommD0Ev[_ZN3MPI9GraphcommD5Ev]+0x29): undefined reference to `operator delete(void*, unsigned long)'
/usr/bin/ld: /tmp/ccNx3sbm.o: in function `MPI::Cartcomm::~Cartcomm()':
Because you are compiling with mpicc:
Compiles and links MPI programs written in C
but you should be using in this case mpic++
mpic++ -- Open MPI C++ wrapper compiler

Compiler not finding jpeg and png libraries

I have downloaded and installed this C++ package for plotting and visulisation https://github.com/alandefreitas/matplotplusplus. I have sussessfully linked to it in my CMake file and have no linking errors when including #include <matplot/matplot.h>. However, whenever I use any functions from the library matplot.h I get the following error at compilation.
/usr/bin/ld: /usr/local/lib/libmatplot.a(common.cpp.o): in function `cimg_library::CImg<unsigned char>::_cimg_jpeg_error_exit(jpeg_common_struct*)':
common.cpp:(.text._ZN12cimg_library4CImgIhE21_cimg_jpeg_error_exitEP18jpeg_common_struct[_ZN12cimg_library4CImgIhE21_cimg_jpeg_error_exitEP18jpeg_common_struct]+0x1e): undefined reference to `jpeg_destroy'
/usr/bin/ld: /usr/local/lib/libmatplot.a(common.cpp.o): in function `cimg_library::CImg<unsigned char>::_save_jpeg(_IO_FILE*, char const*, unsigned int) const':
common.cpp:(.text._ZNK12cimg_library4CImgIhE10_save_jpegEP8_IO_FILEPKcj[_ZNK12cimg_library4CImgIhE10_save_jpegEP8_IO_FILEPKcj]+0x12b): undefined reference to `jpeg_std_error'
/usr/bin/ld: common.cpp:(.text._ZNK12cimg_library4CImgIhE10_save_jpegEP8_IO_FILEPKcj[_ZNK12cimg_library4CImgIhE10_save_jpegEP8_IO_FILEPKcj]+0x152): undefined reference to `jpeg_CreateCompress'
/usr/bin/ld: common.cpp:(.text._ZNK12cimg_library4CImgIhE10_save_jpegEP8_IO_FILEPKcj[_ZNK12cimg_library4CImgIhE10_save_jpegEP8_IO_FILEPKcj]+0x16d): undefined reference to `jpeg_stdio_dest'
/usr/bin/ld: common.cpp:(.text._ZNK12cimg_library4CImgIhE10_save_jpegEP8_IO_FILEPKcj[_ZNK12cimg_library4CImgIhE10_save_jpegEP8_IO_FILEPKcj]+0x198): undefined reference to `jpeg_set_defaults'
/usr/bin/ld: common.cpp:(.text._ZNK12cimg_library4CImgIhE10_save_jpegEP8_IO_FILEPKcj[_ZNK12cimg_library4CImgIhE10_save_jpegEP8_IO_FILEPKcj]+0x1b2): undefined reference to `jpeg_set_quality'
/usr/bin/ld: common.cpp:(.text._ZNK12cimg_library4CImgIhE10_save_jpegEP8_IO_FILEPKcj[_ZNK12cimg_library4CImgIhE10_save_jpegEP8_IO_FILEPKcj]+0x1c6): undefined reference to `jpeg_start_compress'
/usr/bin/ld: common.cpp:(.text._ZNK12cimg_library4CImgIhE10_save_jpegEP8_IO_FILEPKcj[_ZNK12cimg_library4CImgIhE10_save_jpegEP8_IO_FILEPKcj]+0x2cf): undefined reference to `jpeg_write_scanlines'
/usr/bin/ld: common.cpp:(.text._ZNK12cimg_library4CImgIhE10_save_jpegEP8_IO_FILEPKcj[_ZNK12cimg_library4CImgIhE10_save_jpegEP8_IO_FILEPKcj]+0x2ed): undefined reference to `jpeg_finish_compress'
/usr/bin/ld: common.cpp:(.text._ZNK12cimg_library4CImgIhE10_save_jpegEP8_IO_FILEPKcj[_ZNK12cimg_library4CImgIhE10_save_jpegEP8_IO_FILEPKcj]+0x302): undefined reference to `jpeg_destroy_compress'
/usr/bin/ld: /usr/local/lib/libmatplot.a(common.cpp.o): in function `cimg_library::CImg<unsigned char>::_save_png(_IO_FILE*, char const*, unsigned int) const':
common.cpp:(.text._ZNK12cimg_library4CImgIhE9_save_pngEP8_IO_FILEPKcj[_ZNK12cimg_library4CImgIhE9_save_pngEP8_IO_FILEPKcj]+0x2f4): undefined reference to `png_create_write_struct'
/usr/bin/ld: common.cpp:(.text._ZNK12cimg_library4CImgIhE9_save_pngEP8_IO_FILEPKcj[_ZNK12cimg_library4CImgIhE9_save_pngEP8_IO_FILEPKcj]+0x309): undefined reference to `png_create_info_struct'
/usr/bin/ld: common.cpp:(.text._ZNK12cimg_library4CImgIhE9_save_pngEP8_IO_FILEPKcj[_ZNK12cimg_library4CImgIhE9_save_pngEP8_IO_FILEPKcj]+0x32b): undefined reference to `png_set_longjmp_fn'
/usr/bin/ld: common.cpp:(.text._ZNK12cimg_library4CImgIhE9_save_pngEP8_IO_FILEPKcj[_ZNK12cimg_library4CImgIhE9_save_pngEP8_IO_FILEPKcj]+0x34f): undefined reference to `png_destroy_write_struct'
/usr/bin/ld: common.cpp:(.text._ZNK12cimg_library4CImgIhE9_save_pngEP8_IO_FILEPKcj[_ZNK12cimg_library4CImgIhE9_save_pngEP8_IO_FILEPKcj]+0x409): undefined reference to `png_init_io'
/usr/bin/ld: common.cpp:(.text._ZNK12cimg_library4CImgIhE9_save_pngEP8_IO_FILEPKcj[_ZNK12cimg_library4CImgIhE9_save_pngEP8_IO_FILEPKcj]+0x474): undefined reference to `png_set_IHDR'
/usr/bin/ld: common.cpp:(.text._ZNK12cimg_library4CImgIhE9_save_pngEP8_IO_FILEPKcj[_ZNK12cimg_library4CImgIhE9_save_pngEP8_IO_FILEPKcj]+0x485): undefined reference to `png_write_info'
/usr/bin/ld: common.cpp:(.text._ZNK12cimg_library4CImgIhE9_save_pngEP8_IO_FILEPKcj[_ZNK12cimg_library4CImgIhE9_save_pngEP8_IO_FILEPKcj]+0xc36): undefined reference to `png_write_image'
/usr/bin/ld: common.cpp:(.text._ZNK12cimg_library4CImgIhE9_save_pngEP8_IO_FILEPKcj[_ZNK12cimg_library4CImgIhE9_save_pngEP8_IO_FILEPKcj]+0xc43): undefined reference to `png_write_end'
/usr/bin/ld: common.cpp:(.text._ZNK12cimg_library4CImgIhE9_save_pngEP8_IO_FILEPKcj[_ZNK12cimg_library4CImgIhE9_save_pngEP8_IO_FILEPKcj]+0xc50): undefined reference to `png_destroy_write_struct'
/usr/bin/ld: common.cpp:(.text._ZNK12cimg_library4CImgIhE9_save_pngEP8_IO_FILEPKcj[_ZNK12cimg_library4CImgIhE9_save_pngEP8_IO_FILEPKcj]+0x1830): undefined reference to `png_destroy_write_struct'
/usr/bin/ld: /usr/local/lib/libmatplot.a(common.cpp.o): in function `cimg_library::CImg<unsigned char>::save_cimg(char const*, bool) const':
common.cpp:(.text._ZNK12cimg_library4CImgIhE9save_cimgEPKcb[_ZNK12cimg_library4CImgIhE9save_cimgEPKcb]+0x3bb): undefined reference to `compress'
/usr/bin/ld: /usr/local/lib/libmatplot.a(common.cpp.o): in function `cimg_library::CImg<unsigned char>::_load_png(_IO_FILE*, char const*, unsigned int*)':
common.cpp:(.text._ZN12cimg_library4CImgIhE9_load_pngEP8_IO_FILEPKcPj[_ZN12cimg_library4CImgIhE9_load_pngEP8_IO_FILEPKcPj]+0x88): undefined reference to `png_sig_cmp'
/usr/bin/ld: common.cpp:(.text._ZN12cimg_library4CImgIhE9_load_pngEP8_IO_FILEPKcPj[_ZN12cimg_library4CImgIhE9_load_pngEP8_IO_FILEPKcPj]+0xa2): undefined reference to `png_create_read_struct'
/usr/bin/ld: common.cpp:(.text._ZN12cimg_library4CImgIhE9_load_pngEP8_IO_FILEPKcPj[_ZN12cimg_library4CImgIhE9_load_pngEP8_IO_FILEPKcPj]+0xb7): undefined reference to `png_create_info_struct'
/usr/bin/ld: common.cpp:(.text._ZN12cimg_library4CImgIhE9_load_pngEP8_IO_FILEPKcPj[_ZN12cimg_library4CImgIhE9_load_pngEP8_IO_FILEPKcPj]+0xcd): undefined reference to `png_create_info_struct'
/usr/bin/ld: common.cpp:(.text._ZN12cimg_library4CImgIhE9_load_pngEP8_IO_FILEPKcPj[_ZN12cimg_library4CImgIhE9_load_pngEP8_IO_FILEPKcPj]+0xef): undefined reference to `png_set_longjmp_fn'
/usr/bin/ld: common.cpp:(.text._ZN12cimg_library4CImgIhE9_load_pngEP8_IO_FILEPKcPj[_ZN12cimg_library4CImgIhE9_load_pngEP8_IO_FILEPKcPj]+0x14a): undefined reference to `png_destroy_read_struct'
/usr/bin/ld: common.cpp:(.text._ZN12cimg_library4CImgIhE9_load_pngEP8_IO_FILEPKcPj[_ZN12cimg_library4CImgIhE9_load_pngEP8_IO_FILEPKcPj]+0x1c9): undefined reference to `png_init_io'
/usr/bin/ld: common.cpp:(.text._ZN12cimg_library4CImgIhE9_load_pngEP8_IO_FILEPKcPj[_ZN12cimg_library4CImgIhE9_load_pngEP8_IO_FILEPKcPj]+0x1d7): undefined reference to `png_set_sig_bytes'
/usr/bin/ld: common.cpp:(.text._ZN12cimg_library4CImgIhE9_load_pngEP8_IO_FILEPKcPj[_ZN12cimg_library4CImgIhE9_load_pngEP8_IO_FILEPKcPj]+0x1e4): undefined reference to `png_read_info'
/usr/bin/ld: common.cpp:(.text._ZN12cimg_library4CImgIhE9_load_pngEP8_IO_FILEPKcPj[_ZN12cimg_library4CImgIhE9_load_pngEP8_IO_FILEPKcPj]+0x20e): undefined reference to `png_get_IHDR'
/usr/bin/ld: common.cpp:(.text._ZN12cimg_library4CImgIhE9_load_pngEP8_IO_FILEPKcPj[_ZN12cimg_library4CImgIhE9_load_pngEP8_IO_FILEPKcPj]+0x252): undefined reference to `png_get_valid'
/usr/bin/ld: common.cpp:(.text._ZN12cimg_library4CImgIhE9_load_pngEP8_IO_FILEPKcPj[_ZN12cimg_library4CImgIhE9_load_pngEP8_IO_FILEPKcPj]+0x280): undefined reference to `png_set_filler'
/usr/bin/ld: common.cpp:(.text._ZN12cimg_library4CImgIhE9_load_pngEP8_IO_FILEPKcPj[_ZN12cimg_library4CImgIhE9_load_pngEP8_IO_FILEPKcPj]+0x28d): undefined reference to `png_read_update_info'
/usr/bin/ld: common.cpp:(.text._ZN12cimg_library4CImgIhE9_load_pngEP8_IO_FILEPKcPj[_ZN12cimg_library4CImgIhE9_load_pngEP8_IO_FILEPKcPj]+0x2c2): undefined reference to `png_destroy_read_struct'
/usr/bin/ld: common.cpp:(.text._ZN12cimg_library4CImgIhE9_load_pngEP8_IO_FILEPKcPj[_ZN12cimg_library4CImgIhE9_load_pngEP8_IO_FILEPKcPj]+0x369): undefined reference to `png_set_expand_gray_1_2_4_to_8'
/usr/bin/ld: common.cpp:(.text._ZN12cimg_library4CImgIhE9_load_pngEP8_IO_FILEPKcPj[_ZN12cimg_library4CImgIhE9_load_pngEP8_IO_FILEPKcPj]+0x389): undefined reference to `png_set_gray_to_rgb'
/usr/bin/ld: common.cpp:(.text._ZN12cimg_library4CImgIhE9_load_pngEP8_IO_FILEPKcPj[_ZN12cimg_library4CImgIhE9_load_pngEP8_IO_FILEPKcPj]+0x3a9): undefined reference to `png_set_tRNS_to_alpha'
/usr/bin/ld: common.cpp:(.text._ZN12cimg_library4CImgIhE9_load_pngEP8_IO_FILEPKcPj[_ZN12cimg_library4CImgIhE9_load_pngEP8_IO_FILEPKcPj]+0x41f): undefined reference to `png_read_image'
/usr/bin/ld: common.cpp:(.text._ZN12cimg_library4CImgIhE9_load_pngEP8_IO_FILEPKcPj[_ZN12cimg_library4CImgIhE9_load_pngEP8_IO_FILEPKcPj]+0x42c): undefined reference to `png_read_end'
/usr/bin/ld: common.cpp:(.text._ZN12cimg_library4CImgIhE9_load_pngEP8_IO_FILEPKcPj[_ZN12cimg_library4CImgIhE9_load_pngEP8_IO_FILEPKcPj]+0x461): undefined reference to `png_destroy_read_struct'
/usr/bin/ld: common.cpp:(.text._ZN12cimg_library4CImgIhE9_load_pngEP8_IO_FILEPKcPj[_ZN12cimg_library4CImgIhE9_load_pngEP8_IO_FILEPKcPj]+0x4f1): undefined reference to `png_set_palette_to_rgb'
/usr/bin/ld: common.cpp:(.text._ZN12cimg_library4CImgIhE9_load_pngEP8_IO_FILEPKcPj[_ZN12cimg_library4CImgIhE9_load_pngEP8_IO_FILEPKcPj]+0x683): undefined reference to `png_destroy_read_struct'
/usr/bin/ld: common.cpp:(.text._ZN12cimg_library4CImgIhE9_load_pngEP8_IO_FILEPKcPj[_ZN12cimg_library4CImgIhE9_load_pngEP8_IO_FILEPKcPj]+0x84a): undefined reference to `png_destroy_read_struct'
/usr/bin/ld: common.cpp:(.text._ZN12cimg_library4CImgIhE9_load_pngEP8_IO_FILEPKcPj[_ZN12cimg_library4CImgIhE9_load_pngEP8_IO_FILEPKcPj]+0x9d3): undefined reference to `png_destroy_read_struct'
/usr/bin/ld: /usr/local/lib/libmatplot.a(common.cpp.o): in function `cimg_library::CImgList<unsigned char>::_load_cimg(_IO_FILE*, char const*)':
common.cpp:(.text._ZN12cimg_library8CImgListIhE10_load_cimgEP8_IO_FILEPKc[_ZN12cimg_library8CImgListIhE10_load_cimgEP8_IO_FILEPKc]+0x404): undefined reference to `uncompress'
/usr/bin/ld: common.cpp:(.text._ZN12cimg_library8CImgListIhE10_load_cimgEP8_IO_FILEPKc[_ZN12cimg_library8CImgListIhE10_load_cimgEP8_IO_FILEPKc]+0x70c): undefined reference to `uncompress'
/usr/bin/ld: common.cpp:(.text._ZN12cimg_library8CImgListIhE10_load_cimgEP8_IO_FILEPKc[_ZN12cimg_library8CImgListIhE10_load_cimgEP8_IO_FILEPKc]+0x93b): undefined reference to `uncompress'
/usr/bin/ld: common.cpp:(.text._ZN12cimg_library8CImgListIhE10_load_cimgEP8_IO_FILEPKc[_ZN12cimg_library8CImgListIhE10_load_cimgEP8_IO_FILEPKc]+0xce5): undefined reference to `uncompress'
/usr/bin/ld: common.cpp:(.text._ZN12cimg_library8CImgListIhE10_load_cimgEP8_IO_FILEPKc[_ZN12cimg_library8CImgListIhE10_load_cimgEP8_IO_FILEPKc]+0x10f7): undefined reference to `uncompress'
/usr/bin/ld: /usr/local/lib/libmatplot.a(common.cpp.o):common.cpp:(.text._ZN12cimg_library8CImgListIhE10_load_cimgEP8_IO_FILEPKc[_ZN12cimg_library8CImgListIhE10_load_cimgEP8_IO_FILEPKc]+0x1506): more undefined references to `uncompress' follow
/usr/bin/ld: /usr/local/lib/libmatplot.a(common.cpp.o): in function `cimg_library::CImg<unsigned char>::_load_jpeg(_IO_FILE*, char const*)':
common.cpp:(.text._ZN12cimg_library4CImgIhE10_load_jpegEP8_IO_FILEPKc[_ZN12cimg_library4CImgIhE10_load_jpegEP8_IO_FILEPKc]+0x67): undefined reference to `jpeg_std_error'
/usr/bin/ld: common.cpp:(.text._ZN12cimg_library4CImgIhE10_load_jpegEP8_IO_FILEPKc[_ZN12cimg_library4CImgIhE10_load_jpegEP8_IO_FILEPKc]+0xb3): undefined reference to `jpeg_CreateDecompress'
/usr/bin/ld: common.cpp:(.text._ZN12cimg_library4CImgIhE10_load_jpegEP8_IO_FILEPKc[_ZN12cimg_library4CImgIhE10_load_jpegEP8_IO_FILEPKc]+0xc5): undefined reference to `jpeg_stdio_src'
/usr/bin/ld: common.cpp:(.text._ZN12cimg_library4CImgIhE10_load_jpegEP8_IO_FILEPKc[_ZN12cimg_library4CImgIhE10_load_jpegEP8_IO_FILEPKc]+0xd2): undefined reference to `jpeg_read_header'
/usr/bin/ld: common.cpp:(.text._ZN12cimg_library4CImgIhE10_load_jpegEP8_IO_FILEPKc[_ZN12cimg_library4CImgIhE10_load_jpegEP8_IO_FILEPKc]+0xda): undefined reference to `jpeg_start_decompress'
/usr/bin/ld: common.cpp:(.text._ZN12cimg_library4CImgIhE10_load_jpegEP8_IO_FILEPKc[_ZN12cimg_library4CImgIhE10_load_jpegEP8_IO_FILEPKc]+0x1f8): undefined reference to `jpeg_read_scanlines'
/usr/bin/ld: common.cpp:(.text._ZN12cimg_library4CImgIhE10_load_jpegEP8_IO_FILEPKc[_ZN12cimg_library4CImgIhE10_load_jpegEP8_IO_FILEPKc]+0x278): undefined reference to `jpeg_finish_decompress'
/usr/bin/ld: common.cpp:(.text._ZN12cimg_library4CImgIhE10_load_jpegEP8_IO_FILEPKc[_ZN12cimg_library4CImgIhE10_load_jpegEP8_IO_FILEPKc]+0x284): undefined reference to `jpeg_destroy_decompress'
/usr/bin/ld: /usr/local/lib/libmatplot.a(network.cpp.o): in function `matplot::network::process_force_layout()':
network.cpp:(.text+0x304e): undefined reference to `nodesoup::size_radiuses(std::vector<std::vector<unsigned long, std::allocator<unsigned long> >, std::allocator<std::vector<unsigned long, std::allocator<unsigned long> > > > const&, double, double)'
/usr/bin/ld: network.cpp:(.text+0x312a): undefined reference to `nodesoup::fruchterman_reingold(std::vector<std::vector<unsigned long, std::allocator<unsigned long> >, std::allocator<std::vector<unsigned long, std::allocator<unsigned long> > > > const&, unsigned int, unsigned int, unsigned int, double, std::function<void (std::vector<nodesoup::Point2D, std::allocator<nodesoup::Point2D> > const&, int)>)'
/usr/bin/ld: /usr/local/lib/libmatplot.a(network.cpp.o): in function `matplot::network::process_kawai_layout()':
network.cpp:(.text+0x3842): undefined reference to `nodesoup::size_radiuses(std::vector<std::vector<unsigned long, std::allocator<unsigned long> >, std::allocator<std::vector<unsigned long, std::allocator<unsigned long> > > > const&, double, double)'
/usr/bin/ld: network.cpp:(.text+0x390c): undefined reference to `nodesoup::kamada_kawai(std::vector<std::vector<unsigned long, std::allocator<unsigned long> >, std::allocator<std::vector<unsigned long, std::allocator<unsigned long> > > > const&, unsigned int, unsigned int, double, double)'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/example.dir/build.make:84: example] Error 1
make[1]: *** [CMakeFiles/Makefile2:76: CMakeFiles/example.dir/all] Error 2
make: *** [Makefile:84: all] Error 2
The errors are plenty, but they are all of the form undefined reference to png_... or undefined reference to jpeg_... except for those that are undefined reference to 'uncompress'. It seems as though CMake is not finding png and jpeg. I definitely do have libjpeg and libpng installed. Why are these errors ocurring? Do I need to add lines to my CMakeLists.txt to find jpeg and png? I am running Ubuntu 20.04, g++ 9.3.0, and cmake 3.16.3.
Here is a very simple example that prodces the error. This is the cmake file
cmake_minimum_required(VERSION 3.10)
project(example)
set(CMAKE_CXX_COMPILER "c++")
find_package(Matplot++)
add_executable(example example.cpp)
target_link_libraries(example PUBLIC matplot)
Here is an example c++ code (pulled directly from the examples on the linked site).
#include <cmath>
#include <matplot/matplot.h>
int main() {
using namespace matplot;
std::vector<double> x = linspace(0, 10, 150);
std::vector<double> y = transform(x, [](auto x) { return cos(5 * x); });
plot(x, y)->color({0, 0.7, 0.9});
title("2-D Line Plot");
xlabel("x");
ylabel("cos(5x)");
show();
return 0;
}
I had the same problem (with Windows MinGW). Thanks to #drescherjm hint (add the option -DBUILD_SHARED_LIBS=ON), these are the steps I used to solve the problem:
git clone http://github.com/alandefreitas/matplotplusplus
cd matplotplusplus/
mkdir compil-release && cd compil-release
rm CMakeCache.txt # if already exists
cmake .. -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -DBUILD_EXAMPLES=OFF -DBUILD_TESTS=OFF -DCMAKE_INSTALL_PREFIX="${YOUR_LIB_PATH}/matplot1.0.1"
make -j4 && make install
Then, and I guess that is a bug, I had to manually copy the .dll to the install path
cp source/matplot/libmatplot.dll ${YOUR_LIB_PATH}/matplot1.0.1/lib/
Hope this works for you.

undefined references when compiling under Ubuntu 20 in Windows subsystem for Linux

I'm trying to build the pmp-library (https://github.com/pmp-library/pmp-library) under Ubuntu 20 in the Windows subsystem for Linux (WSL). More than half way through the build, I get lots of undefined references like this one:
[ 59%] Linking CXX executable ../../mconvert
/usr/bin/ld: CMakeFiles/mconvert.dir/mconvert.cpp.o: in function `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&) [clone .isra.19]':
mconvert.cpp:(.text+0x86): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_create(unsigned long&, unsigned long)'
I found that it might be related to the compiler version. However, as far as I understand I am compiling all dependencies myself and I get the same error using gcc/g++-6, 7, and 9 (>https://github.com/preshing/junction/issues/37>, and Converting std::__cxx11::string to std::string)
I also found that it might be related to the command used for compiling. Using gcc the c standard lib has to linked explicitly, using g++ it is linked automatically. But did not find the information in the make files.
Any idea how to fix this error? I posted the entire output below...
[ 59%] Linking CXX executable ../../mconvert
/usr/bin/ld: CMakeFiles/mconvert.dir/mconvert.cpp.o: in function `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&) [clone .isra.19]':
mconvert.cpp:(.text+0x86): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_create(unsigned long&, unsigned long)'
/usr/bin/ld: mconvert.cpp:(.text+0xbc): undefined reference to `std::__throw_logic_error(char const*)'
/usr/bin/ld: CMakeFiles/mconvert.dir/mconvert.cpp.o: in function `usage_and_exit()':
mconvert.cpp:(.text+0xca): undefined reference to `std::cerr'
/usr/bin/ld: mconvert.cpp:(.text+0xd8): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, long)'
/usr/bin/ld: mconvert.cpp:(.text+0xe6): undefined reference to `std::cerr'
/usr/bin/ld: mconvert.cpp:(.text+0xf0): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, long)'
/usr/bin/ld: mconvert.cpp:(.text+0xf7): undefined reference to `std::cerr'
/usr/bin/ld: mconvert.cpp:(.text+0x103): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'
/usr/bin/ld: CMakeFiles/mconvert.dir/mconvert.cpp.o: in function `main':
mconvert.cpp:(.text.startup+0xff): undefined reference to `operator delete(void*)'
/usr/bin/ld: mconvert.cpp:(.text.startup+0x116): undefined reference to `std::cerr'
/usr/bin/ld: mconvert.cpp:(.text.startup+0x120): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, long)'
/usr/bin/ld: mconvert.cpp:(.text.startup+0x127): undefined reference to `std::cerr'
/usr/bin/ld: mconvert.cpp:(.text.startup+0x12f): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'
/usr/bin/ld: mconvert.cpp:(.text.startup+0x13e): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'
/usr/bin/ld: mconvert.cpp:(.text.startup+0x19d): undefined reference to `operator delete(void*)'
/usr/bin/ld: mconvert.cpp:(.text.startup+0x1b0): undefined reference to `std::cerr'
/usr/bin/ld: mconvert.cpp:(.text.startup+0x1ba): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, long)'
/usr/bin/ld: mconvert.cpp:(.text.startup+0x1c1): undefined reference to `std::cerr'
/usr/bin/ld: mconvert.cpp:(.text.startup+0x1c9): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'
/usr/bin/ld: mconvert.cpp:(.text.startup+0x1ee): undefined reference to `operator delete(void*)'
/usr/bin/ld: CMakeFiles/mconvert.dir/mconvert.cpp.o: in function `_GLOBAL__sub_I__Z14usage_and_exitv':
mconvert.cpp:(.text.startup+0x21c): undefined reference to `std::ios_base::Init::Init()'
/usr/bin/ld: mconvert.cpp:(.text.startup+0x223): undefined reference to `std::ios_base::Init::~Init()'
/usr/bin/ld: CMakeFiles/mconvert.dir/mconvert.cpp.o:(.data.rel.local.DW.ref.__gxx_personality_v0[DW.ref.__gxx_personality_v0]+0x0): undefined reference to `__gxx_personality_v0'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to `std::ostream& std::ostream::_M_insert<unsigned long>(unsigned long)'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to `std::basic_ios<char, std::char_traits<char> >::init(std::basic_streambuf<char, std::char_traits<char> >*)'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to `std::ctype<char>::_M_widen_init() const'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to `VTT for std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to `std::_Rb_tree_decrement(std::_Rb_tree_node_base*)'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to `std::ios_base::~ios_base()'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to `operator new[](unsigned long)'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to `typeinfo for std::bad_alloc'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to `std::_Rb_tree_increment(std::_Rb_tree_node_base*)'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to `__cxa_end_catch'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::~basic_ostringstream()'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to `std::basic_ofstream<char, std::char_traits<char> >::~basic_ofstream()'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to `__cxa_allocate_exception'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to `std::_Rb_tree_increment(std::_Rb_tree_node_base const*)'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to `std::bad_alloc::~bad_alloc()'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to `atan2'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to `vtable for std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to `std::ios_base::ios_base()'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::compare(char const*) const'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to `std::cout'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to `vtable for std::basic_ios<char, std::char_traits<char> >'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to `std::locale::locale()'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to `std::basic_filebuf<char, std::char_traits<char> >::open(char const*, std::_Ios_Openmode)'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to `typeinfo for float'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to `std::ostream& std::ostream::_M_insert<double>(double)'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to `VTT for std::basic_ofstream<char, std::char_traits<char> >'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to `__cxa_guard_release'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to `std::ostream::flush()'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to `acos'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to `typeinfo for double'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to `typeinfo for bool'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to `std::ostream::put(char)'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_assign(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to `std::basic_filebuf<char, std::char_traits<char> >::close()'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to `vtable for std::basic_streambuf<char, std::char_traits<char> >'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to `__cxa_pure_virtual'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to `std::basic_filebuf<char, std::char_traits<char> >::~basic_filebuf()'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to `__cxa_throw_bad_array_new_length'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to `__dynamic_cast'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to `sin'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to `std::__throw_bad_cast()'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to `vtable for std::__cxx11::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to `operator delete[](void*)'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to `sqrtf'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to `std::clog'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to `std::basic_ios<char, std::char_traits<char> >::clear(std::_Ios_Iostate)'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to `vtable for std::bad_alloc'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to `tan'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to `std::_Rb_tree_rebalance_for_erase(std::_Rb_tree_node_base*, std::_Rb_tree_node_base&)'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to `__cxa_begin_catch'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to `__cxa_rethrow'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to `__cxa_throw'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::rfind(char const*, unsigned long, unsigned long) const'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to `std::locale::~locale()'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to `vtable for std::basic_ofstream<char, std::char_traits<char> >'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to `cos'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to `typeinfo for int'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to `std::basic_filebuf<char, std::char_traits<char> >::basic_filebuf()'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to `operator new(unsigned long)'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to `std::__basic_file<char>::~__basic_file()'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to `std::__throw_out_of_range_fmt(char const*, ...)'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to `sqrt'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to `sincosf'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to `vtable for std::basic_filebuf<char, std::char_traits<char> >'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to `std::__throw_length_error(char const*)'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to `vtable for __cxxabiv1::__class_type_info'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to `std::ostream::operator<<(int)'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to `std::_Rb_tree_insert_and_rebalance(bool, std::_Rb_tree_node_base*, std::_Rb_tree_node_base*, std::_Rb_tree_node_base&)'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to `std::__throw_bad_alloc()'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to `vtable for __cxxabiv1::__vmi_class_type_info'
/usr/bin/ld: ../../libpmp.so.1.2.1: undefined reference to `__cxa_guard_acquire'
collect2: error: ld returned 1 exit status
make[2]: *** [src/apps/CMakeFiles/mconvert.dir/build.make:85: mconvert] Error 1
make[1]: *** [CMakeFiles/Makefile2:544: src/apps/CMakeFiles/mconvert.dir/all] Error 2
make: *** [Makefile:163: all] Error 2
Try using g++ compiler for compiling like this
g++ <cpp file name> -o <desired file name>
To install it you may use
$ sudo apt-get install g++
Hope it works

Apache arrow error during example code compilation

After installing the apache arrow library on my computer, I tried running the c++ code example in the website (https://github.com/apache/arrow/blob/master/cpp/examples/arrow/row-wise-conversion-example.cc) but consistently kept getting the same error. I though it was because of the compiler couldnot find the arrow directory but after putting the library in the same folder as the test, it still didnt run and kept giving the same error.
g++ test.cpp
/usr/bin/ld: /tmp/ccvG1aV8.o: in function `VectorToColumnarTable(std::vector<data_row, std::allocator<data_row> > const&, std::shared_ptr<arrow::Table>*)':
test.cpp:(.text+0x5c): undefined reference to `arrow::default_memory_pool()'
/usr/bin/ld: test.cpp:(.text+0x49b): undefined reference to `arrow::ArrayBuilder::Finish(std::shared_ptr<arrow::Array>*)'
/usr/bin/ld: test.cpp:(.text+0x555): undefined reference to `arrow::ArrayBuilder::Finish(std::shared_ptr<arrow::Array>*)'
/usr/bin/ld: test.cpp:(.text+0x60f): undefined reference to `arrow::ArrayBuilder::Finish(std::shared_ptr<arrow::Array>*)'
/usr/bin/ld: test.cpp:(.text+0x6b6): undefined reference to `arrow::int64()'
/usr/bin/ld: test.cpp:(.text+0x70b): undefined reference to `arrow::field(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::shared_ptr<arrow::DataType> const&, bool, std::shared_ptr<arrow::KeyValueMetadata const> const&)'
/usr/bin/ld: test.cpp:(.text+0x72e): undefined reference to `arrow::float64()'
/usr/bin/ld: test.cpp:(.text+0x783): undefined reference to `arrow::field(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::shared_ptr<arrow::DataType> const&, bool, std::shared_ptr<arrow::KeyValueMetadata const> const&)'
/usr/bin/ld: test.cpp:(.text+0x7a6): undefined reference to `arrow::float64()'
/usr/bin/ld: test.cpp:(.text+0x7bf): undefined reference to `arrow::list(std::shared_ptr<arrow::DataType> const&)'
/usr/bin/ld: test.cpp:(.text+0x814): undefined reference to `arrow::field(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::shared_ptr<arrow::DataType> const&, bool, std::shared_ptr<arrow::KeyValueMetadata const> const&)'
/usr/bin/ld: test.cpp:(.text+0xa1a): undefined reference to `arrow::Table::Make(std::shared_ptr<arrow::Schema> const&, std::vector<std::shared_ptr<arrow::Array>, std::allocator<std::shared_ptr<arrow::Array> > > const&, long)'
/usr/bin/ld: /tmp/ccvG1aV8.o: in function `ColumnarTableToVector(std::shared_ptr<arrow::Table> const&, std::vector<data_row, std::allocator<data_row> >*)':
test.cpp:(.text+0xef0): undefined reference to `arrow::int64()'
/usr/bin/ld: test.cpp:(.text+0xf45): undefined reference to `arrow::field(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::shared_ptr<arrow::DataType> const&, bool, std::shared_ptr<arrow::KeyValueMetadata const> const&)'
/usr/bin/ld: test.cpp:(.text+0xf68): undefined reference to `arrow::float64()'
/usr/bin/ld: test.cpp:(.text+0xfbd): undefined reference to `arrow::field(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::shared_ptr<arrow::DataType> const&, bool, std::shared_ptr<arrow::KeyValueMetadata const> const&)'
/usr/bin/ld: test.cpp:(.text+0xfe0): undefined reference to `arrow::float64()'
/usr/bin/ld: test.cpp:(.text+0xff9): undefined reference to `arrow::list(std::shared_ptr<arrow::DataType> const&)'
/usr/bin/ld: test.cpp:(.text+0x1048): undefined reference to `arrow::field(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::shared_ptr<arrow::DataType> const&, bool, std::shared_ptr<arrow::KeyValueMetadata const> const&)'
/usr/bin/ld: test.cpp:(.text+0x11eb): undefined reference to `arrow::Schema::Equals(arrow::Schema const&, bool) const'
/usr/bin/ld: /tmp/ccvG1aV8.o: in function `arrow::detail::Fingerprintable::Fingerprintable()':
test.cpp:(.text._ZN5arrow6detail15FingerprintableC2Ev[_ZN5arrow6detail15FingerprintableC5Ev]+0xf): undefined reference to `vtable for arrow::detail::Fingerprintable'
/usr/bin/ld: /tmp/ccvG1aV8.o: in function `arrow::DataType::DataType(arrow::Type::type)':
test.cpp:(.text._ZN5arrow8DataTypeC2ENS_4Type4typeE[_ZN5arrow8DataTypeC5ENS_4Type4typeE]+0x45): undefined reference to `vtable for arrow::DataType'
/usr/bin/ld: /tmp/ccvG1aV8.o: in function `arrow::NestedType::~NestedType()':
test.cpp:(.text._ZN5arrow10NestedTypeD2Ev[_ZN5arrow10NestedTypeD5Ev]+0x26): undefined reference to `arrow::DataType::~DataType()'
/usr/bin/ld: /tmp/ccvG1aV8.o: in function `arrow::ListType::ListType(std::shared_ptr<arrow::Field> const&)':
test.cpp:(.text._ZN5arrow8ListTypeC2ERKSt10shared_ptrINS_5FieldEE[_ZN5arrow8ListTypeC5ERKSt10shared_ptrINS_5FieldEE]+0x3c): undefined reference to `vtable for arrow::ListType'
/usr/bin/ld: /tmp/ccvG1aV8.o: in function `arrow::Buffer::ZeroPadding()':
test.cpp:(.text._ZN5arrow6Buffer11ZeroPaddingEv[_ZN5arrow6Buffer11ZeroPaddingEv]+0x18): undefined reference to `arrow::Buffer::CheckMutable() const'
/usr/bin/ld: /tmp/ccvG1aV8.o: in function `arrow::Buffer::mutable_data()':
test.cpp:(.text._ZN5arrow6Buffer12mutable_dataEv[_ZN5arrow6Buffer12mutable_dataEv]+0x18): undefined reference to `arrow::Buffer::CheckMutable() const'
/usr/bin/ld: /tmp/ccvG1aV8.o: in function `arrow::TypeTraits<arrow::Int64Type>::type_singleton()':
test.cpp:(.text._ZN5arrow10TypeTraitsINS_9Int64TypeEE14type_singletonEv[_ZN5arrow10TypeTraitsINS_9Int64TypeEE14type_singletonEv]+0x27): undefined reference to `arrow::int64()'
/usr/bin/ld: /tmp/ccvG1aV8.o: in function `arrow::TypeTraits<arrow::DoubleType>::type_singleton()':
test.cpp:(.text._ZN5arrow10TypeTraitsINS_10DoubleTypeEE14type_singletonEv[_ZN5arrow10TypeTraitsINS_10DoubleTypeEE14type_singletonEv]+0x27): undefined reference to `arrow::float64()'
/usr/bin/ld: /tmp/ccvG1aV8.o: in function `arrow::BufferBuilder::Resize(long, bool)':
test.cpp:(.text._ZN5arrow13BufferBuilder6ResizeElb[_ZN5arrow13BufferBuilder6ResizeElb]+0x76): undefined reference to `arrow::AllocateResizableBuffer(arrow::MemoryPool*, long, std::shared_ptr<arrow::ResizableBuffer>*)'
/usr/bin/ld: /tmp/ccvG1aV8.o: in function `arrow::BufferBuilder::Finish(std::shared_ptr<arrow::Buffer>*, bool)':
test.cpp:(.text._ZN5arrow13BufferBuilder6FinishEPSt10shared_ptrINS_6BufferEEb[_ZN5arrow13BufferBuilder6FinishEPSt10shared_ptrINS_6BufferEEb]+0x121): undefined reference to `arrow::AllocateBuffer(arrow::MemoryPool*, long, std::shared_ptr<arrow::Buffer>*)'
/usr/bin/ld: /tmp/ccvG1aV8.o: in function `arrow::ArrayBuilder::ArrayBuilder(arrow::MemoryPool*)':
test.cpp:(.text._ZN5arrow12ArrayBuilderC2EPNS_10MemoryPoolE[_ZN5arrow12ArrayBuilderC5EPNS_10MemoryPoolE]+0x17): undefined reference to `vtable for arrow::ArrayBuilder'
/usr/bin/ld: /tmp/ccvG1aV8.o: in function `arrow::ArrayBuilder::UnsafeAppendToBitmap(unsigned char const*, long)':
test.cpp:(.text._ZN5arrow12ArrayBuilder20UnsafeAppendToBitmapEPKhl[_ZN5arrow12ArrayBuilder20UnsafeAppendToBitmapEPKhl]+0x2e): undefined reference to `arrow::ArrayBuilder::UnsafeSetNotNull(long)'
/usr/bin/ld: /tmp/ccvG1aV8.o: in function `arrow::ArrayBuilder::UnsafeAppendToBitmap(long, bool)':
test.cpp:(.text._ZN5arrow12ArrayBuilder20UnsafeAppendToBitmapElb[_ZN5arrow12ArrayBuilder20UnsafeAppendToBitmapElb]+0x2e): undefined reference to `arrow::ArrayBuilder::UnsafeSetNotNull(long)'
/usr/bin/ld: test.cpp:(.text._ZN5arrow12ArrayBuilder20UnsafeAppendToBitmapElb[_ZN5arrow12ArrayBuilder20UnsafeAppendToBitmapElb]+0x43): undefined reference to `arrow::ArrayBuilder::UnsafeSetNull(long)'
/usr/bin/ld: /tmp/ccvG1aV8.o: in function `arrow::ArrayBuilder::~ArrayBuilder()':
test.cpp:(.text._ZN5arrow12ArrayBuilderD2Ev[_ZN5arrow12ArrayBuilderD5Ev]+0x13): undefined reference to `vtable for arrow::ArrayBuilder'
/usr/bin/ld: /tmp/ccvG1aV8.o: in function `arrow::NumericBuilder<arrow::Int64Type>::NumericBuilder<arrow::Int64Type>(std::enable_if<std::integral_constant<bool, arrow::TypeTraits<arrow::Int64Type>::is_parameter_free>::value, arrow::MemoryPool*>::type)':
test.cpp:(.text._ZN5arrow14NumericBuilderINS_9Int64TypeEEC2IS1_EENSt9enable_ifIXsrSt17integral_constantIbXsrNS_10TypeTraitsIT_EE17is_parameter_freeEE5valueEPNS_10MemoryPoolEE4typeE[_ZN5arrow14NumericBuilderINS_9Int64TypeEEC5IS1_EENSt9enable_ifIXsrSt17integral_constantIbXsrNS_10TypeTraitsIT_EE17is_parameter_freeEE5valueEPNS_10MemoryPoolEE4typeE]+0x61): undefined reference to `arrow::default_memory_pool()'
/usr/bin/ld: /tmp/ccvG1aV8.o: in function `arrow::NumericBuilder<arrow::DoubleType>::NumericBuilder<arrow::DoubleType>(std::enable_if<std::integral_constant<bool, arrow::TypeTraits<arrow::DoubleType>::is_parameter_free>::value, arrow::MemoryPool*>::type)':
test.cpp:(.text._ZN5arrow14NumericBuilderINS_10DoubleTypeEEC2IS1_EENSt9enable_ifIXsrSt17integral_constantIbXsrNS_10TypeTraitsIT_EE17is_parameter_freeEE5valueEPNS_10MemoryPoolEE4typeE[_ZN5arrow14NumericBuilderINS_10DoubleTypeEEC5IS1_EENSt9enable_ifIXsrSt17integral_constantIbXsrNS_10TypeTraitsIT_EE17is_parameter_freeEE5valueEPNS_10MemoryPoolEE4typeE]+0x61): undefined reference to `arrow::default_memory_pool()'
/usr/bin/ld: /tmp/ccvG1aV8.o: in function `arrow::BaseListBuilder<arrow::ListType>::BaseListBuilder(arrow::MemoryPool*, std::shared_ptr<arrow::ArrayBuilder> const&)':
test.cpp:(.text._ZN5arrow15BaseListBuilderINS_8ListTypeEEC2EPNS_10MemoryPoolERKSt10shared_ptrINS_12ArrayBuilderEE[_ZN5arrow15BaseListBuilderINS_8ListTypeEEC5EPNS_10MemoryPoolERKSt10shared_ptrINS_12ArrayBuilderEE]+0x59): undefined reference to `arrow::list(std::shared_ptr<arrow::DataType> const&)'
/usr/bin/ld: /tmp/ccvG1aV8.o: in function `arrow::Status arrow::Status::FromArgs<char const (&) [33]>(arrow::StatusCode, char const (&) [33])':
test.cpp:(.text._ZN5arrow6Status8FromArgsIJRA33_KcEEES0_NS_10StatusCodeEDpOT_[_ZN5arrow6Status8FromArgsIJRA33_KcEEES0_NS_10StatusCodeEDpOT_]+0x59): undefined reference to `arrow::Status::Status(arrow::StatusCode, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/bin/ld: /tmp/ccvG1aV8.o: in function `arrow::Status arrow::Status::FromArgs<char const (&) [23]>(arrow::StatusCode, char const (&) [23])':
test.cpp:(.text._ZN5arrow6Status8FromArgsIJRA23_KcEEES0_NS_10StatusCodeEDpOT_[_ZN5arrow6Status8FromArgsIJRA23_KcEEES0_NS_10StatusCodeEDpOT_]+0x59): undefined reference to `arrow::Status::Status(arrow::StatusCode, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/bin/ld: /tmp/ccvG1aV8.o: in function `arrow::BaseListBuilder<arrow::ListType>::BaseListBuilder(arrow::MemoryPool*, std::shared_ptr<arrow::ArrayBuilder> const&, std::shared_ptr<arrow::DataType> const&)':
test.cpp:(.text._ZN5arrow15BaseListBuilderINS_8ListTypeEEC2EPNS_10MemoryPoolERKSt10shared_ptrINS_12ArrayBuilderEERKS5_INS_8DataTypeEE[_ZN5arrow15BaseListBuilderINS_8ListTypeEEC5EPNS_10MemoryPoolERKSt10shared_ptrINS_12ArrayBuilderEERKS5_INS_8DataTypeEE]+0xdd): undefined reference to `arrow::Field::WithType(std::shared_ptr<arrow::DataType> const&) const'
/usr/bin/ld: /tmp/ccvG1aV8.o: in function `arrow::Status arrow::Status::FromArgs<char const (&) [26]>(arrow::StatusCode, char const (&) [26])':
test.cpp:(.text._ZN5arrow6Status8FromArgsIJRA26_KcEEES0_NS_10StatusCodeEDpOT_[_ZN5arrow6Status8FromArgsIJRA26_KcEEES0_NS_10StatusCodeEDpOT_]+0x59): undefined reference to `arrow::Status::Status(arrow::StatusCode, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/bin/ld: /tmp/ccvG1aV8.o: in function `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > arrow::util::StringBuilder<char const (&) [33]>(char const (&) [33])':
test.cpp:(.text._ZN5arrow4util13StringBuilderIJRA33_KcEEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEDpOT_[_ZN5arrow4util13StringBuilderIJRA33_KcEEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEDpOT_]+0x2c): undefined reference to `arrow::util::detail::StringStreamWrapper::StringStreamWrapper()'
/usr/bin/ld: test.cpp:(.text._ZN5arrow4util13StringBuilderIJRA33_KcEEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEDpOT_[_ZN5arrow4util13StringBuilderIJRA33_KcEEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEDpOT_]+0x65): undefined reference to `arrow::util::detail::StringStreamWrapper::str[abi:cxx11]()'
/usr/bin/ld: test.cpp:(.text._ZN5arrow4util13StringBuilderIJRA33_KcEEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEDpOT_[_ZN5arrow4util13StringBuilderIJRA33_KcEEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEDpOT_]+0x72): undefined reference to `arrow::util::detail::StringStreamWrapper::~StringStreamWrapper()'
/usr/bin/ld: test.cpp:(.text._ZN5arrow4util13StringBuilderIJRA33_KcEEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEDpOT_[_ZN5arrow4util13StringBuilderIJRA33_KcEEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEDpOT_]+0x97): undefined reference to `arrow::util::detail::StringStreamWrapper::~StringStreamWrapper()'
/usr/bin/ld: /tmp/ccvG1aV8.o: in function `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > arrow::util::StringBuilder<char const (&) [23]>(char const (&) [23])':
test.cpp:(.text._ZN5arrow4util13StringBuilderIJRA23_KcEEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEDpOT_[_ZN5arrow4util13StringBuilderIJRA23_KcEEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEDpOT_]+0x2c): undefined reference to `arrow::util::detail::StringStreamWrapper::StringStreamWrapper()'
/usr/bin/ld: test.cpp:(.text._ZN5arrow4util13StringBuilderIJRA23_KcEEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEDpOT_[_ZN5arrow4util13StringBuilderIJRA23_KcEEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEDpOT_]+0x65): undefined reference to `arrow::util::detail::StringStreamWrapper::str[abi:cxx11]()'
/usr/bin/ld: test.cpp:(.text._ZN5arrow4util13StringBuilderIJRA23_KcEEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEDpOT_[_ZN5arrow4util13StringBuilderIJRA23_KcEEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEDpOT_]+0x72): undefined reference to `arrow::util::detail::StringStreamWrapper::~StringStreamWrapper()'
/usr/bin/ld: test.cpp:(.text._ZN5arrow4util13StringBuilderIJRA23_KcEEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEDpOT_[_ZN5arrow4util13StringBuilderIJRA23_KcEEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEDpOT_]+0x97): undefined reference to `arrow::util::detail::StringStreamWrapper::~StringStreamWrapper()'
/usr/bin/ld: /tmp/ccvG1aV8.o: in function `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > arrow::util::StringBuilder<char const (&) [26]>(char const (&) [26])':
test.cpp:(.text._ZN5arrow4util13StringBuilderIJRA26_KcEEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEDpOT_[_ZN5arrow4util13StringBuilderIJRA26_KcEEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEDpOT_]+0x2c): undefined reference to `arrow::util::detail::StringStreamWrapper::StringStreamWrapper()'
/usr/bin/ld: test.cpp:(.text._ZN5arrow4util13StringBuilderIJRA26_KcEEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEDpOT_[_ZN5arrow4util13StringBuilderIJRA26_KcEEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEDpOT_]+0x65): undefined reference to `arrow::util::detail::StringStreamWrapper::str[abi:cxx11]()'
/usr/bin/ld: test.cpp:(.text._ZN5arrow4util13StringBuilderIJRA26_KcEEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEDpOT_[_ZN5arrow4util13StringBuilderIJRA26_KcEEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEDpOT_]+0x72): undefined reference to `arrow::util::detail::StringStreamWrapper::~StringStreamWrapper()'
/usr/bin/ld: test.cpp:(.text._ZN5arrow4util13StringBuilderIJRA26_KcEEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEDpOT_[_ZN5arrow4util13StringBuilderIJRA26_KcEEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEDpOT_]+0x97): undefined reference to `arrow::util::detail::StringStreamWrapper::~StringStreamWrapper()'
/usr/bin/ld: /tmp/ccvG1aV8.o: in function `arrow::Status arrow::Status::FromArgs<char const (&) [37], long, char const (&) [17], char const (&) [7], long const&>(arrow::StatusCode, char const (&) [37], long&&, char const (&) [17], char const (&) [7], long const&)':
test.cpp:(.text._ZN5arrow6Status8FromArgsIJRA37_KclRA17_S2_RA7_S2_RKlEEES0_NS_10StatusCodeEDpOT_[_ZN5arrow6Status8FromArgsIJRA37_KclRA17_S2_RA7_S2_RKlEEES0_NS_10StatusCodeEDpOT_]+0xbe): undefined reference to `arrow::Status::Status(arrow::StatusCode, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/bin/ld: /tmp/ccvG1aV8.o: in function `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > arrow::util::StringBuilder<char const (&) [37], long, char const (&) [17], char const (&) [7], long const&>(char const (&) [37], long&&, char const (&) [17], char const (&) [7], long const&)':
test.cpp:(.text._ZN5arrow4util13StringBuilderIJRA37_KclRA17_S2_RA7_S2_RKlEEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEDpOT_[_ZN5arrow4util13StringBuilderIJRA37_KclRA17_S2_RA7_S2_RKlEEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEDpOT_]+0x44): undefined reference to `arrow::util::detail::StringStreamWrapper::StringStreamWrapper()'
/usr/bin/ld: test.cpp:(.text._ZN5arrow4util13StringBuilderIJRA37_KclRA17_S2_RA7_S2_RKlEEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEDpOT_[_ZN5arrow4util13StringBuilderIJRA37_KclRA17_S2_RA7_S2_RKlEEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEDpOT_]+0xc5): undefined reference to `arrow::util::detail::StringStreamWrapper::str[abi:cxx11]()'
/usr/bin/ld: test.cpp:(.text._ZN5arrow4util13StringBuilderIJRA37_KclRA17_S2_RA7_S2_RKlEEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEDpOT_[_ZN5arrow4util13StringBuilderIJRA37_KclRA17_S2_RA7_S2_RKlEEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEDpOT_]+0xd2): undefined reference to `arrow::util::detail::StringStreamWrapper::~StringStreamWrapper()'
/usr/bin/ld: test.cpp:(.text._ZN5arrow4util13StringBuilderIJRA37_KclRA17_S2_RA7_S2_RKlEEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEDpOT_[_ZN5arrow4util13StringBuilderIJRA37_KclRA17_S2_RA7_S2_RKlEEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEDpOT_]+0xf7): undefined reference to `arrow::util::detail::StringStreamWrapper::~StringStreamWrapper()'
/usr/bin/ld: /tmp/ccvG1aV8.o: in function `void __gnu_cxx::new_allocator<arrow::Schema>::construct<arrow::Schema, std::vector<std::shared_ptr<arrow::Field>, std::allocator<std::shared_ptr<arrow::Field> > >&>(arrow::Schema*, std::vector<std::shared_ptr<arrow::Field>, std::allocator<std::shared_ptr<arrow::Field> > >&)':
test.cpp:(.text._ZN9__gnu_cxx13new_allocatorIN5arrow6SchemaEE9constructIS2_JRSt6vectorISt10shared_ptrINS1_5FieldEESaIS8_EEEEEvPT_DpOT0_[_ZN9__gnu_cxx13new_allocatorIN5arrow6SchemaEE9constructIS2_JRSt6vectorISt10shared_ptrINS1_5FieldEESaIS8_EEEEEvPT_DpOT0_]+0x70): undefined reference to `arrow::Schema::Schema(std::vector<std::shared_ptr<arrow::Field>, std::allocator<std::shared_ptr<arrow::Field> > > const&, std::shared_ptr<arrow::KeyValueMetadata const> const&)'
/usr/bin/ld: /tmp/ccvG1aV8.o:(.data.rel.ro._ZTVN5arrow12BaseListTypeE[_ZTVN5arrow12BaseListTypeE]+0x20): undefined reference to `arrow::DataType::ComputeFingerprint[abi:cxx11]() const'
/usr/bin/ld: /tmp/ccvG1aV8.o:(.data.rel.ro._ZTVN5arrow12BaseListTypeE[_ZTVN5arrow12BaseListTypeE]+0x28): undefined reference to `arrow::DataType::ComputeMetadataFingerprint[abi:cxx11]() const'
/usr/bin/ld: /tmp/ccvG1aV8.o:(.data.rel.ro._ZTVN5arrow10NestedTypeE[_ZTVN5arrow10NestedTypeE]+0x20): undefined reference to `arrow::DataType::ComputeFingerprint[abi:cxx11]() const'
/usr/bin/ld: /tmp/ccvG1aV8.o:(.data.rel.ro._ZTVN5arrow10NestedTypeE[_ZTVN5arrow10NestedTypeE]+0x28): undefined reference to `arrow::DataType::ComputeMetadataFingerprint[abi:cxx11]() const'
/usr/bin/ld: /tmp/ccvG1aV8.o:(.data.rel.ro._ZTIN5arrow14NumericBuilderINS_10DoubleTypeEEE[_ZTIN5arrow14NumericBuilderINS_10DoubleTypeEEE]+0x10): undefined reference to `typeinfo for arrow::ArrayBuilder'
/usr/bin/ld: /tmp/ccvG1aV8.o:(.data.rel.ro._ZTIN5arrow14NumericBuilderINS_9Int64TypeEEE[_ZTIN5arrow14NumericBuilderINS_9Int64TypeEEE]+0x10): undefined reference to `typeinfo for arrow::ArrayBuilder'
/usr/bin/ld: /tmp/ccvG1aV8.o:(.data.rel.ro._ZTIN5arrow15BaseListBuilderINS_8ListTypeEEE[_ZTIN5arrow15BaseListBuilderINS_8ListTypeEEE]+0x10): undefined reference to `typeinfo for arrow::ArrayBuilder'
/usr/bin/ld: /tmp/ccvG1aV8.o:(.data.rel.ro._ZTIN5arrow10NestedTypeE[_ZTIN5arrow10NestedTypeE]+0x18): undefined reference to `typeinfo for arrow::DataType'
/usr/bin/ld: /tmp/ccvG1aV8.o: in function `arrow::NumericBuilder<arrow::DoubleType>::Resize(long)':
test.cpp:(.text._ZN5arrow14NumericBuilderINS_10DoubleTypeEE6ResizeEl[_ZN5arrow14NumericBuilderINS_10DoubleTypeEE6ResizeEl]+0x16a): undefined reference to `arrow::ArrayBuilder::Resize(long)'
/usr/bin/ld: /tmp/ccvG1aV8.o: in function `arrow::NumericBuilder<arrow::DoubleType>::AppendNulls(long)':
test.cpp:(.text._ZN5arrow14NumericBuilderINS_10DoubleTypeEE11AppendNullsEl[_ZN5arrow14NumericBuilderINS_10DoubleTypeEE11AppendNullsEl]+0xd7): undefined reference to `arrow::ArrayBuilder::UnsafeSetNull(long)'
/usr/bin/ld: /tmp/ccvG1aV8.o: in function `arrow::NumericBuilder<arrow::DoubleType>::FinishInternal(std::shared_ptr<arrow::ArrayData>*)':
test.cpp:(.text._ZN5arrow14NumericBuilderINS_10DoubleTypeEE14FinishInternalEPSt10shared_ptrINS_9ArrayDataEE[_ZN5arrow14NumericBuilderINS_10DoubleTypeEE14FinishInternalEPSt10shared_ptrINS_9ArrayDataEE]+0x266): undefined reference to `arrow::ArrayData::Make(std::shared_ptr<arrow::DataType> const&, long, std::vector<std::shared_ptr<arrow::Buffer>, std::allocator<std::shared_ptr<arrow::Buffer> > >&&, long, long)'
/usr/bin/ld: /tmp/ccvG1aV8.o: in function `arrow::NumericBuilder<arrow::Int64Type>::Resize(long)':
test.cpp:(.text._ZN5arrow14NumericBuilderINS_9Int64TypeEE6ResizeEl[_ZN5arrow14NumericBuilderINS_9Int64TypeEE6ResizeEl]+0x16a): undefined reference to `arrow::ArrayBuilder::Resize(long)'
/usr/bin/ld: /tmp/ccvG1aV8.o: in function `arrow::NumericBuilder<arrow::Int64Type>::AppendNulls(long)':
test.cpp:(.text._ZN5arrow14NumericBuilderINS_9Int64TypeEE11AppendNullsEl[_ZN5arrow14NumericBuilderINS_9Int64TypeEE11AppendNullsEl]+0xd8): undefined reference to `arrow::ArrayBuilder::UnsafeSetNull(long)'
/usr/bin/ld: /tmp/ccvG1aV8.o: in function `arrow::NumericBuilder<arrow::Int64Type>::FinishInternal(std::shared_ptr<arrow::ArrayData>*)':
test.cpp:(.text._ZN5arrow14NumericBuilderINS_9Int64TypeEE14FinishInternalEPSt10shared_ptrINS_9ArrayDataEE[_ZN5arrow14NumericBuilderINS_9Int64TypeEE14FinishInternalEPSt10shared_ptrINS_9ArrayDataEE]+0x266): undefined reference to `arrow::ArrayData::Make(std::shared_ptr<arrow::DataType> const&, long, std::vector<std::shared_ptr<arrow::Buffer>, std::allocator<std::shared_ptr<arrow::Buffer> > >&&, long, long)'
/usr/bin/ld: /tmp/ccvG1aV8.o: in function `arrow::BaseListBuilder<arrow::ListType>::Resize(long)':
test.cpp:(.text._ZN5arrow15BaseListBuilderINS_8ListTypeEE6ResizeEl[_ZN5arrow15BaseListBuilderINS_8ListTypeEE6ResizeEl]+0x19a): undefined reference to `arrow::ArrayBuilder::Resize(long)'
/usr/bin/ld: /tmp/ccvG1aV8.o: in function `arrow::BaseListBuilder<arrow::ListType>::Reset()':
test.cpp:(.text._ZN5arrow15BaseListBuilderINS_8ListTypeEE5ResetEv[_ZN5arrow15BaseListBuilderINS_8ListTypeEE5ResetEv]+0x18): undefined reference to `arrow::ArrayBuilder::Reset()'
/usr/bin/ld: /tmp/ccvG1aV8.o: in function `arrow::BaseListBuilder<arrow::ListType>::FinishInternal(std::shared_ptr<arrow::ArrayData>*)':
test.cpp:(.text._ZN5arrow15BaseListBuilderINS_8ListTypeEE14FinishInternalEPSt10shared_ptrINS_9ArrayDataEE[_ZN5arrow15BaseListBuilderINS_8ListTypeEE14FinishInternalEPSt10shared_ptrINS_9ArrayDataEE]+0x568): undefined reference to `arrow::ArrayData::Make(std::shared_ptr<arrow::DataType> const&, long, std::vector<std::shared_ptr<arrow::Buffer>, std::allocator<std::shared_ptr<arrow::Buffer> > > const&, std::vector<std::shared_ptr<arrow::ArrayData>, std::allocator<std::shared_ptr<arrow::ArrayData> > > const&, long, long)'
/usr/bin/ld: /tmp/ccvG1aV8.o: in function `arrow::BaseListBuilder<arrow::ListType>::type() const':
test.cpp:(.text._ZNK5arrow15BaseListBuilderINS_8ListTypeEE4typeEv[_ZNK5arrow15BaseListBuilderINS_8ListTypeEE4typeEv]+0x70): undefined reference to `arrow::Field::WithType(std::shared_ptr<arrow::DataType> const&) const'
/usr/bin/ld: /tmp/ccvG1aV8.o: in function `arrow::Status arrow::Status::FromArgs<char const (&) [47], long, char const (&) [6], long&>(arrow::StatusCode, char const (&) [47], long&&, char const (&) [6], long&)':
test.cpp:(.text._ZN5arrow6Status8FromArgsIJRA47_KclRA6_S2_RlEEES0_NS_10StatusCodeEDpOT_[_ZN5arrow6Status8FromArgsIJRA47_KclRA6_S2_RlEEES0_NS_10StatusCodeEDpOT_]+0x9c): undefined reference to `arrow::Status::Status(arrow::StatusCode, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/bin/ld: /tmp/ccvG1aV8.o: in function `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > arrow::util::StringBuilder<char const (&) [47], long, char const (&) [6], long&>(char const (&) [47], long&&, char const (&) [6], long&)':
test.cpp:(.text._ZN5arrow4util13StringBuilderIJRA47_KclRA6_S2_RlEEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEDpOT_[_ZN5arrow4util13StringBuilderIJRA47_KclRA6_S2_RlEEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEDpOT_]+0x3e): undefined reference to `arrow::util::detail::StringStreamWrapper::StringStreamWrapper()'
/usr/bin/ld: test.cpp:(.text._ZN5arrow4util13StringBuilderIJRA47_KclRA6_S2_RlEEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEDpOT_[_ZN5arrow4util13StringBuilderIJRA47_KclRA6_S2_RlEEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEDpOT_]+0xad): undefined reference to `arrow::util::detail::StringStreamWrapper::str[abi:cxx11]()'
/usr/bin/ld: test.cpp:(.text._ZN5arrow4util13StringBuilderIJRA47_KclRA6_S2_RlEEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEDpOT_[_ZN5arrow4util13StringBuilderIJRA47_KclRA6_S2_RlEEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEDpOT_]+0xba): undefined reference to `arrow::util::detail::StringStreamWrapper::~StringStreamWrapper()'
/usr/bin/ld: test.cpp:(.text._ZN5arrow4util13StringBuilderIJRA47_KclRA6_S2_RlEEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEDpOT_[_ZN5arrow4util13StringBuilderIJRA47_KclRA6_S2_RlEEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEDpOT_]+0xdf): undefined reference to `arrow::util::detail::StringStreamWrapper::~StringStreamWrapper()'
collect2: error: ld returned 1 exit status
The code compiles correctly but fails to link. You need to supply the arrow library also to the g++ command:
g++ -L<directoy-of-libarrow.so> -larrow test.cpp
e.g.
g++ -L/usr/local/lib -larrow test.cpp
First step: make a file named
CMakeLists.txt
Second step: Paste the following text to the CMakeLists.txt file
cmake_minimum_required(VERSION 3.0)
project(test)
find_package(Arrow REQUIRED)
add_executable(test.o test.cpp)
target_link_libraries(test.o PRIVATE arrow_shared)
Third step:
cmake .
make
Fourth step (execute the test project):
./test.o

How to fix "undefined reference to `YAML::operator<<(std::ostream&, YAML::Node const&)'" in cmake

I did a project in manjaro, then decided to switch to ubuntu and everything flew to hell. I've installed libpoco-dev, libtinyxml2-dev and libyaml-cpp-dev
my cmakelist file:
cmake_minimum_required(VERSION 3.13)
project(auchan_handler_microservice)
set(CMAKE_CXX_STANDARD 17)
set(GCC_COVERAGE_COMPILE_FLAGS "-Wall -Werror")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GCC_COVERAGE_COMPILE_FLAGS}")
set(LIB_DIR "${PROJECT_SOURCE_DIR}/extern")
add_executable(auchan_handler_microservice main.cc)
include_directories(src)
add_subdirectory(src)
option(PACKAGE_TESTS "Build the tests" ON)
if (PACKAGE_TESTS)
enable_testing()
add_subdirectory(tests)
endif ()
find_package(Poco REQUIRED Foundation Net Util DataMySQL)
target_link_libraries(auchan_handler_microservice src)
target_link_libraries(auchan_handler_microservice yaml-cpp tinyxml2)
target_link_libraries(auchan_handler_microservice Poco::Net Poco::Util Poco::DataMySQL)
error:
/usr/bin/ld: ../src/libsrc.a(app.cc.o): in function `Application::main(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&)':
/home/sschiz/CLionProjects/auchan-handler-microservice/src/server_application/app.cc:29: undefined reference to `YAML::LoadFile(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/bin/ld: /home/sschiz/CLionProjects/auchan-handler-microservice/src/server_application/app.cc:31: undefined reference to `YAML::operator<<(std::ostream&, YAML::Node const&)'
/usr/bin/ld: /home/sschiz/CLionProjects/auchan-handler-microservice/src/server_application/app.cc:38: undefined reference to `Poco::Net::HTTPServerParams::HTTPServerParams()'
/usr/bin/ld: /home/sschiz/CLionProjects/auchan-handler-microservice/src/server_application/app.cc:38: undefined reference to `Poco::Net::ServerSocket::ServerSocket(unsigned short, int)'
/usr/bin/ld: /home/sschiz/CLionProjects/auchan-handler-microservice/src/server_application/app.cc:38: undefined reference to `Poco::Net::HTTPServer::HTTPServer(Poco::SharedPtr<Poco::Net::HTTPRequestHandlerFactory, Poco::ReferenceCounter, Poco::ReleasePolicy<Poco::Net::HTTPRequestHandlerFactory> >, Poco::Net::ServerSocket const&, Poco::AutoPtr<Poco::Net::HTTPServerParams>)'
/usr/bin/ld: /home/sschiz/CLionProjects/auchan-handler-microservice/src/server_application/app.cc:38: undefined reference to `Poco::Net::ServerSocket::~ServerSocket()'
/usr/bin/ld: /home/sschiz/CLionProjects/auchan-handler-microservice/src/server_application/app.cc:39: undefined reference to `Poco::Net::TCPServer::start()'
/usr/bin/ld: /home/sschiz/CLionProjects/auchan-handler-microservice/src/server_application/app.cc:41: undefined reference to `Poco::Util::ServerApplication::waitForTerminationRequest()'
/usr/bin/ld: /home/sschiz/CLionProjects/auchan-handler-microservice/src/server_application/app.cc:38: undefined reference to `Poco::Net::HTTPServer::~HTTPServer()'
/usr/bin/ld: /home/sschiz/CLionProjects/auchan-handler-microservice/src/server_application/app.cc:38: undefined reference to `Poco::Net::ServerSocket::~ServerSocket()'
/usr/bin/ld: /home/sschiz/CLionProjects/auchan-handler-microservice/src/server_application/app.cc:38: undefined reference to `Poco::Net::HTTPServer::~HTTPServer()'
/usr/bin/ld: ../src/libsrc.a(app.cc.o): in function `Poco::Net::Impl::IPv4SocketAddressImpl::host() const':
/usr/include/Poco/Net/SocketAddressImpl.h:81: undefined reference to `Poco::Net::IPAddress::IPAddress(void const*, unsigned int)'
/usr/bin/ld: ../src/libsrc.a(app.cc.o): in function `Poco::Net::Impl::IPv6SocketAddressImpl::host() const':
/usr/include/Poco/Net/SocketAddressImpl.h:143: undefined reference to `Poco::Net::IPAddress::IPAddress(void const*, unsigned int, unsigned int)'
/usr/bin/ld: ../src/libsrc.a(app.cc.o): in function `YAML::Exception::Exception(YAML::Mark const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
/usr/include/yaml-cpp/exceptions.h:122: undefined reference to `vtable for YAML::Exception'
/usr/bin/ld: ../src/libsrc.a(app.cc.o): in function `YAML::RepresentationException::RepresentationException(YAML::Mark const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
/usr/include/yaml-cpp/exceptions.h:155: undefined reference to `vtable for YAML::RepresentationException'
/usr/bin/ld: ../src/libsrc.a(app.cc.o): in function `YAML::InvalidNode::InvalidNode()':
/usr/include/yaml-cpp/exceptions.h:198: undefined reference to `vtable for YAML::InvalidNode'
/usr/bin/ld: ../src/libsrc.a(app.cc.o): in function `YAML::BadSubscript::BadSubscript()':
/usr/include/yaml-cpp/exceptions.h:228: undefined reference to `vtable for YAML::BadSubscript'
/usr/bin/ld: ../src/libsrc.a(app.cc.o): in function `YAML::detail::memory_holder::create_node()':
/usr/include/yaml-cpp/node/detail/memory.h:37: undefined reference to `YAML::detail::memory::create_node()'
/usr/bin/ld: ../src/libsrc.a(app.cc.o): in function `YAML::detail::node_ref::mark_defined()':
/usr/include/yaml-cpp/node/detail/node_ref.h:30: undefined reference to `YAML::detail::node_data::mark_defined()'
/usr/bin/ld: ../src/libsrc.a(app.cc.o): in function `YAML::detail::node_ref::set_null()':
/usr/include/yaml-cpp/node/detail/node_ref.h:36: undefined reference to `YAML::detail::node_data::set_null()'
/usr/bin/ld: ../src/libsrc.a(app.cc.o): in function `YAML::detail::node_ref::set_scalar(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
/usr/include/yaml-cpp/node/detail/node_ref.h:37: undefined reference to `YAML::detail::node_data::set_scalar(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/bin/ld: ../src/libsrc.a(app.cc.o): in function `YAML::Node::EnsureNodeExists() const':
/usr/include/yaml-cpp/node/impl.h:54: undefined reference to `YAML::InvalidNode::~InvalidNode()'
/usr/bin/ld: /usr/include/yaml-cpp/node/impl.h:54: undefined reference to `typeinfo for YAML::InvalidNode'
/usr/bin/ld: ../src/libsrc.a(app.cc.o): in function `YAML::Node::Type() const':
/usr/include/yaml-cpp/node/impl.h:78: undefined reference to `YAML::InvalidNode::~InvalidNode()'
/usr/bin/ld: /usr/include/yaml-cpp/node/impl.h:78: undefined reference to `typeinfo for YAML::InvalidNode'
/usr/bin/ld: ../src/libsrc.a(app.cc.o): in function `YAML::Node::Scalar[abi:cxx11]() const':
/usr/include/yaml-cpp/node/impl.h:158: undefined reference to `YAML::InvalidNode::~InvalidNode()'
/usr/bin/ld: /usr/include/yaml-cpp/node/impl.h:158: undefined reference to `typeinfo for YAML::InvalidNode'
/usr/bin/ld: /usr/include/yaml-cpp/node/impl.h:159: undefined reference to `YAML::detail::node_data::empty_scalar[abi:cxx11]'
/usr/bin/ld: ../src/libsrc.a(app.cc.o): in function `void YAML::Node::Assign<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
/usr/include/yaml-cpp/node/impl.h:222: undefined reference to `YAML::InvalidNode::~InvalidNode()'
/usr/bin/ld: /usr/include/yaml-cpp/node/impl.h:222: undefined reference to `typeinfo for YAML::InvalidNode'
/usr/bin/ld: ../src/libsrc.a(app.cc.o): in function `HandlerFactory::HandlerFactory()':
/home/sschiz/CLionProjects/auchan-handler-microservice/src/request_handler_factory/handler_factory.h:9: undefined reference to `Poco::Net::HTTPRequestHandlerFactory::HTTPRequestHandlerFactory()'
/usr/bin/ld: ../src/libsrc.a(app.cc.o): in function `YAML::Node YAML::Node::operator[]<char [5]>(char const (&) [5])':
/usr/include/yaml-cpp/node/impl.h:388: undefined reference to `YAML::InvalidNode::~InvalidNode()'
/usr/bin/ld: /usr/include/yaml-cpp/node/impl.h:388: undefined reference to `typeinfo for YAML::InvalidNode'
/usr/bin/ld: ../src/libsrc.a(app.cc.o): in function `YAML::detail::node& YAML::detail::node_data::get<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::shared_ptr<YAML::detail::memory_holder>)':
/usr/include/yaml-cpp/node/detail/impl.h:112: undefined reference to `YAML::detail::node_data::convert_to_map(std::shared_ptr<YAML::detail::memory_holder>)'
/usr/bin/ld: /usr/include/yaml-cpp/node/detail/impl.h:115: undefined reference to `YAML::BadSubscript::~BadSubscript()'
/usr/bin/ld: /usr/include/yaml-cpp/node/detail/impl.h:115: undefined reference to `typeinfo for YAML::BadSubscript'
/usr/bin/ld: /usr/include/yaml-cpp/node/detail/impl.h:126: undefined reference to `YAML::detail::node_data::insert_map_pair(YAML::detail::node&, YAML::detail::node&)'
/usr/bin/ld: ../src/libsrc.a(app.cc.o): in function `YAML::detail::node& YAML::detail::node_data::convert_to_node<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::shared_ptr<YAML::detail::memory_holder>)':
/usr/include/yaml-cpp/node/detail/impl.h:179: undefined reference to `YAML::detail::memory_holder::merge(YAML::detail::memory_holder&)'
/usr/bin/ld: ../src/libsrc.a(app.cc.o):(.data.rel.ro._ZTV11Application[_ZTV11Application]+0x20): undefined reference to `Poco::Util::Application::name() const'
/usr/bin/ld: ../src/libsrc.a(app.cc.o):(.data.rel.ro._ZTV11Application[_ZTV11Application]+0x28): undefined reference to `Poco::Util::Application::initialize(Poco::Util::Application&)'
/usr/bin/ld: ../src/libsrc.a(app.cc.o):(.data.rel.ro._ZTV11Application[_ZTV11Application]+0x30): undefined reference to `Poco::Util::Application::uninitialize()'
/usr/bin/ld: ../src/libsrc.a(app.cc.o):(.data.rel.ro._ZTV11Application[_ZTV11Application]+0x38): undefined reference to `Poco::Util::Application::reinitialize(Poco::Util::Application&)'
/usr/bin/ld: ../src/libsrc.a(app.cc.o):(.data.rel.ro._ZTV11Application[_ZTV11Application]+0x40): undefined reference to `Poco::Util::ServerApplication::defineOptions(Poco::Util::OptionSet&)'
/usr/bin/ld: ../src/libsrc.a(app.cc.o):(.data.rel.ro._ZTV11Application[_ZTV11Application]+0x48): undefined reference to `Poco::Util::ServerApplication::run()'
/usr/bin/ld: ../src/libsrc.a(app.cc.o):(.data.rel.ro._ZTV11Application[_ZTV11Application]+0x50): undefined reference to `Poco::Util::Application::handleOption(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&)'
/usr/bin/ld: ../src/libsrc.a(app.cc.o): in function `Application::~Application()':
/home/sschiz/CLionProjects/auchan-handler-microservice/src/server_application/app.h:11: undefined reference to `Poco::Util::ServerApplication::~ServerApplication()'
/usr/bin/ld: ../src/libsrc.a(app.cc.o):(.data.rel.ro._ZTVN4Poco3Net4Impl21IPv6SocketAddressImplE[_ZTVN4Poco3Net4Impl21IPv6SocketAddressImplE]+0x50): undefined reference to `Poco::Net::Impl::IPv6SocketAddressImpl::toString[abi:cxx11]() const'
/usr/bin/ld: ../src/libsrc.a(app.cc.o): in function `Poco::Net::Impl::IPv6SocketAddressImpl::~IPv6SocketAddressImpl()':
/usr/include/Poco/Net/SocketAddressImpl.h:118: undefined reference to `Poco::Net::Impl::SocketAddressImpl::~SocketAddressImpl()'
/usr/bin/ld: ../src/libsrc.a(app.cc.o):(.data.rel.ro._ZTVN4Poco3Net4Impl21IPv4SocketAddressImplE[_ZTVN4Poco3Net4Impl21IPv4SocketAddressImplE]+0x50): undefined reference to `Poco::Net::Impl::IPv4SocketAddressImpl::toString[abi:cxx11]() const'
/usr/bin/ld: ../src/libsrc.a(app.cc.o): in function `Poco::Net::Impl::IPv4SocketAddressImpl::~IPv4SocketAddressImpl()':
/usr/include/Poco/Net/SocketAddressImpl.h:56: undefined reference to `Poco::Net::Impl::SocketAddressImpl::~SocketAddressImpl()'
/usr/bin/ld: ../src/libsrc.a(app.cc.o):(.data.rel.ro._ZTIN4Poco3Net4Impl21IPv6SocketAddressImplE[_ZTIN4Poco3Net4Impl21IPv6SocketAddressImplE]+0x10): undefined reference to `typeinfo for Poco::Net::Impl::SocketAddressImpl'
/usr/bin/ld: ../src/libsrc.a(app.cc.o):(.data.rel.ro._ZTIN4Poco3Net4Impl21IPv4SocketAddressImplE[_ZTIN4Poco3Net4Impl21IPv4SocketAddressImplE]+0x10): undefined reference to `typeinfo for Poco::Net::Impl::SocketAddressImpl'
/usr/bin/ld: ../src/libsrc.a(app.cc.o):(.data.rel.ro._ZTI11Application[_ZTI11Application]+0x10): undefined reference to `typeinfo for Poco::Util::ServerApplication'
/usr/bin/ld: ../src/libsrc.a(app.cc.o):(.data.rel.local.DW.ref._ZTIN4YAML9ExceptionE[DW.ref._ZTIN4YAML9ExceptionE]+0x0): undefined reference to `typeinfo for YAML::Exception'
/usr/bin/ld: ../src/libsrc.a(handler_factory.cc.o): in function `RequestHandler::RequestHandler()':
/home/sschiz/CLionProjects/auchan-handler-microservice/src/request_handler/request_handler.h:9: undefined reference to `Poco::Net::HTTPRequestHandler::HTTPRequestHandler()'
/usr/bin/ld: ../src/libsrc.a(handler_factory.cc.o): in function `HandlerFactory::~HandlerFactory()':
/home/sschiz/CLionProjects/auchan-handler-microservice/src/request_handler_factory/handler_factory.h:9: undefined reference to `Poco::Net::HTTPRequestHandlerFactory::~HTTPRequestHandlerFactory()'
/usr/bin/ld: ../src/libsrc.a(handler_factory.cc.o):(.data.rel.ro._ZTI14HandlerFactory[_ZTI14HandlerFactory]+0x10): undefined reference to `typeinfo for Poco::Net::HTTPRequestHandlerFactory'
/usr/bin/ld: ../src/libsrc.a(request_handler.cc.o): in function `RequestHandler::handleRequest(Poco::Net::HTTPServerRequest&, Poco::Net::HTTPServerResponse&)':
/home/sschiz/CLionProjects/auchan-handler-microservice/src/request_handler/request_handler.cc:20: undefined reference to `Poco::Net::HTTPMessage::getContentLength() const'
/usr/bin/ld: /home/sschiz/CLionProjects/auchan-handler-microservice/src/request_handler/request_handler.cc:22: undefined reference to `Poco::Net::HTTPResponse::setStatus(Poco::Net::HTTPResponse::HTTPStatus)'
/usr/bin/ld: /home/sschiz/CLionProjects/auchan-handler-microservice/src/request_handler/request_handler.cc:24: undefined reference to `Poco::Net::HTTPMessage::getContentLength() const'
/usr/bin/ld: /home/sschiz/CLionProjects/auchan-handler-microservice/src/request_handler/request_handler.cc:27: undefined reference to `Poco::Net::HTTPRequest::HTTP_POST[abi:cxx11]'
/usr/bin/ld: /home/sschiz/CLionProjects/auchan-handler-microservice/src/request_handler/request_handler.cc:29: undefined reference to `Poco::Net::HTTPMessage::getContentLength() const'
/usr/bin/ld: /home/sschiz/CLionProjects/auchan-handler-microservice/src/request_handler/request_handler.cc:32: undefined reference to `tinyxml2::XMLDocument::XMLDocument(bool, tinyxml2::Whitespace)'
/usr/bin/ld: /home/sschiz/CLionProjects/auchan-handler-microservice/src/request_handler/request_handler.cc:33: undefined reference to `tinyxml2::XMLDocument::Parse(char const*, unsigned long)'
/usr/bin/ld: /home/sschiz/CLionProjects/auchan-handler-microservice/src/request_handler/request_handler.cc:36: undefined reference to `tinyxml2::XMLElement::GetText() const'
/usr/bin/ld: /home/sschiz/CLionProjects/auchan-handler-microservice/src/request_handler/request_handler.cc:32: undefined reference to `tinyxml2::XMLDocument::~XMLDocument()'
/usr/bin/ld: /home/sschiz/CLionProjects/auchan-handler-microservice/src/request_handler/request_handler.cc:32: undefined reference to `tinyxml2::XMLDocument::~XMLDocument()'
/usr/bin/ld: ../src/libsrc.a(request_handler.cc.o): in function `RequestHandler::~RequestHandler()':
/home/sschiz/CLionProjects/auchan-handler-microservice/src/request_handler/request_handler.h:9: undefined reference to `Poco::Net::HTTPRequestHandler::~HTTPRequestHandler()'
/usr/bin/ld: ../src/libsrc.a(request_handler.cc.o):(.data.rel.ro._ZTI14RequestHandler[_ZTI14RequestHandler]+0x10): undefined reference to `typeinfo for Poco::Net::HTTPRequestHandler'
collect2: error: ld returned 1 exit status
make[2]: *** [tests/CMakeFiles/list_status_path_test.dir/build.make:100: tests/list_status_path_test] Ошибка 1
make[1]: *** [CMakeFiles/Makefile2:190: tests/CMakeFiles/list_status_path_test.dir/all] Ошибка 2
make: *** [Makefile:141: all]