Search code examples
linuxqtubuntugcccross-compiling

Qt Linux-Ubuntu 20.04 64 bit-Cannot run compiler "i686-linux-gnu-g++"


Currently, I am trying to develop a program in Qt Framework in Ubuntu 20.04 64 bit. The library I wanted to use is supporting a 32-bit system and I need to upload this program into a 32-bit system. So I have tried cross-compile 64/32 bit.

I had downloaded Qt Online Installer 64-bit.Qt 5.15.2

And I had downloaded;

sudo apt-get install qtbase5-dev
sudo apt-get install qtbase5-dev:i386

And ı had changed the Qt Version to i386 From

Qt->Tools->Options->Qt Versions->Add

/lib/i386-linux-gnu/qt5/bin

I had added the kits like

C:GCC(C,x86 32bit in/usr/bin)

C++:GCC(C++,x86 32bit in /usr/bin)

After it when ı tried to build 32 bit it shows

"Cannot run compiler "i686-linux-gnu-g++"

  • But I managed to work it as creating a sh file through terminal page by calling ./shfile including;

     export CXX=g++ 
      /usr/lib/i386-linux-gnu/qt5/bin/qmake NavTemp.pro
      make clean
      make all
      ./NavTemp
    

How can I Guide the path of gcc compiler to qt framework? Sorry, I am kinda new to the Qt framework and also linux, any help appreciated.


Solution

  • If you try typing i686-linux-gnu-g++ in the terminal, you'll get the following:

    $ i686-linux-gnu-g++
    
    Command 'i686-linux-gnu-g++' not found, but can be installed with:
    
    sudo apt install g++-i686-linux-gnu
    
    

    So I suppose you need to install the package suggested.