Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cant build it on windows... #1928

Open
AcTiViSioN911 opened this issue Nov 21, 2020 · 18 comments
Open

Cant build it on windows... #1928

AcTiViSioN911 opened this issue Nov 21, 2020 · 18 comments

Comments

@AcTiViSioN911
Copy link

AcTiViSioN911 commented Nov 21, 2020

Hello! Can anyone update the build instruction for Windows? I've been trying to build the application for several hours, and constantly some errors, mainly due to the fact that nowhere is it written what and from which repositories you need to install, for example, not a word about mason, and as I understand it, it is needed for building, the same is with gradle and maybe something else, but I don't understand anything about Linux. I've fixed a bunch of problems with the PATH environment, but maybe I'm missing something else.
Now I have a problem with the first line of this code:

VERSION: = $ (shell git describe --tags --always)
WIN32_TARGET: = $ (WIN32_TARGET_DIR) - $ (VERSION) .zip
WIN64_TARGET: = $ (WIN64_TARGET_DIR) - $ (VERSION) .zip

As I understand it, there should be something like "1.6", but I have an error "git repo not found"...
After manually fixing it, I get the following output with a mason error "meson.build:1:0: ERROR: Unknown compiler(s): ['cc', 'gcc', 'clang', 'pgcc', 'icc']" that I don't know how to solve:

# make -f Makefile.CrossWindows
./gradlew clean

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.3/userguide/command_line_interface.html#sec:command_line_warnings

BUILD SUCCESSFUL in 629ms
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 -Dcompile_app=false )
The Meson build system
Version: 0.55.1
Source dir: /c/Users/user/Desktop/scrcpy-1.16
Build dir: /c/Users/user/Desktop/scrcpy-1.16/build-server
Build type: native build
Using 'PKG_CONFIG_PATH' from environment with value: '/usr/lib/pkgconfig:/usr/share/pkgconfig:/lib/pkgconfig'
Using 'PKG_CONFIG_PATH' from environment with value: '/usr/lib/pkgconfig:/usr/share/pkgconfig:/lib/pkgconfig'
Project name: scrcpy
Project version: 1.16

meson.build:1:0: ERROR: Unknown compiler(s): ['cc', 'gcc', 'clang', 'pgcc', 'icc']
The follow exceptions were encountered:
Running "cc --version" gave "[Errno 2] No such file or directory: 'cc'"
Running "gcc --version" gave "[Errno 2] No such file or directory: 'gcc'"
Running "clang --version" gave "[Errno 2] No such file or directory: 'clang'"
Running "pgcc --version" gave "[Errno 2] No such file or directory: 'pgcc'"
Running "icc --version" gave "[Errno 2] No such file or directory: 'icc'"

A full log can be found at /c/Users/user/Desktop/scrcpy-1.16/build-server/meson-logs/meson-log.txt
make: *** [Makefile.CrossWindows:45: build-server] Error 1
@AcTiViSioN911
Copy link
Author

AcTiViSioN911 commented Nov 21, 2020

Links to ffmpeg-4.3.1-win32-shared and -dev are dead... i couldnt find -dev one, hope its the same as -shared...

@rom1v
Copy link
Collaborator

rom1v commented Nov 21, 2020

Can anyone update the build instruction for Windows?

scrcpy build system is designed for Linux. You can either build from MSYS2 on Windows, or cross-compile it from Linux: https://github.com/Genymobile/scrcpy/blob/master/BUILD.md#in-msys2

Links to ffmpeg-4.3.1-win32-shared and -dev are dead... i couldnt find -dev one, hope its the same as -shared...

#1753

@AcTiViSioN911
Copy link
Author

AcTiViSioN911 commented Nov 21, 2020

I thought the 1.6 release would be more stable than just downloading the sources...
I am doing this in MSYS2, and I still get the error

fatal: not a git repository (or any of the parent directories): .git
./gradlew clean

It cannot get version 1.6 (if I understand correctly), so MSYS2 doesn't seem to work as it should.
Even though I don't need a server now, I get the following error

A problem occurred configuring project ': server'.
> SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.

Looks like I need to install the Android Studio with SDK?

@AcTiViSioN911
Copy link
Author

AcTiViSioN911 commented Nov 21, 2020

I cant beat this error...

user@WIN-HUTT3SCEIES MSYS /c/Users/user/Desktop/BUILD
# make -f Makefile.CrossWindows
./gradlew clean
:clean UP-TO-DATE
:server:clean UP-TO-DATE

BUILD SUCCESSFUL in 1s
2 actionable tasks: 2 up-to-date
rm -rf "build-server" "build-win32" "build-win64" "dist"
[ -d "build-server" ] || ( mkdir "build-server" && \
        meson "build-server" \
                --buildtype release -Dbuild_app=false )
The Meson build system
Version: 0.55.1
Source dir: /c/Users/user/Desktop/BUILD
Build dir: /c/Users/user/Desktop/BUILD/build-server
Build type: native build
Using 'PKG_CONFIG_PATH' from environment with value: '/usr/lib/pkgconfig:/usr/share/pkgconfig:/lib/pkgconfig'
Using 'PKG_CONFIG_PATH' from environment with value: '/usr/lib/pkgconfig:/usr/share/pkgconfig:/lib/pkgconfig'
Project name: scrcpy
Project version: undefined

meson.build:1:0: ERROR: Unknown compiler(s): ['cc', 'gcc', 'clang', 'pgcc', 'icc']
The follow exceptions were encountered:
Running "cc --version" gave "[Errno 2] No such file or directory: 'cc'"
Running "gcc --version" gave "[Errno 2] No such file or directory: 'gcc'"
Running "clang --version" gave "[Errno 2] No such file or directory: 'clang'"
Running "pgcc --version" gave "[Errno 2] No such file or directory: 'pgcc'"
Running "icc --version" gave "[Errno 2] No such file or directory: 'icc'"

A full log can be found at /c/Users/user/Desktop/BUILD/build-server/meson-logs/meson-log.txt
make: *** [Makefile.CrossWindows:41: build-server] Error 1

And in meson log:
None of 'CC' are defined in the environment, not changing global flags.

@AcTiViSioN911
Copy link
Author

Similar issue mesonbuild/meson#7323

@rom1v
Copy link
Collaborator

rom1v commented Nov 21, 2020

On MSYS/mingw64, you have to build with meson, not make -f Makefile.CrossWindows. Please follow the doc step by steps.

@AcTiViSioN911
Copy link
Author

Its always same error:
meson.build:1:0: ERROR: Unknown compiler(s): ['cc', 'gcc', 'clang', 'pgcc', 'icc']
I tried meson in root folder, in app folder, even in src folder with editing .build file.

@rom1v
Copy link
Collaborator

rom1v commented Nov 21, 2020

@AcTiViSioN911
Copy link
Author

Yes both commands of pacman, but only for x64.

@rom1v
Copy link
Collaborator

rom1v commented Nov 21, 2020

In the MSYS2 folder, IIUC there is MSYS2.exe and mingw64.exe. The correct one is the latter.

@AcTiViSioN911
Copy link
Author

It worked, now i have this error:

user@WIN-HUTT3SCEIES MINGW64 /c/Users/user/Desktop/build2
# meson build
The Meson build system
Version: 0.55.1
Source dir: C:/Users/user/Desktop/build2
Build dir: C:/Users/user/Desktop/build2/build
Build type: native build
Using 'PKG_CONFIG_PATH' from environment with value: 'C:\\msys64\\mingw64\\lib\\pkgconfig;C:\\msys64\\mingw64\\share\\pkgconfig'
Using 'PKG_CONFIG_PATH' from environment with value: 'C:\\msys64\\mingw64\\lib\\pkgconfig;C:\\msys64\\mingw64\\share\\pkgconfig'
Project name: scrcpy
Project version: undefined
C compiler for the host machine: cc (gcc 10.2.0 "cc (Rev1, Built by MSYS2 project) 10.2.0")
C linker for the host machine: cc ld.bfd 2.35
Host machine cpu family: x86_64
Host machine cpu: x86_64
Found pkg-config: C:\msys64\mingw64\bin/pkg-config.EXE (0.29.2)
Using 'PKG_CONFIG_PATH' from environment with value: 'C:\\msys64\\mingw64\\lib\\pkgconfig;C:\\msys64\\mingw64\\share\\pkgconfig'
Run-time dependency libavformat found: YES 58.45.100
Using 'PKG_CONFIG_PATH' from environment with value: 'C:\\msys64\\mingw64\\lib\\pkgconfig;C:\\msys64\\mingw64\\share\\pkgconfig'
Run-time dependency libavcodec found: YES 58.91.100
Using 'PKG_CONFIG_PATH' from environment with value: 'C:\\msys64\\mingw64\\lib\\pkgconfig;C:\\msys64\\mingw64\\share\\pkgconfig'
Run-time dependency libavutil found: YES 56.51.100
Using 'PKG_CONFIG_PATH' from environment with value: 'C:\\msys64\\mingw64\\lib\\pkgconfig;C:\\msys64\\mingw64\\share\\pkgconfig'
Run-time dependency sdl2 found: YES 2.0.12
Library ws2_32 found: YES
Configuring config.h using configuration
Program ./scripts/build-wrapper.sh found: YES
server/meson.build:11: WARNING: Custom target input '.' can't be converted to File object(s).
This will become a hard error in the future.
Build targets in project: 6

Found ninja.EXE-1.10.1 at C:\msys64\mingw64\bin/ninja.EXE

I see some new files in build folder, but its not finished.

@rom1v
Copy link
Collaborator

rom1v commented Nov 21, 2020

@AcTiViSioN911
Copy link
Author

AcTiViSioN911 commented Nov 21, 2020

user@WIN-HUTT3SCEIES MINGW64 /c/Users/user/Desktop/build2
# meson build
The Meson build system
Version: 0.55.1
Source dir: C:/Users/user/Desktop/build2
Build dir: C:/Users/user/Desktop/build2/build
Build type: native build
Using 'PKG_CONFIG_PATH' from environment with value: 'C:\\msys64\\mingw64\\lib\\pkgconfig;C:\\msys64\\mingw64\\share\\pkgconfig'
Using 'PKG_CONFIG_PATH' from environment with value: 'C:\\msys64\\mingw64\\lib\\pkgconfig;C:\\msys64\\mingw64\\share\\pkgconfig'
Project name: scrcpy
Project version: undefined
C compiler for the host machine: cc (gcc 10.2.0 "cc (Rev1, Built by MSYS2 project) 10.2.0")
C linker for the host machine: cc ld.bfd 2.35
Host machine cpu family: x86_64
Host machine cpu: x86_64
Found pkg-config: C:\msys64\mingw64\bin/pkg-config.EXE (0.29.2)
Using 'PKG_CONFIG_PATH' from environment with value: 'C:\\msys64\\mingw64\\lib\\pkgconfig;C:\\msys64\\mingw64\\share\\pkgconfig'
Run-time dependency libavformat found: YES 58.45.100
Using 'PKG_CONFIG_PATH' from environment with value: 'C:\\msys64\\mingw64\\lib\\pkgconfig;C:\\msys64\\mingw64\\share\\pkgconfig'
Run-time dependency libavcodec found: YES 58.91.100
Using 'PKG_CONFIG_PATH' from environment with value: 'C:\\msys64\\mingw64\\lib\\pkgconfig;C:\\msys64\\mingw64\\share\\pkgconfig'
Run-time dependency libavutil found: YES 56.51.100
Using 'PKG_CONFIG_PATH' from environment with value: 'C:\\msys64\\mingw64\\lib\\pkgconfig;C:\\msys64\\mingw64\\share\\pkgconfig'
Run-time dependency sdl2 found: YES 2.0.12
Library ws2_32 found: YES
Configuring config.h using configuration
server/meson.build:11: WARNING: Custom target input '.' can't be converted to File object(s).
This will become a hard error in the future.
Build targets in project: 6

Found ninja.EXE-1.10.1 at C:\msys64\mingw64\bin/ninja.EXE

If i run meson again i see this message:

user@WIN-HUTT3SCEIES MINGW64 /c/Users/user/Desktop/build2
# meson build
Directory already configured.

Just run your build command (e.g. ninja) and Meson will regenerate as necessary.
If ninja fails, run "ninja reconfigure" or "meson --reconfigure"
to force Meson to regenerate.

If build failures persist, run "meson setup --wipe" to rebuild from scratch
using the same options as passed when configuring the build.
To change option values, run "meson configure" instead.

@AcTiViSioN911
Copy link
Author

AcTiViSioN911 commented Nov 22, 2020

Installed debian, same error:

The Meson build system
Version: 0.49.2
Source dir: /home/oneonline/Desktop/scrcpydebian
Build dir: /home/oneonline/Desktop/scrcpydebian/build
Build type: native build
Project name: scrcpy
Project version: undefined
Native C compiler: cc (gcc 8.3.0 "cc (Debian 8.3.0-6) 8.3.0")
Build machine cpu family: x86_64
Build machine cpu: x86_64
Found pkg-config: /usr/bin/pkg-config (0.29)
Dependency libavformat found: YES 58.20.100
Dependency libavcodec found: YES 58.35.100
Dependency libavutil found: YES 56.22.100
Dependency sdl2 found: YES 2.0.9
Configuring config.h using configuration
Program ./scripts/build-wrapper.sh found: YES (/home/oneonline/Desktop/scrcpydebian/server/./scripts/build-wrapper.sh)
WARNING: Custom target input '.' can't be converted to File object(s).
This will become a hard error in the future.
DEPRECATION: build_always is deprecated. Combine build_by_default and build_always_stale instead.

@rom1v
Copy link
Collaborator

rom1v commented Nov 22, 2020

# meson build
Directory already configured.

Because your builddir (here build) is already configured.

rm -rf build

and retry.

(but in theory you don't have to rerun the meson command if you don't change settings.

@rom1v
Copy link
Collaborator

rom1v commented Nov 22, 2020

This will become a hard error in the future.
DEPRECATION: build_always is deprecated. Combine build_by_default and build_always_stale instead.

This error should not happen anymore, it has been "fixed" by eb8f7a1 (included in v1.13).

I thought the 1.6 release would be more stable than just downloading the sources...

v1.6 has been released almost 2 years ago. Why do you want to build this old version instead of the latest (v1.16)?

@AcTiViSioN911
Copy link
Author

I meant 1.16, it's a typo :)
I am using https://github.com/xfirefly/scrcpy_vs_latest on Windows, compiles fine.

@rom1v
Copy link
Collaborator

rom1v commented Nov 23, 2020

I meant 1.16, it's a typo :)

But given the error message you had, you did not use the latest version (but a version prior to v1.13).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants