安装java
基于MingW直接编译
1、打开MSYS2 MINGW64,跳转到gilb根目录
2、环境设置:meson setup build
3、编译命令:meson compile -C build
4、安装命令:meson install -C build
指定mingW编译环境,编译生成x86_64库文件
1、在gilb根目录创建下面的文件
x86_64-w64-mingw32.txt
[binaries]
c = 'c:/msys64/mingw64/bin/gcc'
cpp = 'c:/msys64/mingw64/bin/g++'
ar = 'c:/msys64/mingw64/bin/ar'
strip = 'c:/msys64/mingw64/bin/strip'
exe_wrapper = 'wine64'
[host_machine]
system = 'windows'
cpu_family = 'x86_64'
cpu = 'x86_64'
endian = 'little'
2、打开MSYS2 MINGW64,跳转到gilb根目录
3、环境设置:meson setup --cross-file x86_64-w64-mingw32.txt build-mingw --prefix=C:/mhming/droid/github/glib2
4、编译命令:meson compile -C build-mingw
5、安装命令:meson install -C build-mingw
指定Arm64交叉编译环境,编译生成aarch64库文件
1、在gilb根目录创建下面的文件
aarch64-arm-none-linux.txt
[binaries]
c = 'c:/mhming/ztools/Win2Aarch64/bin/aarch64-none-linux-gnu-gcc'
cpp = 'c:/mhming/ztools/Win2Aarch64/bin/aarch64-none-linux-gnu-g++'
ar = 'c:/mhming/ztools/Win2Aarch64/bin/aarch64-none-linux-gnu-gcc-ar'
ld = 'c:/mhming/ztools/Win2Aarch64/bin/aarch64-none-linux-gnu-gcc-ld'
strip = 'c:/mhming/ztools/Win2Aarch64/bin/aarch64-none-linux-gnu-strip'
[host_machine]
system = 'linux'
cpu_family = 'aarch64'
cpu = 'aarch64'
endian = 'little'
2、打开MSYS2 MINGW64,跳转到gilb根目录
3、环境设置:meson --prefix=C:/mhming/Droid/github/glib2aach64 -Ddefault_library=both --cross-file aarch64-arm-none-linux.txt build-aarch64
4、编译命令:meson compile -C build-aarch64
5、安装命令:meson install -C build-aarch64
错误解决:
ld.exe: warning: libpcre2-8.so.0, needed by glib/libglib-2.0.so.0.7600.6, not found (try using -rpath or -rpath-link)
ld.exe: glib/libglib-2.0.so.0.7600.6: undefined reference to `pcre2_substring_number_from_name_8'
手动将“glib-2.76.6\build-aarch64\subprojects\pcre2-10.42”目录下的“libpcre2-8.so.0.11.0”命名为“libpcre2-8.so.0”
ld.exe: warning: libffi.so.7, needed by gobject/libgobject-2.0.so.0.7600.6, not found (try using -rpath or -rpath-link)
ld.exe: gobject/libgobject-2.0.so.0.7600.6: undefined reference to `ffi_type_uint64@LIBFFI_BASE_7.0'
手动将“glib-2.76.6\build-aarch64\subprojects\libffi\src”目录下的“libffi.so.7.1.0”命名为“libffi.so.7”
移植: