# 修改并安装32位libc6-dev包,这样才能装上部分i386依赖
apt download libc6-dev:i386
sudo dpkg -x ./libc6-dev_*_i386.deb ./extract/
sudo dpkg -e ./libc6-dev_*_i386.deb ./extract/DEBIAN/
sudo sed -i '/^Depends:/d' ./extract/DEBIAN/control
sudo dpkg-deb -b ./extract/
sudo apt install ./extract.deb
# 安装全部依赖
sudo apt install \
build-essential multiarch-support \
gcc-multilib g++-multilib \
bison flex \
libx11-dev libx11-dev:i386 \
libfreetype6-dev libfreetype6-dev:i386 \
libxcursor-dev libxcursor-dev:i386 \
libxi-dev libxi-dev:i386 \
libxshmfence-dev libxshmfence-dev:i386 \
libxxf86vm-dev libxxf86vm-dev:i386 \
libxrandr-dev libxrandr-dev:i386 \
libxinerama-dev libxinerama-dev:i386 \
libxcomposite-dev libxcomposite-dev:i386 \
libosmesa6-dev libosmesa6-dev:i386 \
ocl-icd-opencl-dev ocl-icd-opencl-dev:i386 \
libpcap-dev libpcap-dev:i386 \
libdbus-1-dev libdbus-1-dev:i386 \
libgnutls28-dev libgnutls28-dev:i386 \
libsane-dev libsane-dev:i386 \
libusb-1.0-0-dev libusb-1.0-0-dev:i386 \
libv4l-dev libv4l-dev:i386 \
libgphoto2-dev libgphoto2-dev:i386 \
libpulse-dev libpulse-dev:i386 \
libgstreamer1.0-dev libgstreamer1.0-dev:i386 \
libgstreamer-plugins-base1.0-dev libgstreamer-plugins-base1.0-dev:i386 \
libudev-dev libudev-dev:i386 \
libsdl2-dev libsdl2-dev:i386 \
libcapi20-dev libcapi20-dev:i386 \
libcups2-dev libcups2-dev:i386 \
libfontconfig1-dev libfontconfig1-dev:i386 \
libkrb5-dev libkrb5-dev:i386 \
libopenal-dev libopenal-dev:i386 \
samba-dev \
libvulkan-dev libvulkan-dev:i386 \
libldap2-dev libldap2-dev:i386 \
libgl1-mesa-dev libgl1-mesa-dev:i386
无论是在x86还是在arm64上,都推荐使用clang进行编译,这样可以直接编译出PE DLL,不需要折腾mingw的安装。
clang下载:https://github.com/llvm/llvm-project/releases/tag/llvmorg-14.0.0
clang+llvm-14.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz
好像是最后一个x86 linux预编译二进制,后续版本就没有了,得自己编译。使用方法:
export CLANG_HOME=/path/to/clang-14; export CC=clang CXX=clang++ PATH=$CLANG_HOME/bin:$PATH LD_LIBRARY_PATH=$CLANG_HOME/lib
./configure
ARM64 银河麒麟