Hi,
I am doing cross compile my code with the library OpenCV in my Ubuntu16.4 for Jetson TX2.
However, I encounter the error when I compile my code which call Opencv.
Here is the error log:
/home/jetson/my_jetson_doc/gcc_bin/install/bin/aarch64-unknown-linux-gnu-g++ -std=c++11 -std=c++11 -O3 -DNDEBUG -L /home/my_project/engined_cross_compile-half-way -Xlinker -Map=engined.map -L/usr/local/cuda/targets/aarch64-linux/lib -L/home/my_project/engined_cross_compile-half-way/lib/aarch64 -L -nostartfiles -lstdc++ CMakeFiles/engined.dir/main.c.o CMakeFiles/engined.dir/mqtt.c.o CMakeFiles/engined.dir/hopseq.c.o CMakeFiles/engined.dir/detect_all_freq.c.o CMakeFiles/engined.dir/capture_manager.c.o CMakeFiles/engined.dir/lic.c.o CMakeFiles/engined.dir/cfg.c.o CMakeFiles/engined.dir/input_manager.c.o CMakeFiles/engined.dir/usd_segmentation.c.o CMakeFiles/engined.dir/usd_tx.c.o CMakeFiles/engined.dir/parse_capture_msg.c.o CMakeFiles/engined.dir/data_visualization.c.o CMakeFiles/engined.dir/cuda_interface.c.o -o engined -rdynamic 3rd/libevent/lib/libevent.a 3rd/tinycthread/libtinycthread.a 3rd/queue/libmpmcqueue.a -lpthread engine/libengine.a -lm utils/libutils.a 3rd/mqtt/src/libpaho-mqtt3cs-static.a -lssl -lcrypto -lfftw3f -lfftw3f_threads 3rd/libyaml/libyaml_static.a -lopencv_calib3d -lopencv_core -lopencv_dnn -lopencv_features2d -lopencv_flann -lopencv_imgproc -lopencv_ml -lopencv_objdetect -lopencv_photo -lstdc++ -lcudart -lcufft /usr/local/cuda/targets/aarch64-linux/lib/libcufft.so …/dronecuda/build/libdronecufft.a /usr/local/lib/libopencv_calib3d.so -lpthread -lc -ldl -lpthread -Wl,-rpath,/usr/local/cuda/targets/aarch64-linux/lib:/usr/local/lib
/home/my_project/engined_cross_compile-half-way/lib/aarch64/libopencv_dnn.so:for ‘std::__cxx11::basic_string<char, std::char_traits, std::allocator >::compare(unsigned long, unsigned long, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&) const@GLIBCXX_3.4.21’undefined reference.
/home/my_project/engined_cross_compile-half-way/lib/aarch64/libopencv_core.so:for ‘VTT for std::__cxx11::basic_stringstream<char, std::char_traits, std::allocator >@GLIBCXX_3.4.21’undefined reference.
/home/my_project/engined_cross_compile-half-way/lib/aarch64/libopencv_calib3d.so:for ‘std::__throw_out_of_range_fmt(char const*, …)@GLIBCXX_3.4.20’undefined reference.
/home/my_project/engined_cross_compile-half-way/lib/aarch64/libopencv_dnn.so:for ‘std::__cxx11::basic_string<char, std::char_traits, std::allocator >::find_first_not_of(char const*, unsigned long, unsigned long) const@GLIBCXX_3.4.21’undefined reference.
/home/my_project/engined_cross_compile-half-way/lib/aarch64/libopencv_dnn.so:for ‘std::__cxx11::basic_string<char, std::char_traits, std::allocator >::assign(char const*)@GLIBCXX_3.4.21’undefined reference.
/home/my_project/engined_cross_compile-half-way/lib/aarch64/libopencv_core.so:for ‘std::__cxx11::basic_ostringstream<char, std::char_traits, std::allocator >::basic_ostringstream(std::_Ios_Openmode)@GLIBCXX_3.4.21’undefined reference.
/home/my_project/engined_cross_compile-half-way/lib/aarch64/libopencv_dnn.so:for ‘std::__cxx11::basic_string<char, std::char_traits, std::allocator >::~basic_string()@GLIBCXX_3.4.21’undefined reference.
I googled it. The issue is caused by the different version of “LIBCXX” in my Ubuntu and Jetson TX2.
In my Ubuntu I use the aarch64 cross compile tool chain from Jetson TX2 webside.This tool chain is old.
The version of “LIBCXX” is “GLIBCXX_3.4.19”. I used “strings /usr/lib/aarch64-linux-gnu/libstdc++.so.6 |grep LIBCXX” to get the version number.
In Jetson TX2 board the version of “GLIBCXX_3.4.21”.
The root cause of the issue is the incompatible of different version of compiler.
Please help check if there is new cross compile tool chain which use “GLIBCXX_3.4.21”.
If there is not such toolchain, what can I do? Downgrade the gcc version in Jetson TX2?
It is really urgent issue.Thank you.
Best Regards,
Steven