Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Cross compilation : Rasp berryPi2
Forum Updated to NodeBB v4.3 + New Features

Cross compilation : Rasp berryPi2

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
5 Posts 3 Posters 1.8k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • yuvaramY Offline
    yuvaramY Offline
    yuvaram
    wrote on last edited by
    #1

    HI

    Faced isse while cross compiling Qt for Rasp BerryPi

    ./configure -opengl es2 -device linux-rasp-pi-g++ -device-option CROSS_COMPILE=/home/ram/RPI/compiler/gcc-4.7-linaro-rpi-gnueabihf/bin/arm-linux-gnueabihf- -sysroot /mnt/raspberry-rootfs -opensource -confirm-license -optimized-qmake -reduce-exports -release -make libs -prefix /usr/local/qt5pi -hostprefix /usr/local/qt5pi

    Error Message:
    Creating qmake...
    .cc1plus: error: unrecognized command line option ‘-std=c++11’
    make: *** [project.o] Error 1

    After online search about the issue , it tells old version og g++ compiler like g++ 4.6 and below. But i m using g++ 4.7

    Thank you in advance

    Yuvaram Aligeti
    Embedded Qt Developer
    : )

    A 1 Reply Last reply
    0
    • yuvaramY yuvaram

      HI

      Faced isse while cross compiling Qt for Rasp BerryPi

      ./configure -opengl es2 -device linux-rasp-pi-g++ -device-option CROSS_COMPILE=/home/ram/RPI/compiler/gcc-4.7-linaro-rpi-gnueabihf/bin/arm-linux-gnueabihf- -sysroot /mnt/raspberry-rootfs -opensource -confirm-license -optimized-qmake -reduce-exports -release -make libs -prefix /usr/local/qt5pi -hostprefix /usr/local/qt5pi

      Error Message:
      Creating qmake...
      .cc1plus: error: unrecognized command line option ‘-std=c++11’
      make: *** [project.o] Error 1

      After online search about the issue , it tells old version og g++ compiler like g++ 4.6 and below. But i m using g++ 4.7

      Thank you in advance

      A Offline
      A Offline
      ambershark
      wrote on last edited by
      #2

      @yuvaram You need 4.7 I believe for c++11.. Check to see if maybe your desktop g++ is getting picked up instead and if it's < 4.7 that could be the issue. Not the version but the fact that the desktop compiler is being used.

      Can you do a quick test and try this:

      $ mkdir xxx
      $ cd xxx
      $ echo "int main() { return 0; }" > main.cpp
      $ /home/ram/RPI/compiler/gcc-4.7-linaro-rpi-gnueabihf/bin/arm-linux-gnueabihf-g++ -std=c++1 main.cpp
      

      And see if that works. If it does than your cross compiler definitely supports c++11.

      Do you have a clean build directory for Qt? You never built or configured with a different option or compiler before that test?

      My L-GPL'd C++ Logger github.com/ambershark-mike/sharklog

      yuvaramY 1 Reply Last reply
      0
      • A ambershark

        @yuvaram You need 4.7 I believe for c++11.. Check to see if maybe your desktop g++ is getting picked up instead and if it's < 4.7 that could be the issue. Not the version but the fact that the desktop compiler is being used.

        Can you do a quick test and try this:

        $ mkdir xxx
        $ cd xxx
        $ echo "int main() { return 0; }" > main.cpp
        $ /home/ram/RPI/compiler/gcc-4.7-linaro-rpi-gnueabihf/bin/arm-linux-gnueabihf-g++ -std=c++1 main.cpp
        

        And see if that works. If it does than your cross compiler definitely supports c++11.

        Do you have a clean build directory for Qt? You never built or configured with a different option or compiler before that test?

        yuvaramY Offline
        yuvaramY Offline
        yuvaram
        wrote on last edited by
        #3

        @ambershark said in Cross compilation : Rasp berryPi2:

        /home/ram/RPI/compiler/gcc-4.7-linaro-rpi-gnueabihf/bin/arm-linux-gnueabihf-g++ -std=c++1 main.cpp

        Thank you @ambershark
        main.cpp compiled successfully.

        Yuvaram Aligeti
        Embedded Qt Developer
        : )

        A 1 Reply Last reply
        0
        • yuvaramY yuvaram

          @ambershark said in Cross compilation : Rasp berryPi2:

          /home/ram/RPI/compiler/gcc-4.7-linaro-rpi-gnueabihf/bin/arm-linux-gnueabihf-g++ -std=c++1 main.cpp

          Thank you @ambershark
          main.cpp compiled successfully.

          A Offline
          A Offline
          ambershark
          wrote on last edited by ambershark
          #4

          @yuvaram Ok so if that's the case your cross compiler definitely works with c++11, so that means your desktop compiler doesn't.

          Check what compiler your using with g++ --version and if it's below 4.7, upgrade your compiler and you should be good to go. :)

          You're probably running some really old linux if it doesn't have at least 4.7 though. I mean on arch I'm using 6.3.1. gcc 4 is a LONG time ago. CentOS/redhat or something really old would be my guess. Both CentOS and Redhat are really really far behind everyone else since they are going for "stable" linux platforms.

          My L-GPL'd C++ Logger github.com/ambershark-mike/sharklog

          1 Reply Last reply
          0
          • P Offline
            P Offline
            PeterJohn48115
            wrote on last edited by PeterJohn48115
            #5

            Hi... I wanted to start cross compiling for raspberry pi2 on Ubuntu 32bit (in virtual box), so I downloaded the toolchain on the github site and tried to compile a simple hello world program with the command (I've included the path to the bin folder that contains arm-linux-gnueabihf-gcc-4.8.3 to the PATH variable.

            printed circuit assembly

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved