How to fix an unknown error when cross compiling m

2019-08-25 04:37发布

问题:

my program (QT/C++)is using a python module to download some video from google drive, it's work very well but I couldn't cross compile it for raspberry pi3. I am new in QT Cross Compile for raspberry and I couldn't find a solution for this error in any place :

 #define _POSIX_C_SOURCE 200112L
 ^
In file included from /opt/qtrpi/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/arm-linux-gnueabihf/include/c++/4.8.3/arm-linux-gnueabihf/bits/os_defines.h:39:0,
                 from /opt/qtrpi/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/arm-linux-gnueabihf/include/c++/4.8.3/arm-linux-gnueabihf/bits/c++config.h:426,
                 from /opt/qtrpi/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/arm-linux-gnueabihf/include/c++/4.8.3/cstddef:41,
                 from /opt/qtrpi/raspi/qt5pi/include/QtCore/qglobal.h:45,
                 from /opt/qtrpi/raspi/qt5pi/include/QtCore/qtimer.h:43,
                 from /opt/qtrpi/raspi/qt5pi/include/QtCore/QTimer:1,
                 from DigitalSignal.h:5,
                 from DigitalSignal.cpp:1:
/opt/qtrpi/raspbian/sysroot/usr/include/./features.h:230:0: note: ceci est l'emplacement d’une précédente définition
 # define _POSIX_C_SOURCE 200809L
 ^
In file included from lib/python2.7/Include/Python.h:8:0,
                 from DigitalSignal.cpp:15:
lib/python2.7/Include/pyconfig.h:1242:0: warning: « _XOPEN_SOURCE » redéfini [enabled by default]
 #define _XOPEN_SOURCE 600
 ^
In file included from /opt/qtrpi/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/arm-linux-gnueabihf/include/c++/4.8.3/arm-linux-gnueabihf/bits/os_defines.h:39:0,
                 from /opt/qtrpi/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/arm-linux-gnueabihf/include/c++/4.8.3/arm-linux-gnueabihf/bits/c++config.h:426,
                 from /opt/qtrpi/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/arm-linux-gnueabihf/include/c++/4.8.3/cstddef:41,
                 from /opt/qtrpi/raspi/qt5pi/include/QtCore/qglobal.h:45,
                 from /opt/qtrpi/raspi/qt5pi/include/QtCore/qtimer.h:43,
                 from /opt/qtrpi/raspi/qt5pi/include/QtCore/QTimer:1,
                 from DigitalSignal.h:5,
                 from DigitalSignal.cpp:1:
/opt/qtrpi/raspbian/sysroot/usr/include/./features.h:162:0: note: ceci est l'emplacement d’une précédente définition
 # define _XOPEN_SOURCE 700
 ^
In file included from lib/python2.7/Include/Python.h:61:0,
                 from DigitalSignal.cpp:15:
lib/python2.7/Include/pyport.h:895:2: error: #error "LONG_BIT definition appears wrong for platform (bad gcc/glibc config?)."
 #error "LONG_BIT definition appears wrong for platform (bad gcc/glibc config?)."
  ^
Makefile:1145: recipe for target 'DigitalSignal.o' failed
make: *** [DigitalSignal.o] Error 1


回答1:

Basing on the solution of this problem Python compilation error: "LONG_BIT definition appears wrong for platform" .I changed in lib/python2.7/Include/pyconfig.h this line #define SIZEOF_LONG 8 bye this line #define SIZEOF_LONG 4 (explanation : '4' for 32 bits and '8' for 64 bits ).

but now I have a new error that i does't understand :::

t/usr/lib/arm-linux-gnueabihf -lQt5Widgets -lQt5Gui -lQt5Qml -lQt5Network -lQt5Xml -lQt5Core -Wl,-rpath-link,/opt/qtrpi/raspbian/sysroot/opt/vc/lib -lGLESv2 -lpthread 
/home/Documents/project/digitalsignage/lib/python2.7//libpython2.7.a : erreur lors de l'ajout de symboles : Format de fichier non reconnu
collect2: error: ld a retourné le statut de sortie 1
Makefile:170: recipe for target 'DigitalSignal' failed
make: *** [DigitalSignal] Error 1

can anyone what is the meaning of this error ???