So arbeite ich nicht auf einem Computer, sondern auf einem eingebetteten Gerät mit Ubuntu.Linux Compilation - widersprüchliche Bibliotheken
Ich versuche, OpenCV-Code zu kompilieren, aber ich habe das Gefühl, dass ich in einer Sackgasse bin!
Dies ist der Fehler, den ich bekommen: Problem:
/usr/bin/ld: warning: libopencv_core.so.3.2, needed by //usr/local/lib/libopencv_imgcodecs.so, may conflict with libopencv_core.so.2.4
/usr/bin/ld: /tmp/ccYlsBYW.o: undefined reference to symbol '_ZN2cv11setIdentityERKNS_17_InputOutputArrayERKNS_7Scalar_IdEE'
/usr/local/lib//libopencv_core.so.3.2: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
2,4 Bibliotheken umbenennen:
[email protected]:/usr/lib$ sudo mv libopencv_core.so libopencv_core.soMyOld
[email protected]:/usr/lib$ sudo mv libopencv_core.so.2.4 libopencv_core.so.2.4MyOld
[email protected]:/usr/lib$ sudo mv libopencv_core.so.2.4.10 libopencv_core.so.2.4.10MyOld
recompile Code
/usr/bin/ld: warning: libopencv_core.so.2.4, needed by /usr/lib/gcc/arm-linux-gnueabihf/4.8/../../../../lib/libopencv_imgproc.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libopencv_imgproc.so.3.2, needed by //usr/local/lib/libopencv_imgcodecs.so, may conflict with libopencv_imgproc.so.2.4
/usr/bin/ld: /tmp/ccmcvWug.o: undefined reference to symbol '_ZN2cv6circleERKNS_17_InputOutputArrayENS_6Point_IiEEiRKNS_7Scalar_IdEEiii'
/usr/local/lib//libopencv_imgproc.so.3.2: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
3,2 Bibliotheken Umbenennung:
[email protected]:/usr/local/lib$ sudo mv libopencv_core.so
[email protected]:/usr/local/lib$ sudo mv libopencv_core.so.3.2 libopencv_core.so.3.2MyOld
[email protected]:/usr/local/lib$ sudo mv libopencv_core.so.3.2.0 libopencv_core.so.3.2.0MyOld
recompile
/usr/bin/ld: warning: libopencv_core.so.3.2, needed by //usr/local/lib/libopencv_imgcodecs.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libopencv_imgproc.so.3.2, needed by //usr/local/lib/libopencv_imgcodecs.so, may conflict with libopencv_imgproc.so.2.4
/usr/bin/ld: /tmp/cclHSHtB.o: undefined reference to symbol '_ZN2cv6circleERKNS_17_InputOutputArrayENS_6Point_IiEEiRKNS_7Scalar_IdEEiii'
/usr/local/lib//libopencv_imgproc.so.3.2: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
Was kann ich tun, um dieses Problem zu lösen? alles Deinstallation und Neuinstallation ist keine Option ...
EDIT:
ich mit diesem Befehl kompilieren:
g++ src/personDetection.cpp src/personRecognition.cpp main.cpp -lopencv_core -lopencv_imgproc -lopencv_highgui -lopencv_imgcodecs -lopencv_calib3d -lopencv_features2d -lopencv_video -lopencv_videoio -pthread -o main
Ich denke, Sie sind auf einem Tegra-Board.Vielleicht sollten Sie die standardmäßig installierte OpenCV-Bibliothek entfernen: 'OpenCV4Tegra'. – nglee
@devnglee "vielleicht"? Warum bist du dir nicht sicher? Btw beachten Sie, dass die Fehler nicht über opencv Version 4 sind wie die, auf die Sie sich beziehen, und auf meinem Board gab es keine standardmäßig installierte openCV. – LandonZeKepitelOfGreytBritn
'opencv4tegra' steht für opencv für tegra. Vergiss das, wenn dein Board das nicht hatte. Du hast also 2.4 bereits installiert und versuchst 3.2 zu installieren? – nglee