Labels

10/04/2012

Cross compile for i386 on 86_64 system

Down load  qt-everywhere-opensource-src-4.7.0

"configure -help" will tell you how to do the cross compile for different OS.

1) tell machine to compile program to 32bit OS
$  ./configure -platform linux-g++-32

Error:
/usr/include/gnu/stubs.h:7:27: error: gnu/stubs-32.h: No such file or directory
make: *** [project.o] Error 1

Solution:
$ sudo apt-get install libc6-dev-i386

Error:
/usr/bin/ld: cannot find -lstdc++
collect2: ld returned 1 exit status

Solution:
$ sudo apt-get install g++-multilib

2) make all libraries
$ make

3) create a "projects" folder under  "qt-everywhere-opensource-src-4.7.0". put your project folder, i.e. m4works, in "projects". and also copy relative folders, qextserialport, qwt-5.2.1, into "projects".

4) compile project relative libraries first to get 32bit libraries.
$ qmake qextserialport.pro
$ make
...

5) modify project .pro file to point libraries in right directory.

6) compile project.
$ qmake m4.pro
$ make




No comments:

Post a Comment