Answer the question
In order to leave comments, you need to log in
Need help installing opencv in termux. Who can help?
Followed this instruction - keep.01ue.com/?pi=785007&_a=app&_c=index&_m=p
At step 5, when I run make, an error occurs at 50%:
$ make
[ 2%] Built target zlib
[ 5%] Built target libjpeg-turbo
[ 8%] Built target libtiff
[ 16%] Built target libwebp
[ 19%] Built target libjasper
[ 21%] Built target libpng
[ 26%] Built target IlmImf
[ 31%] Built target libprotobuf
[ 31%] Built target quirc
[ 35%] Built target carotene_objs
[ 35%] Built target tegra_hal
[ 36%] Built target ade
[ 36%] Built target opencv_videoio_plugins
[ 42%] Built target opencv_core
[ 46%] Built target opencv_imgproc
[ 48%] Built target opencv_imgcodecs
[ 49%] Built target opencv_videoio
[ 49%] Built target opencv_highgui
[ 50%] Built target opencv_ts
[ 50%] Linking CXX executable ../../bin/opencv_perf_core
/data/data/com.termux/files/usr/bin/arm-linux-androideabi-ld: ../../lib/libopencv_ts.a(ts_perf.cpp.o): in function `cv::operator<<(std::__ndk1::basic_ostream<char, std::__ndk1::char_traits<char> >&, cv::Mat const&)': ts_perf.cpp:(.text._ZN2cvlsERNSt6__ndk113basic_ostreamIcNS0_11char_traitsIcEEEERKNS_3MatE+0xb8): undefined reference to `__atomic_fetch_add_4' /data/data/com.termux/files/usr/bin/arm-linux-androideabi-ld: ts_perf.cpp:(.text._ZN2cvlsERNSt6__ndk113basic_ostreamIcNS0_11char_traitsIcEEEERKNS_3MatE+0xdc): undefined reference to `__atomic_fetch_add_4' /data/data/com.termux/files/usr/bin/arm-linux-androideabi-ld: ts_perf.cpp:(.text._ZN2cvlsERNSt6__ndk113basic_ostreamIcNS0_11char_traitsIcEEEERKNS_3MatE+0x198): undefined reference to `__atomic_fetch_add_4' /data/data/com.termux/files/usr/bin/arm-linux-androideabi-ld: ts_perf.cpp:(.text._ZN2cvlsERNSt6__ndk113basic_ostreamIcNS0_11char_traitsIcEEEERKNS_3MatE+0x1d8): undefined reference to `__atomic_fetch_add_4' /data/data/com.termux/files/usr/bin/arm-linux-androideabi-ld: ../../lib/libopencv_core.so.4.1.0: undefined reference to `__atomic_fetch_sub_8'
/data/data/com.termux/files/usr/bin/arm-linux-androideabi-ld: ../../lib/libopencv_core.so.4.1.0: undefined reference to `__atomic_load_4' /data/data/com.termux/files/usr/bin/arm-linux-androideabi-ld: ../../lib/libopencv_core.so.4.1.0: undefined reference to `__atomic_load_8' /data/data/com.termux/files/usr/bin/arm-linux-androideabi-ld: ../../lib/libopencv_core.so.4.1.0: undefined reference to `__atomic_store_4' /data/data/com.termux/files/usr/bin/arm-linux-androideabi-ld: ../../lib/libopencv_core.so.4.1.0: undefined reference to `__atomic_compare_exchange_8' /data/data/com.termux/files/usr/bin/arm-linux-androideabi-ld: ../../lib/libopencv_core.so.4.1.0: undefined reference to `__atomic_load_1' /data/data/com.termux/files/usr/bin/arm-linux-androideabi-ld: ../../lib/libopencv_core.so.4.1.0: undefined reference to `__atomic_store_1' /data/data/com.termux/files/usr/bin/arm-linux-androideabi-ld: ../../lib/libopencv_core.so.4.1.0: undefined reference to `__atomic_fetch_add_8'
/data/data/com.termux/files/usr/bin/arm-linux-androideabi-ld: /data/data/com.termux/files/usr/bin/arm-linux-androideabi-ld generated: undefined reference to `__atomic_fetch_add_4' clang-8: error: linker command failed with exit code 1 (use -v to see invocation) make[2]: *** [modules/core/CMakeFiles/opencv_perf_core.dir/build.make:542: bin/opencv_perf_core] Error 1 make[1]: *** [CMakeFiles/Makefile2:1595: modules/core/CMakeFiles/opencv_perf_core.dir/all] Error 2
make: *** [Makefile:163: all] Error 2
$
Answer the question
In order to leave comments, you need to log in
Judging by undefined reference to `__atomic_fetch_add_4'
the processor used does not have the necessary atomic instructions and the compiler is trying to use the libatomic library. Try adding it to the flags:LDFLAGS=" -llog -lpython3 -latomic" ...
Most likely, the error is in the action of the 5th step:
There should be 2 dots at the end (indicates the parent directory).
And first, of course, go to the build directory:cd build
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question