2

I'm trying to cross compile from Win10 to Raspian OS on the Raspberry Pi 4. For this reason I use the Ubuntu 22.04 LTS WSL. I installed gcc/g++, CMake, Ninja, SDL2, Vulkan SDK, aarch64-linux-gnu-gcc/g++.

In the CMakeLists.txt I call find_package(SDL2 REQUIRED) and find_package(Vulkan REQUIRED). When I compile with the normal gcc and g++ there is no problem, but when I try the aarch64-linux-gnu-gcc and aarch64-linux-gnu-g++

set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR aarch64)
set(CMAKE_CROSSCOMPILING TRUE)

set(CMAKE_C_COMPILER aarch64-linux-gnu-gcc)
set(CMAKE_CXX_COMPILER aarch64-linux-gnu-g++)

Error message:

CMake Error at CMakeLists.txt:66 (find_package):
  By not providing "FindSDL2.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "SDL2", but
  CMake did not find one.

  Could not find a package configuration file provided by "SDL2" with any of
  the following names:

    SDL2Config.cmake
    sdl2-config.cmake

  Add the installation prefix of "SDL2" to CMAKE_PREFIX_PATH or set
  "SDL2_DIR" to a directory containing one of the above files.  If "SDL2"
  provides a separate development package or SDK, be sure it has been
  installed.

The libs can be found in the folder /usr/lib/x86_64-linux-gnu

Why are they not in the folder /usr/lib/aarch64-linux-gnu? How can I use or install them for the aarch64-linux-gnu-gcc/g++?

Thank you in advance!

set(CMAKE_C_COMPILER aarch64-linux-gnu-gcc)
set(CMAKE_CXX_COMPILER aarch64-linux-gnu-g++)

In this link at the bottom aarch64-linux-gnu files are mentioned, but there are non installed in my /usr/lib/aarch64-linux-gnu folder

https://ubuntu.pkgs.org/20.04/ubuntu-universe-arm64/libsdl2-dev_2.0.10+dfsg1-3_arm64.deb.html

Ferry
  • 23
  • 4

0 Answers0