跳到內容
  • 版面
  • 最新
  • 標籤
  • 熱門
  • 使用者
  • 群組
  • 搜尋
  • Get Qt Extensions
  • Unsolved
Collapse
品牌標誌
  1. 首頁
  2. Qt Development
  3. Mobile and Embedded
  4. External libraries on Raspberry Pi 3 B+
Forum Updated to NodeBB v4.3 + New Features

External libraries on Raspberry Pi 3 B+

已排程 已置頂 已鎖定 已移動 Solved Mobile and Embedded
28 貼文 7 Posters 7.5k 瀏覽 2 Watching
  • 從舊到新
  • 從新到舊
  • 最多點贊
回覆
  • 在新貼文中回覆
登入後回覆
此主題已被刪除。只有擁有主題管理權限的使用者可以查看。
  • C 離線
    C 離線
    Crindu
    寫於 最後由 編輯
    #4

    @koahnig @mrjj Thank you for the answers. I finally downloaded and compiled the library with the cross compiler. Then I added this in the pro file:
    INCLUDEPATH += /path/include
    LIBS += -L/path/lib -lavdevice
    Now I can include correctly the headers, but at run time I have an undefined reference error to the function called. Some ideas?

    aha_1980A 1 條回覆 最後回覆
    0
    • C Crindu

      @koahnig @mrjj Thank you for the answers. I finally downloaded and compiled the library with the cross compiler. Then I added this in the pro file:
      INCLUDEPATH += /path/include
      LIBS += -L/path/lib -lavdevice
      Now I can include correctly the headers, but at run time I have an undefined reference error to the function called. Some ideas?

      aha_1980A 離線
      aha_1980A 離線
      aha_1980
      Lifetime Qt Champion
      寫於 最後由 aha_1980 編輯
      #5

      @Crindu you need to deploy (copy) the library to your device (e.g. to /usr/lib) so the dynamic linker can pick it up. note that often some symbolic links libxxxx.so.2.1 belong to the library.

      Most often you can check ldd yourexe to see all dependencies (satisfied or not).

      regards

      Qt has to stay free or it will die.

      C 1 條回覆 最後回覆
      3
      • aha_1980A aha_1980

        @Crindu you need to deploy (copy) the library to your device (e.g. to /usr/lib) so the dynamic linker can pick it up. note that often some symbolic links libxxxx.so.2.1 belong to the library.

        Most often you can check ldd yourexe to see all dependencies (satisfied or not).

        regards

        C 離線
        C 離線
        Crindu
        寫於 最後由 編輯
        #6

        @aha_1980 Sorry, I just noticed that the problem is also at compile time. I copied the library on the device but nothing changed.
        I think the cross compiler finds the header, but not the libraries.
        Moreover, copying the library on the device, I have two different paths: on the device I save them in the /usr/lib folder, while in the computer I created a folder in my /home directory ( because I downloaded again the source and compiled with the cross compiler).

        K 1 條回覆 最後回覆
        0
        • C Crindu

          @aha_1980 Sorry, I just noticed that the problem is also at compile time. I copied the library on the device but nothing changed.
          I think the cross compiler finds the header, but not the libraries.
          Moreover, copying the library on the device, I have two different paths: on the device I save them in the /usr/lib folder, while in the computer I created a folder in my /home directory ( because I downloaded again the source and compiled with the cross compiler).

          K 離線
          K 離線
          koahnig
          寫於 最後由 編輯
          #7

          @Crindu

          Are you doing a dynamic link compilation?

          This includes a lib "stump" defining the access to the dynamic routines in the actual dynamic link library. Therefore, you should not confuse the libraries.

          Vote the answer(s) that helped you to solve your issue(s)

          C 1 條回覆 最後回覆
          2
          • K koahnig

            @Crindu

            Are you doing a dynamic link compilation?

            This includes a lib "stump" defining the access to the dynamic routines in the actual dynamic link library. Therefore, you should not confuse the libraries.

            C 離線
            C 離線
            Crindu
            寫於 最後由 編輯
            #8

            @koahnig Sorry I don't know what do you mean for dynamic link compilation.
            The cross compiler generates only .a files that are static library and I added these to the .pro file, maybe this is the problem.

            K 1 條回覆 最後回覆
            0
            • C Crindu

              @koahnig Sorry I don't know what do you mean for dynamic link compilation.
              The cross compiler generates only .a files that are static library and I added these to the .pro file, maybe this is the problem.

              K 離線
              K 離線
              koahnig
              寫於 最後由 編輯
              #9

              @Crindu said in External libraries on Raspberry Pi 3 B+:

              @koahnig Sorry I don't know what do you mean for dynamic link compilation.
              The cross compiler generates only .a files that are static library and I added these to the .pro file, maybe this is the problem.

              When you create an application you have to decide how to link external libraries. Either "Static" or "Dynamically linked shared object libraries" (probably called in linux). In windows those libraries are called "dll"->"dynamic link library".
              The "dynamic linked shared object library" has typically extensions *.so and often followed by version numbers. Those go along with your application for deployment.

              When you are using a static library it is only one file per library. This file is directly linked to your application and makes the application typically much bigger.

              There are also the libraries with the "stumps" which have to be linked to your application. Typical extension is *.a. Typically they are smaller than the .so files and increase the size of your application insignificantly. The "stumps" tell your app how to access the "dynamic linked shared object library".

              If your library is called "somelibrary" you probably will have a file called "somelibrary.a" and a file "somelibrary.so"

              Vote the answer(s) that helped you to solve your issue(s)

              C 1 條回覆 最後回覆
              3
              • K koahnig

                @Crindu said in External libraries on Raspberry Pi 3 B+:

                @koahnig Sorry I don't know what do you mean for dynamic link compilation.
                The cross compiler generates only .a files that are static library and I added these to the .pro file, maybe this is the problem.

                When you create an application you have to decide how to link external libraries. Either "Static" or "Dynamically linked shared object libraries" (probably called in linux). In windows those libraries are called "dll"->"dynamic link library".
                The "dynamic linked shared object library" has typically extensions *.so and often followed by version numbers. Those go along with your application for deployment.

                When you are using a static library it is only one file per library. This file is directly linked to your application and makes the application typically much bigger.

                There are also the libraries with the "stumps" which have to be linked to your application. Typical extension is *.a. Typically they are smaller than the .so files and increase the size of your application insignificantly. The "stumps" tell your app how to access the "dynamic linked shared object library".

                If your library is called "somelibrary" you probably will have a file called "somelibrary.a" and a file "somelibrary.so"

                C 離線
                C 離線
                Crindu
                寫於 最後由 編輯
                #10

                @koahnig Ok thanks, I linked them dinamically but nothing, always undefined reference error. Maybe I did some mistakes in the toolchain, or in the settings of the cross compiler because this is very strange. In the project that runs on pc I didn't have all these problems

                jsulmJ 1 條回覆 最後回覆
                0
                • C Crindu

                  @koahnig Ok thanks, I linked them dinamically but nothing, always undefined reference error. Maybe I did some mistakes in the toolchain, or in the settings of the cross compiler because this is very strange. In the project that runs on pc I didn't have all these problems

                  jsulmJ 離線
                  jsulmJ 離線
                  jsulm
                  Lifetime Qt Champion
                  寫於 最後由 編輯
                  #11

                  @Crindu Can you please show the actual errors? Or better the whole compiler output. You get undefined reference errors during linking of your app. Most probably the linker cannot find the lib or it isn't compatible.

                  https://forum.qt.io/topic/113070/qt-code-of-conduct

                  C 1 條回覆 最後回覆
                  1
                  • sneubertS 離線
                    sneubertS 離線
                    sneubert
                    寫於 最後由 編輯
                    #12

                    In most cases there´s no need to compile 3rd party libs with the cross-compiler. You can install the dev packages on your rpi for most of the libs. To use them in you cross-compile projecte you have to rsync from rpi -> dev host again.

                    C 1 條回覆 最後回覆
                    1
                    • jsulmJ jsulm

                      @Crindu Can you please show the actual errors? Or better the whole compiler output. You get undefined reference errors during linking of your app. Most probably the linker cannot find the lib or it isn't compatible.

                      C 離線
                      C 離線
                      Crindu
                      寫於 最後由 編輯
                      #13

                      @jsulm

                      09:30:14: Running steps for project untitled1...
                      09:30:14: Configuration unchanged, skipping qmake step.
                      09:30:14: Starting: "/usr/bin/make" 
                      /home/cristiano/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-g++ -mfloat-abi=hard --sysroot=/home/cristiano/raspi/sysroot -Wl,-rpath-link,/home/cristiano/raspi/sysroot/opt/vc/lib -Wl,-rpath-link,/home/cristiano/raspi/sysroot/usr/lib/arm-linux-gnueabihf -Wl,-rpath-link,/home/cristiano/raspi/sysroot/lib/arm-linux-gnueabihf -o untitled1 main.o   -lpthread -L/home/cristiano/FFmpeg-compiled/compiled/lib -lavcodec -lavdevice -lavutil -lavformat -lavfilter -lswscale -lswresample 
                      main.o: In function `main':
                      /home/cristiano/untitled1/main.cpp:8: undefined reference to `av_register_all()'
                      /home/cristiano/untitled1/main.cpp:9: undefined reference to `avcodec_register_all()'
                      /home/cristiano/untitled1/main.cpp:10: undefined reference to `avdevice_register_all()'
                      Makefile:139: recipe for target 'untitled1' failed
                      collect2: error: ld returned 1 exit status
                      make: *** [untitled1] Error 1
                      09:30:14: The process "/usr/bin/make" exited with code 2.
                      Error while building/deploying project untitled1 (kit: Raspberry kit)
                      When executing step "Make"
                      09:30:14: Elapsed time: 00:00.
                      

                      The libraries are compatible, this is the file command output:
                      libavcodec.so.58.20.104: ELF 32-bit LSB shared object, ARM, EABI5 version 1 (SYSV), dynamically linked, BuildID[sha1]=6182340cbdd8c56e7c410638a62e92dd0249e82c, stripped

                      This is my pro. file:

                      TEMPLATE = app
                      CONFIG += console c++11
                      CONFIG -= app_bundle
                      CONFIG -= qt
                      SOURCES += main.cpp
                      INSTALLS        = target
                      target.files    = untitled1
                      target.path     = /home/pi
                      LIBS += -lpthread
                      
                      INCLUDEPATH += /home/cristiano/FFmpeg-compiled/compiled/include
                      
                      LIBS += -L/home/cristiano/FFmpeg-compiled/compiled/lib -lavcodec -lavdevice -lavutil -lavformat -lavfilter -lswscale -lswresample
                      
                      jsulmJ 1 條回覆 最後回覆
                      0
                      • sneubertS sneubert

                        In most cases there´s no need to compile 3rd party libs with the cross-compiler. You can install the dev packages on your rpi for most of the libs. To use them in you cross-compile projecte you have to rsync from rpi -> dev host again.

                        C 離線
                        C 離線
                        Crindu
                        寫於 最後由 編輯
                        #14

                        @sneubert Can you post your rsync example? I don't know exactly what and where to copy. Do I have to copy only the folders in which FFmpeg was installed or everything from the Raspberry in the sysroot folder ?

                        1 條回覆 最後回覆
                        0
                        • C Crindu

                          @jsulm

                          09:30:14: Running steps for project untitled1...
                          09:30:14: Configuration unchanged, skipping qmake step.
                          09:30:14: Starting: "/usr/bin/make" 
                          /home/cristiano/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-g++ -mfloat-abi=hard --sysroot=/home/cristiano/raspi/sysroot -Wl,-rpath-link,/home/cristiano/raspi/sysroot/opt/vc/lib -Wl,-rpath-link,/home/cristiano/raspi/sysroot/usr/lib/arm-linux-gnueabihf -Wl,-rpath-link,/home/cristiano/raspi/sysroot/lib/arm-linux-gnueabihf -o untitled1 main.o   -lpthread -L/home/cristiano/FFmpeg-compiled/compiled/lib -lavcodec -lavdevice -lavutil -lavformat -lavfilter -lswscale -lswresample 
                          main.o: In function `main':
                          /home/cristiano/untitled1/main.cpp:8: undefined reference to `av_register_all()'
                          /home/cristiano/untitled1/main.cpp:9: undefined reference to `avcodec_register_all()'
                          /home/cristiano/untitled1/main.cpp:10: undefined reference to `avdevice_register_all()'
                          Makefile:139: recipe for target 'untitled1' failed
                          collect2: error: ld returned 1 exit status
                          make: *** [untitled1] Error 1
                          09:30:14: The process "/usr/bin/make" exited with code 2.
                          Error while building/deploying project untitled1 (kit: Raspberry kit)
                          When executing step "Make"
                          09:30:14: Elapsed time: 00:00.
                          

                          The libraries are compatible, this is the file command output:
                          libavcodec.so.58.20.104: ELF 32-bit LSB shared object, ARM, EABI5 version 1 (SYSV), dynamically linked, BuildID[sha1]=6182340cbdd8c56e7c410638a62e92dd0249e82c, stripped

                          This is my pro. file:

                          TEMPLATE = app
                          CONFIG += console c++11
                          CONFIG -= app_bundle
                          CONFIG -= qt
                          SOURCES += main.cpp
                          INSTALLS        = target
                          target.files    = untitled1
                          target.path     = /home/pi
                          LIBS += -lpthread
                          
                          INCLUDEPATH += /home/cristiano/FFmpeg-compiled/compiled/include
                          
                          LIBS += -L/home/cristiano/FFmpeg-compiled/compiled/lib -lavcodec -lavdevice -lavutil -lavformat -lavfilter -lswscale -lswresample
                          
                          jsulmJ 離線
                          jsulmJ 離線
                          jsulm
                          Lifetime Qt Champion
                          寫於 最後由 編輯
                          #15

                          @Crindu said in External libraries on Raspberry Pi 3 B+:

                          /home/cristiano/FFmpeg-compiled/compiled/lib

                          Are the libs really in this directory? Are they built using same compiler as you use for your app?

                          https://forum.qt.io/topic/113070/qt-code-of-conduct

                          C 1 條回覆 最後回覆
                          0
                          • sneubertS 離線
                            sneubertS 離線
                            sneubert
                            寫於 最後由 編輯
                            #16

                            If you install for example libavcodec-dev on your rpi, the header and libraries get installed in /usr/...
                            You now need the installed header and libraries on your development host. Your cross-compiler is working with a local copy of the rpi sysroot.

                            Like in this guide https://wiki.qt.io/RaspberryPi2EGLFS every time you install some new dev libaries with apt-get on you rpi, you have to copy the new files to your development host.

                            Take a look at Step 8.

                            rsync -avz pi@raspberrypi.local:/lib sysroot
                            rsync -avz pi@raspberrypi.local:/usr/include sysroot/usr
                            rsync -avz pi@raspberrypi.local:/usr/lib sysroot/usr
                            rsync -avz pi@raspberrypi.local:/opt/vc sysroot/opt
                            

                            As these libaries are in the system path of your local sysroot, you can now just include headers with #include <...> and link with LIBS += -l...

                            C 1 條回覆 最後回覆
                            2
                            • jsulmJ jsulm

                              @Crindu said in External libraries on Raspberry Pi 3 B+:

                              /home/cristiano/FFmpeg-compiled/compiled/lib

                              Are the libs really in this directory? Are they built using same compiler as you use for your app?

                              C 離線
                              C 離線
                              Crindu
                              寫於 最後由 編輯
                              #17

                              @jsulm Yes they are there and I built them with the cross compiler

                              1 條回覆 最後回覆
                              0
                              • sneubertS sneubert

                                If you install for example libavcodec-dev on your rpi, the header and libraries get installed in /usr/...
                                You now need the installed header and libraries on your development host. Your cross-compiler is working with a local copy of the rpi sysroot.

                                Like in this guide https://wiki.qt.io/RaspberryPi2EGLFS every time you install some new dev libaries with apt-get on you rpi, you have to copy the new files to your development host.

                                Take a look at Step 8.

                                rsync -avz pi@raspberrypi.local:/lib sysroot
                                rsync -avz pi@raspberrypi.local:/usr/include sysroot/usr
                                rsync -avz pi@raspberrypi.local:/usr/lib sysroot/usr
                                rsync -avz pi@raspberrypi.local:/opt/vc sysroot/opt
                                

                                As these libaries are in the system path of your local sysroot, you can now just include headers with #include <...> and link with LIBS += -l...

                                C 離線
                                C 離線
                                Crindu
                                寫於 最後由 編輯
                                #18

                                @sneubert Ok thanks, something changed. Now I have a lot of compilation error relative to other libraries:

                                11:28:58: Running steps for project untitled1...
                                11:28:58: Configuration unchanged, skipping qmake step.
                                11:28:58: Starting: "/usr/bin/make" 
                                /home/cristiano/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-g++ -mfloat-abi=hard --sysroot=/home/cristiano/raspi/sysroot -Wl,-rpath-link,/home/cristiano/raspi/sysroot/opt/vc/lib -Wl,-rpath-link,/home/cristiano/raspi/sysroot/usr/lib/arm-linux-gnueabihf -Wl,-rpath-link,/home/cristiano/raspi/sysroot/lib/arm-linux-gnueabihf -o untitled1 main.o   -lavcodec -lavdevice -lavformat -lpthread 
                                /home/cristiano/raspi/sysroot/usr/lib/arm-linux-gnueabihf/libopenmpt.so.0: undefined reference to `std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::_M_create(unsigned int&, unsigned int)@GLIBCXX_3.4.21'
                                /home/cristiano/raspi/sysroot/usr/lib/arm-linux-gnueabihf/libzmq.so.5: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::rfind(char, unsigned int) const@GLIBCXX_3.4.21'
                                /home/cristiano/raspi/sysroot/usr/lib/arm-linux-gnueabihf/libopencv_core.so.2.4: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::find(char, unsigned int) const@GLIBCXX_3.4.21'
                                /home/cristiano/raspi/sysroot/usr/lib/arm-linux-gnueabihf/libsnappy.so.1: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_append(char const*, unsigned int)@GLIBCXX_3.4.21'
                                /home/cristiano/raspi/sysroot/usr/lib/arm-linux-gnueabihf/libzmq.so.5: undefined reference to `VTT for std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >@GLIBCXX_3.4.21'
                                /home/cristiano/raspi/sysroot/usr/lib/arm-linux-gnueabihf/libopenmpt.so.0: undefined reference to `std::__throw_out_of_range_fmt(char const*, ...)@GLIBCXX_3.4.20'
                                /home/cristiano/raspi/sysroot/usr/lib/arm-linux-gnueabihf/libopenmpt.so.0: undefined reference to `std::__cxx11::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >::_M_sync(char*, unsigned int, unsigned int)@GLIBCXX_3.4.21'
                                /home/cristiano/raspi/sysroot/usr/lib/arm-linux-gnueabihf/libopenmpt.so.0: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::assign(char const*)@GLIBCXX_3.4.21'
                                /home/cristiano/raspi/sysroot/usr/lib/arm-linux-gnueabihf/libopenmpt.so.0: undefined reference to `std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::_M_assign(std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const&)@GLIBCXX_3.4.21'
                                /home/cristiano/raspi/sysroot/usr/lib/arm-linux-gnueabihf/libopenmpt.so.0: undefined reference to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream(std::_Ios_Openmode)@GLIBCXX_3.4.21'
                                /home/cristiano/raspi/sysroot/usr/lib/arm-linux-gnueabihf/librubberband.so.2: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()@GLIBCXX_3.4.21'
                                /home/cristiano/raspi/sysroot/usr/lib/arm-linux-gnueabihf/libopenmpt.so.0: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_mutate(unsigned int, unsigned int, char const*, unsigned int)@GLIBCXX_3.4.21'
                                /home/cristiano/raspi/sysroot/usr/lib/arm-linux-gnueabihf/libopenmpt.so.0: undefined reference to `std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::reserve(unsigned int)@GLIBCXX_3.4.21'
                                /home/cristiano/raspi/sysroot/usr/lib/arm-linux-gnueabihf/libopenmpt.so.0: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_assign(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@GLIBCXX_3.4.21'
                                /home/cristiano/raspi/sysroot/usr/lib/arm-linux-gnueabihf/libjack.so.0: undefined reference to `operator delete(void*, unsigned int)@CXXABI_1.3.9'
                                /home/cristiano/raspi/sysroot/usr/lib/arm-linux-gnueabihf/libsnappy.so.1: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::resize(unsigned int, char)@GLIBCXX_3.4.21'
                                /home/cristiano/raspi/sysroot/usr/lib/arm-linux-gnueabihf/libopenmpt.so.0: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::reserve(unsigned int)@GLIBCXX_3.4.21'
                                /home/cristiano/raspi/sysroot/usr/lib/arm-linux-gnueabihf/libopenmpt.so.0: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::find(char const*, unsigned int, unsigned int) const@GLIBCXX_3.4.21'
                                /home/cristiano/raspi/sysroot/usr/lib/arm-linux-gnueabihf/libopenmpt.so.0: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::replace(unsigned int, unsigned int, char const*, unsigned int)@GLIBCXX_3.4.21'
                                /home/cristiano/raspi/sysroot/usr/lib/arm-linux-gnueabihf/libopenmpt.so.0: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::append(char const*)@GLIBCXX_3.4.21'
                                /home/cristiano/raspi/sysroot/usr/lib/arm-linux-gnueabihf/libzmq.so.5: undefined reference to `std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >::~basic_stringstream()@GLIBCXX_3.4.21'
                                /home/cristiano/raspi/sysroot/usr/lib/arm-linux-gnueabihf/libjack.so.0: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::compare(char const*) const@GLIBCXX_3.4.21'
                                /home/cristiano/raspi/sysroot/usr/lib/arm-linux-gnueabihf/libopenmpt.so.0: undefined reference to `std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::_M_mutate(unsigned int, unsigned int, wchar_t const*, unsigned int)@GLIBCXX_3.4.21'
                                /home/cristiano/raspi/sysroot/usr/lib/arm-linux-gnueabihf/libopencv_core.so.2.4: undefined reference to `operator delete[](void*, unsigned int)@CXXABI_1.3.9'
                                /home/cristiano/raspi/sysroot/usr/lib/arm-linux-gnueabihf/libopenmpt.so.0: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::find_last_not_of(char const*, unsigned int, unsigned int) const@GLIBCXX_3.4.21'
                                /home/cristiano/raspi/sysroot/usr/lib/arm-linux-gnueabihf/libopenmpt.so.0: undefined reference to `vtable for std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >@GLIBCXX_3.4.21'
                                /home/cristiano/raspi/sysroot/usr/lib/arm-linux-gnueabihf/libjack.so.0: undefined reference to `std::runtime_error::runtime_error(char const*)@GLIBCXX_3.4.21'
                                /home/cristiano/raspi/sysroot/usr/lib/arm-linux-gnueabihf/libopenmpt.so.0: undefined reference to `__cxa_throw_bad_array_new_length@CXXABI_1.3.8'
                                /home/cristiano/raspi/sysroot/usr/lib/arm-linux-gnueabihf/libopenmpt.so.0: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&)@GLIBCXX_3.4.21'
                                /home/cristiano/raspi/sysroot/usr/lib/arm-linux-gnueabihf/libopenmpt.so.0: undefined reference to `VTT for std::__cxx11::basic_istringstream<char, std::char_traits<char>, std::allocator<char> >@GLIBCXX_3.4.21'
                                /home/cristiano/raspi/sysroot/usr/lib/arm-linux-gnueabihf/libopenmpt.so.0: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_replace_aux(unsigned int, unsigned int, unsigned int, char)@GLIBCXX_3.4.21'
                                /home/cristiano/raspi/sysroot/usr/lib/arm-linux-gnueabihf/libopenmpt.so.0: undefined reference to `std::random_device::_M_init(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@GLIBCXX_3.4.21'
                                /home/cristiano/raspi/sysroot/usr/lib/arm-linux-gnueabihf/libopenmpt.so.0: undefined reference to `std::runtime_error::runtime_error(char const*)@GLIBCXX_3.4.21'
                                /home/cristiano/raspi/sysroot/usr/lib/arm-linux-gnueabihf/libzmq.so.5: undefined reference to `vtable for std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >@GLIBCXX_3.4.21'
                                /home/cristiano/raspi/sysroot/usr/lib/arm-linux-gnueabihf/libopenmpt.so.0: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_erase(unsigned int, unsigned int)@GLIBCXX_3.4.21'
                                /home/cristiano/raspi/sysroot/usr/lib/arm-linux-gnueabihf/libopenmpt.so.0: undefined reference to `std::range_error::range_error(char const*)@GLIBCXX_3.4.21'
                                /home/cristiano/raspi/sysroot/usr/lib/arm-linux-gnueabihf/libopenmpt.so.0: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_construct(unsigned int, char)@GLIBCXX_3.4.21'
                                /home/cristiano/raspi/sysroot/usr/lib/arm-linux-gnueabihf/libopenmpt.so.0: undefined reference to `std::__cxx11::basic_istringstream<char, std::char_traits<char>, std::allocator<char> >::~basic_istringstream()@GLIBCXX_3.4.21'
                                /home/cristiano/raspi/sysroot/usr/lib/arm-linux-gnueabihf/libopenmpt.so.0: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::find_first_of(char const*, unsigned int, unsigned int) const@GLIBCXX_3.4.21'
                                /home/cristiano/raspi/sysroot/usr/lib/arm-linux-gnueabihf/libopenmpt.so.0: undefined reference to `VTT for std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >@GLIBCXX_3.4.21'
                                /home/cristiano/raspi/sysroot/usr/lib/arm-linux-gnueabihf/libopenmpt.so.0: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::operator=(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&)@GLIBCXX_3.4.21'
                                /home/cristiano/raspi/sysroot/usr/lib/arm-linux-gnueabihf/libopenmpt.so.0: undefined reference to `vtable for std::__cxx11::basic_istringstream<char, std::char_traits<char>, std::allocator<char> >@GLIBCXX_3.4.21'
                                /home/cristiano/raspi/sysroot/usr/lib/arm-linux-gnueabihf/libopenmpt.so.0: undefined reference to `std::range_error::range_error(char const*)@GLIBCXX_3.4.21'
                                /home/cristiano/raspi/sysroot/usr/lib/arm-linux-gnueabihf/libopenmpt.so.0: undefined reference to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::~basic_ostringstream()@GLIBCXX_3.4.21'
                                /home/cristiano/raspi/sysroot/usr/lib/arm-linux-gnueabihf/libopenmpt.so.0: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::find_last_of(char const*, unsigned int, unsigned int) const@GLIBCXX_3.4.21'
                                /home/cristiano/raspi/sysroot/usr/lib/arm-linux-gnueabihf/libjack.so.0: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_create(unsigned int&, unsigned int)@GLIBCXX_3.4.21'
                                /home/cristiano/raspi/sysroot/usr/lib/arm-linux-gnueabihf/libopenmpt.so.0: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::find_first_not_of(char const*, unsigned int, unsigned int) const@GLIBCXX_3.4.21'
                                /home/cristiano/raspi/sysroot/usr/lib/arm-linux-gnueabihf/libjack.so.0: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_replace(unsigned int, unsigned int, char const*, unsigned int)@GLIBCXX_3.4.21'
                                /home/cristiano/raspi/sysroot/usr/lib/arm-linux-gnueabihf/libopencv_core.so.2.4: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::swap(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&)@GLIBCXX_3.4.21'
                                /home/cristiano/raspi/sysroot/usr/lib/arm-linux-gnueabihf/libopenmpt.so.0: undefined reference to `vtable for std::__cxx11::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >@GLIBCXX_3.4.21'
                                /home/cristiano/raspi/sysroot/usr/lib/arm-linux-gnueabihf/libopenmpt.so.0: undefined reference to `std::__cxx11::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >::str() const@GLIBCXX_3.4.21'
                                Makefile:139: recipe for target 'untitled1' failed
                                collect2: error: ld returned 1 exit status
                                make: *** [untitled1] Error 1
                                11:28:59: The process "/usr/bin/make" exited with code 2.
                                Error while building/deploying project untitled1 (kit: Raspberry kit)
                                When executing step "Make"
                                11:28:59: Elapsed time: 00:00.
                                
                                1 條回覆 最後回覆
                                0
                                • sneubertS 離線
                                  sneubertS 離線
                                  sneubert
                                  寫於 最後由 編輯
                                  #19

                                  sorry you have to repeate Step 9 after rsync

                                  C 1 條回覆 最後回覆
                                  0
                                  • sneubertS sneubert

                                    sorry you have to repeate Step 9 after rsync

                                    C 離線
                                    C 離線
                                    Crindu
                                    寫於 最後由 編輯
                                    #20

                                    @sneubert I just repeated step 9 but the errors remains

                                    1 條回覆 最後回覆
                                    0
                                    • sneubertS 離線
                                      sneubertS 離線
                                      sneubert
                                      寫於 最後由 編輯
                                      #21

                                      this seems to be a compiler missmatch between your cross-compiler an the compiler used to create the library, one thing you can try is to put

                                      #define _GLIBCXX_USE_CXX11_ABI 0
                                      

                                      before include any standard library in your code

                                      C 1 條回覆 最後回覆
                                      0
                                      • sneubertS sneubert

                                        this seems to be a compiler missmatch between your cross-compiler an the compiler used to create the library, one thing you can try is to put

                                        #define _GLIBCXX_USE_CXX11_ABI 0
                                        

                                        before include any standard library in your code

                                        C 離線
                                        C 離線
                                        Crindu
                                        寫於 最後由 編輯
                                        #22

                                        @sneubert Unfortunately it doesn't work. I noticed that copying the file on the Raspberry and compiling from there, it works! And this is strange because the compiler should be the same as the toolchain

                                        1 條回覆 最後回覆
                                        0
                                        • sneubertS 離線
                                          sneubertS 離線
                                          sneubert
                                          寫於 最後由 編輯
                                          #23

                                          what version of gcc are you using for cross compiling

                                          /home/cristiano/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-g++ -v
                                          

                                          what version of gcc is on your rpi

                                          g++ -v 
                                          
                                          C 1 條回覆 最後回覆
                                          2

                                          • 登入

                                          • Login or register to search.
                                          • 第一個貼文
                                            最後的貼文
                                          0
                                          • 版面
                                          • 最新
                                          • 標籤
                                          • 熱門
                                          • 使用者
                                          • 群組
                                          • 搜尋
                                          • Get Qt Extensions
                                          • Unsolved