所以我不是在計算機上工作,而是在運行Ubuntu的嵌入式設備上。Linux編譯 - 衝突的庫
我想編譯openCV代碼,但我感覺我處於僵局之中!
這是我的錯誤: 問題:
/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庫:
[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
重新編譯代碼
/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庫:
[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
重新編譯
/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
我能做些什麼來解決這個問題?一切卸載並重新安裝是不是一種選擇...
編輯:
我用這個命令編譯:
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
我想你是在一個tegra板上。也許你應該刪除默認安裝的OpenCV庫:'OpenCV4Tegra'。 – nglee
@devnglee「也許」?你爲什麼不確定?順便說一句,錯誤不是關於opencv版本4,就像你指的那樣,在我的主板上沒有安裝openCV的默認設置。 – LandonZeKepitelOfGreytBritn
'opencv4tegra'代表tegra的opencv。忘記,如果你的董事會沒有。所以你已經安裝了2.4並試圖安裝3.2? – nglee