Genymobile / Genymobile/scrcpy

Can't build for Windows in Ubuntu 22.04.

Open
#4,752 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
150k
Forks
13.7k
Avg merge
4d 13h
Merged PRs (30d)
2

Description

- [x] I have read the [FAQ](https://github.com/Genymobile/scrcpy/blob/master/FAQ.md).
- [x] I have searched in existing [issues](https://github.com/Genymobile/scrcpy/issues).

**Environment**
- OS: Ubuntu 22.04 LTS
- scrcpy version: v2.4
- installation method: manual
- device model: N/A
- Android version: N/A

**Describe the bug**

Hey I am trying to build scrcpy for win64 client. I have follow the build instructurction, but I don't need the server but only the client. So I figured out the command below.

`meson setup build-win64 --cross-file cross_win64_modified.txt --buildtype release --strip -Db_lto=true -Dprebuilt_server=/home/ubuntu/dev/c/scrcpy/scrcpy-server-v2.4 `

However it fails if I run
```
The Meson build system
Version: 0.61.2
Source dir: /home/ubuntu/dev/c/scrcpy
Build dir: /home/ubuntu/dev/c/scrcpy/build-win64
Build type: cross build
Project name: scrcpy
Project version: 2.4
C compiler for the host machine: x86_64-w64-mingw32-gcc (gcc 10.0.0 "x86_64-w64-mingw32-gcc (GCC) 10-win32 20220113")
C linker for the host machine: x86_64-w64-mingw32-gcc ld.bfd 2.38
C compiler for the build machine: cc (gcc 11.4.0 "cc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0")
C linker for the build machine: cc ld.bfd 2.38
Build machine cpu family: x86_64
Build machine cpu: x86_64
Host machine cpu family: x86
Host machine cpu: x86_64
Target machine cpu family: x86
Target machine cpu: x86_64
Windows resource compiler: GNU windres (GNU Binutils) 2.38
Found Pkg-config: NO
Found CMake: NO
Run-time dependency libavformat found: NO

app/meson.build:106:0: ERROR: Pkg-config binary for machine 1 not found. Giving up.

A full log can be found at /home/ubuntu/dev/c/scrcpy/build-win64/meson-logs/meson-log.txt
```
I did install it.

```
sudo apt install mingw-w64 mingw-w64-tools
```

What should I do or check? Is this even a correct command? if I omit `--cross-file cross_win64_modified.txt` It does configure and I can finish the build. but I can't find `scrcpy.exe`. What would be the correct steps to compile win64 client in Ubuntu 22.04?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with cross_win64_modified.txt and the failure in app/meson.build:106, then inspect build-win64/meson-logs/meson-log.txt to determine why Meson cannot find the host-machine pkg-config binary. Verify the cross-build configuration and dependency discovery, then confirm that the client-only build completes and produces scrcpy.exe.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.