scrcpy icon indicating copy to clipboard operation
scrcpy copied to clipboard

libusb-1.0/libusb.h: No such file or directory (audio)

Open Ghoulean opened this issue 7 years ago • 1 comments

Audio branch. Ubuntu 16.04, attempting to cross-build for Windows.

root@ubuntu-s-1vcpu-1gb-nyc1-01:~/scrcpy# make -f Makefile.CrossWindows
./gradlew clean

BUILD SUCCESSFUL in 1s
2 actionable tasks: 2 up-to-date
rm -rf "build-server" "build-win32" "build-win64" \
           "build-win32-noconsole" "build-win64-noconsole" "dist"
[ -d "build-server" ] || ( mkdir "build-server" && \
        meson "build-server" \
                --buildtype release -Dbuild_app=false )
The Meson build system
Version: 0.48.2
Source dir: /root/scrcpy
Build dir: /root/scrcpy/build-server
Build type: native build
Project name: scrcpy
Project version: undefined
Native C compiler: cc (gcc 5.4.0 "cc (Ubuntu 5.4.0-6ubuntu1~16.04.10) 5.4.0 20160609")
Build machine cpu family: x86_64
Build machine cpu: x86_64
Program ./scripts/build-wrapper.sh found: YES (/root/scrcpy/server/./scripts/build-wrapper.sh)
DEPRECATION: build_always is deprecated. Combine build_by_default and build_always_stale instead.
Build targets in project: 2
Found ninja-1.5.1 at /usr/bin/ninja
ninja -C "build-server"
ninja: Entering directory `build-server'
[1/1] Generating scrcpy-server with a custom command.
(not invoking gradle, since we are root)
make -C prebuilt-deps prepare-win32
make[1]: Entering directory '/root/scrcpy/prebuilt-deps'
SDL2-2.0.8: found
ffmpeg-4.0.2-win32-shared: found
ffmpeg-4.0.2-win32-dev: found
platform-tools: found
make[1]: Leaving directory '/root/scrcpy/prebuilt-deps'
[ -d "build-win32" ] || ( mkdir "build-win32" && \
        meson "build-win32" \
                --cross-file cross_win32.txt \
                --buildtype release --strip -Db_lto=true \
                -Dcrossbuild_windows=true \
                -Dbuild_server=false \
                -Doverride_server_path=scrcpy-server.jar )
The Meson build system
Version: 0.48.2
Source dir: /root/scrcpy
Build dir: /root/scrcpy/build-win32
Build type: cross build
Project name: scrcpy
Project version: undefined
Native C compiler: cc (gcc 5.4.0 "cc (Ubuntu 5.4.0-6ubuntu1~16.04.10) 5.4.0 20160609")
Cross C compiler: /usr/bin/i686-w64-mingw32-gcc (gcc 5.3.1)
Host machine cpu family: x86
Host machine cpu: i686
Target machine cpu family: x86
Target machine cpu: i686
Build machine cpu family: x86_64
Build machine cpu: x86_64
Library SDL2 found: YES
Library SDL2main found: YES
Library avcodec-58 found: YES
Library avformat-58 found: YES
Library avutil-56 found: YES
Library mingw32 found: YES
Library ws2_32 found: YES
Configuring config.h using configuration
Build targets in project: 5
Found ninja-1.5.1 at /usr/bin/ninja
ninja -C "build-win32"
ninja: Entering directory `build-win32'
[20/32] Compiling C object 'app/app@@scrcpy@exe/src_aoa.c.obj'.
FAILED: /usr/bin/i686-w64-mingw32-gcc -Iapp/app@@scrcpy@exe -Iapp -I../app -I../app/src -I../app/../prebuilt-deps/ffmpeg-4.0.2-win32-dev/include -I../app/../prebuilt-deps/SDL2-2.0.8/i686-w64-mingw32/include -flto -fdiagnostics-color=always -pipe -Wall -Winvalid-pch -std=c11 -O3  -MD -MQ 'app/app@@scrcpy@exe/src_aoa.c.obj' -MF 'app/app@@scrcpy@exe/src_aoa.c.obj.d' -o 'app/app@@scrcpy@exe/src_aoa.c.obj' -c ../app/src/aoa.c
../app/src/aoa.c:4:31: fatal error: libusb-1.0/libusb.h: No such file or directory
compilation terminated.
[20/32] Compiling C object 'app/app@@scrcpy@exe/src_audio.c.obj'.
ninja: build stopped: subcommand failed.
Makefile.CrossWindows:54: recipe for target 'build-win32' failed
make: *** [build-win32] Error 1
root@ubuntu-s-1vcpu-1gb-nyc1-01:~/scrcpy#

Both libusb and libusb-dev are installed:

root@ubuntu-s-1vcpu-1gb-nyc1-01:~/scrcpy# sudo apt install libusb-1.0-0 libusb-1.0-0-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
libusb-1.0-0 is already the newest version (2:1.0.20-1).
libusb-1.0-0-dev is already the newest version (2:1.0.20-1).
The following package was automatically installed and is no longer required:
  ninja-build
Use 'sudo apt autoremove' to remove it.
0 upgraded, 0 newly installed, 0 to remove and 77 not upgraded.

Ghoulean avatar Dec 11 '18 01:12 Ghoulean

Since I never managed to make libusb work on Windows, I did not change the cross-compilation script to work with libusb (it does not work anyway).

If you want to test on Windows, you can build directly on Windows in MSYS2.

rom1v avatar Dec 11 '18 07:12 rom1v