vita
July 16, 2025, 3:13pm
1
Our program is developed under opencv 4.6, now the new environment is opencv 4.11 installed. It shows 127 error when i run the code.
I assume it is mixing library problem. how can i make the independent library 406 substituted library 411?
$ ldd xxxx | grep opencv
libopencv_aruco.so.406 => /usr/local/lib/libopencv_aruco.so.406 (0x0000ffffa0ab0000)
libopencv_objdetect.so.406 => /usr/local/lib/libopencv_objdetect.so.406 (0x0000ffffa0990000)
libopencv_calib3d.so.406 => /usr/local/lib/libopencv_calib3d.so.406 (0x0000ffffa0760000)
libopencv_imgcodecs.so.406 => /usr/local/lib/libopencv_imgcodecs.so.406 (0x0000ffffa0680000)
libopencv_features2d.so.406 => /usr/local/lib/libopencv_features2d.so.406 (0x0000ffffa05c0000)
libopencv_imgproc.so.406 => /usr/local/lib/libopencv_imgproc.so.406 (0x0000ffffa0140000)
libopencv_core.so.406 => /usr/local/lib/libopencv_core.so.406 (0x0000ffff9f5c0000)
libopencv_dnn.so.411 => /usr/local/lib/libopencv_dnn.so.411 (0x0000ffff9c8b0000)
libopencv_flann.so.411 => /usr/local/lib/libopencv_flann.so.411 (0x0000ffff9c820000)
yes, you cannot combine parts of opencv that have different versions. they should all be of the same version. if you do mix them, expect issues. I can’t guarantee that it’ll always fail but the chances of that going well are very slim.
how did you accomplish that linkage anyway? were there particular reasons to attempt this?
vita
July 17, 2025, 6:45am
3
Dear Crackwitz, thank you for your attention.
Yes, I did manually mixed link different versions of OpenCV libraries (4.6 and 4.11). This happens when:
The original program is compiled with OpenCV 4.6 to generate binaries (computeCalibration
and applyCalibration
)
After the system upgrade, I installed OpenCV 4.11 as the main development environment
When running the Python GUI (which depends on OpenCV 4.11), it loads a mixture of old and new shared libraries
technical background:
This mixed linking is achieved by:
Explicit library path specification at compile time (-L/path/to/opencv4.6/lib
)
LD_LIBRARY_PATH
environment variable conflict at runtime
Include path confusion caused by not thoroughly cleaning up old header files
3.motivation for upgrading:
The main reasons for my upgrade to OpenCV 4.11 are:
Need 4.8+ version for GPU acceleration support for Jetson Orin Nano
Fix the GStreamer memory leak problem in 4.6
Use the DNN module optimization newly added in 4.11
Thank you
so… can you recompile the program? then the solution is simple. do that, against one version of opencv.