Need Guidance: Cross-Compiling MPV on Ubuntu 24.04 #14275
Replies: 6 comments 16 replies
-
I've updated docs to reflect better current state of things, see compile-windows.md. As for your issue. Remove See https://mesonbuild.com/Cross-compilation.html#defining-the-environment for details, specifically |
Beta Was this translation helpful? Give feedback.
-
I have changed my pkg-config path to mingw pkg but getting error like It seems I have to write my own pc file for mingw which is not feasible for me since am totally new to linux and same time am working on mys2 but able to generate mpv. Exe but that's not static linked Thanks please suggest better way |
Beta Was this translation helpful? Give feedback.
-
Yes, you need to compile everything yourself when cross-compiling so the libraries are available. Meson can do it for you.
You don't have to write own .pc, they would be generate when ffmpeg is installed for example to custom cross-compiling root.
Please refer to compile-windows.md I linked before. It should have all information you need. If something is unclear or missing, please let me know, I will update the document. Generally it is possible to create static library in any build environment, whether it is MSYS2, cross-compilation from Linux or MSVC Clang build. There are minor differences in setup process, but this is all Meson doing heavy lifting. |
Beta Was this translation helpful? Give feedback.
-
Hi @kasper93 , However, I encountered an issue while trying to pass certain arguments. Specifically, I received an error stating: "Error parsing option no-osc (option not found)" string mpvArgs = """ + rel_video_path + """ + |
Beta Was this translation helpful? Give feedback.
-
I worked on a project like this one a couple years ago. Outdated documentation https://github.com/rboxeur/mpv-i686-cross-compiling-MinGW32-Doc/blob/master/index.rst |
Beta Was this translation helpful? Give feedback.
-
Just use mpv-winbuild to build mpv via GHA. you can find prebuilt LGPL builds. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Important Information
Reproduction Steps
git clone https://github.com/mpv-player/mpv.git
cd mpv
meson setup build --cross-file crossfile.txt -Dlibmpv=true
meson compile -C build
got error in compilation steps
Expected Behavior
The build process should complete successfully with all dependencies properly resolved and compiled, resulting in a functional cross-compiled version of MPV.
Actual Behavior
Managed to start the build but faced a new error with missing features.h. and so on
Log File
I would appreciate detailed steps or documentation on how to:
Set up the cross-compilation environment for MPV on Ubuntu 24.04.
Install and configure all necessary tools and dependencies.
if any suggest
NOTE : Successfully built MPV natively on Linux. but looking for Need to set -Dgpl=false for the Windows build.
crossfieltext.txt
c = 'x86_64-w64-mingw32-gcc'
cpp = 'x86_64-w64-mingw32-g++'
ar = 'x86_64-w64-mingw32-ar'
strip = 'x86_64-w64-mingw32-strip'
pkg-config = 'pkg-config'
exe_wrapper = 'wine64'
windres = '/usr/bin/x86_64-w64-mingw32-windres'
[host_machine]
system = 'windows'
cpu_family = 'x86_64'
cpu = 'x86_64'
endian = 'little'
I carefully read all instruction and confirm that I did the following:
Beta Was this translation helpful? Give feedback.
All reactions