tld 演算法移植到arm開發板(6410) (一)

來源:互聯網
上載者:User

環境:ubuntu10.04 + s3c6410

交叉編譯工具鏈:光碟片內建的arm-linux-4.4.1

opencv動態庫已經交叉編譯好(上一篇),複製到開發板 /lib/下

1,vim開啟src/下的CMakeLists.txt,增加:

    set(CMAKE_SYSTEM_NAME linux)
    set(CMAKE_C_COMPILER "/usr/local/arm/4.4.1/bin/arm-linux-gcc")
    set(CMAKE_CXX_COMPILER "/usr/local/arm/4.4.1/bin/arm-linux-g++")
設定c,c++使用的編譯器。
編譯源碼,報錯:

/usr/local/opencv-arm/lib/libopencv_core.so: undefined reference to `pthread_key_create'/usr/local/opencv-arm/lib/libopencv_core.so: undefined reference to `pthread_getspecific'/usr/local/opencv-arm/lib/libopencv_core.so: undefined reference to `clock_gettime'/usr/local/opencv-arm/lib/libopencv_core.so: undefined reference to `pthread_setspecific'

為解決這個問題,在CMakeLists.txt增加:
set(CMAKE_EXE_LINKER_FLAGS "-lpthread -lrt")

這樣,就可以在make的時候添加編譯選項,連結相應的動態庫。

然後按著README中的:

mkdir build
cd build
cmake ../src/
make
cd ../bin/
再次編譯成功,得到執行檔案run_tld.

2,通過隨身碟拷貝到ok6410上,運行./run_tld,報錯:


./run_tld: /lib/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by ./run_tld)./run_tld: /lib/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by /lib/libopencv_features2d.)./run_tld: /lib/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by /lib/libopencv_contrib.so)

這是由於libstdc++.so版本低。
我複製 主機上/usr/lib目錄下的libstdc++.so到ok6410的 /lib目錄下
再次運行,上面的問題得以解決。
同時有新的報錯:
./run_tld: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory

再查閱其他的資料,我發現我拷貝的libstdc++.so不對,應該是嵌入式對應的和 pc對應的不是一樣的。
從交叉編譯包目錄下 /usr/local/arm/4.4.1/arm-none-linux-gnueabi/libc/usr/lib/libstdc++.so.6.0.12 拷貝到 板子的/lib下
重建立立軟連結 ln -s libstdc++.so.6.0.12 libstdc++.so.6 。
問題解決,可以運行了。

演算法運行後但是沒有開啟 網路攝影機裝置,演算法列印出“capture device failed to open! ”

明天再來解決這個問題。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.