How to Install a Raspberry Pi Cross Compiler on Linux
Problem:
Unable to install and use the Raspberry Pi cross compiler due to issues with libstdc library and PATH configuration.
Solution:
Prerequisites:
Download Toolset:
Add to PATH:
Confirm Compiler:
Create RootFS Folder:
Copy Library and usr Directories:
Create CMake Config File:
Create ~/home/raspberrypi/pi.cmake and insert the following code:
SET(CMAKE_SYSTEM_NAME Linux) SET(CMAKE_SYSTEM_VERSION 1) SET(CMAKE_C_COMPILER $ENV{HOME}/raspberrypi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-gcc) SET(CMAKE_CXX_COMPILER $ENV{HOME}/raspberrypi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-g++) SET(CMAKE_FIND_ROOT_PATH $ENV{HOME}/raspberrypi/rootfs) SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
Compile with CMake Toolchain File:
The above is the detailed content of How to Install a Raspberry Pi Cross Compiler on Linux?. For more information, please follow other related articles on the PHP Chinese website!