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

scrcpy.exe is not compatible with the version of Windows you're running #46

Closed
BuTau opened this issue Mar 12, 2018 · 17 comments
Closed
Labels

Comments

@BuTau
Copy link

BuTau commented Mar 12, 2018

Hi,

First of all, thanks to devs for creating this tool.
I tried to install it on my Windows 7 32-bit using Nexus 6p Android 8.1 but it does not work.
I can see my device is authorized from adb devices command, but when I then invoke scrcpy, it says the following error:

This version of H:\scrcpy-windows-v1.0\scrcpy.exe is not compatible with the version of Windows you're running. Check your computer's system information to see whether you need a x86 (32-bit) or x64 (64-bit) version of the program, and then contact the software publisher.

adb.exe is already in PATH system variable.
I tried to use Compatibility Mode and set it to Windows 7 and Run As Administrator, but they do not fix the issue.
Does scrcpy require 64-bit and won't work with 32-bit?
Any ideas why this happens and how to resolve it?
Really looking forward to get this working so I can use the tool..

Thanks

@rom1v
Copy link
Collaborator

rom1v commented Mar 12, 2018

If the binary is not compatible with your architecture, you must build it manually.

@BuTau
Copy link
Author

BuTau commented Mar 13, 2018

Thanks @rom1v for the pointer.
I will give it a go to build it manually.

Just wondering though, the pre-built one listed there for which version of Windows and 32/64 bit?

@BuTau
Copy link
Author

BuTau commented Mar 13, 2018

Looks like the pre-built archive for Windows is for 64 bit (x86-x64).

I chose to install MSYS2 i686, but when I tried to download the necessary packages via pacman, it seems stuck.
After I put 'Y' for "Proceed with Installation?", it does not do anything.
Any ideas pls?

Can I get pre-built archive for Windows 32-bit anywhere?

@BuTau
Copy link
Author

BuTau commented Mar 14, 2018

I tried to build manually for Windows 32 bit but stuck on building it via meson.
After installing all the packages mentioned previously, installed Android Studio (SDK), and JDK 8, MSYS2 cannot find meson

$ meson
-bash: meson: command not found

Can anyone give me pointer on what I did wrong?

@stek29
Copy link
Contributor

stek29 commented Mar 14, 2018

JDK 8

Don't even try that

@BuTau
Copy link
Author

BuTau commented Mar 14, 2018

Whats wrong with jdk 8? That's not the reason meson is not there, is it?

I tried to find jdk 9 for 32bit windows but couldn't find it.
Will look again

@stek29
Copy link
Contributor

stek29 commented Mar 14, 2018

@BuTau I'm terribly sorry, I misread it as JDK 9.

@BuTau
Copy link
Author

BuTau commented Mar 14, 2018

@stek29 no probs. Do you have any ideas why meson is not recognised as valid command even after getting the package in msys2 via pacman as stated in the instructions?

@stek29
Copy link
Contributor

stek29 commented Mar 15, 2018

@BuTau probably you're trying it in WSL bash and not msys2

@BuTau
Copy link
Author

BuTau commented Mar 15, 2018

@stek29. I get the meson running now (I run mingw32.exe, instead of msys2.exe) but now giving me another error. It seems it cannot complete the build.

Build started at 2018-03-15T17:43:13.353696
Main binary: C:/msys32_new/mingw32/bin/python3.exe
Python system: Windows
The Meson build system
Version: 0.44.1
Source dir: C:/msys32_new/x
Build dir: C:/msys32_new
Build type: native build

Meson encountered an error:
No statements in code.

A full log can be found at C:/msys32_new/meson-logs/meson-log.txt

The command I ran:
meson x --buildtype release --strip -Db_lto=true -Dprebuilt_server=c:/msys32_new/scrcpy-server-v1.1.jar

Before I ran the command, I downloaded the prebuilt server from
https://github.com/Genymobile/scrcpy/releases/download/v1.1/scrcpy-server-v1.1.jar

Any ideas why the build not successful? :(

P.S. I created a new folder C:/msys32_new/x and created meson.build empty file to get meson build to run

@stek29
Copy link
Contributor

stek29 commented Mar 15, 2018

You should try to build it in directory with sources lol

@BuTau
Copy link
Author

BuTau commented Mar 15, 2018

@stek29 , I am in the directory.
I think the error message

Meson encountered an error:
No statements in code.

complains that there is nothing in meson.build file (I created this manually, empty file).

Any ideas on what should I put in meson.build file to build this?

cc @rom1v

@BuTau
Copy link
Author

BuTau commented Mar 15, 2018

I put this in meson.build

project('scrcpy', 'java')
executable('scrcpy', 'scrcpy-server-v1.1.jar')

and now it complains the following:

@SL-FDPXYZ1 MINGW32 /c/msys32_new/x
$ meson x --buildtype release --strip -Db_lto=true -Dprebuilt_server=c:/msys32_new/x/scrcpy-server-v1.1.jar
The Meson build system
Version: 0.44.1
Source dir: C:/msys32_new/x
Build dir: C:/msys32_new/x/x
Build type: native build
Project name: scrcpy
Native Java compiler: javac (unknown 1.8.0)
Build machine cpu family: x86
Build machine cpu: x86
Build targets in project: 1
Found ninja-1.8.2 at 'C:\msys32_new\mingw32\bin/ninja.EXE'
Traceback (most recent call last):
File "C:/msys32_new/mingw32/lib/python3.6/site-packages\mesonbuild\mesonmain.py", line 366, in run
app.generate()
File "C:/msys32_new/mingw32/lib/python3.6/site-packages\mesonbuild\mesonmain.py", line 151, in generate
self._generate(env)
File "C:/msys32_new/mingw32/lib/python3.6/site-packages\mesonbuild\mesonmain.py", line 209, in _generate
g.generate(intr)
File "C:/msys32_new/mingw32/lib/python3.6/site-packages\mesonbuild\backend\ninjabackend.py", line 215, in generate
self.generate_target(t, outfile)
File "C:/msys32_new/mingw32/lib/python3.6/site-packages\mesonbuild\backend\ninjabackend.py", line 460, in generate_target
obj_list.append(self.generate_single_compile(target, outfile, src, False, [], header_deps))
File "C:/msys32_new/mingw32/lib/python3.6/site-packages\mesonbuild\backend\ninjabackend.py", line 2164, in generate_single_compile
compiler = get_compiler_for_source(target.compilers.values(), src)
File "C:/msys32_new/mingw32/lib/python3.6/site-packages\mesonbuild\mesonlib.py", line 244, in get_compiler_for_source
raise RuntimeError('No specified compiler can handle file {!s}'.format(src))
RuntimeError: No specified compiler can handle file scrcpy-server-v1.1.jar

@rom1v
Copy link
Collaborator

rom1v commented Mar 15, 2018

@BuTau

Source dir: C:/msys32_new/x
Build dir: C:/msys32_new/x/x

As @stek29 said, the meson command must be called from the scrcpy project root directory.

Where did you git clone it?

git clone https://github.com/Genymobile/scrcpy
cd scrcpy
meson x --buildtype release -Db_lto=true -Dprebuilt_server=…

@BuTau
Copy link
Author

BuTau commented Mar 16, 2018

Thanks @rom1v for the pointer.
I can do the meson build successfully now.
However, after cd x and ran ninja command, it gave the following error:

$ ninja
[1/30] Compiling C object app/scrcpy@exe/src_controlevent.c.obj.
[2/30] Compiling C object app/scrcpy@exe/src_convert.c.obj.
[3/30] Compiling C object app/scrcpy@exe/src_fpscounter.c.obj.
[4/30] Compiling C object app/scrcpy@exe/src_controller.c.obj.
FAILED: app/scrcpy@exe/src_controller.c.obj
cc @app/scrcpy@exe/src_controller.c.obj.rsp
In file included from ../app/src/controller.h:10:0,
                 from ../app/src/controller.c:1:
../app/src/net.h:12:18: error: conflicting types for 'size_t'
   typedef SIZE_T size_t;
                  ^~~~~~
In file included from C:/msys32_new/mingw32/i686-w64-mingw32/include/sys/types.h                                           :13:0,
                 from C:/msys32_new/mingw32/include/SDL2/SDL_stdinc.h:34,
                 from C:/msys32_new/mingw32/include/SDL2/SDL_mutex.h:31,
                 from ../app/src/controlevent.h:4,
                 from ../app/src/controller.h:4,
                 from ../app/src/controller.c:1:
C:/msys32_new/mingw32/i686-w64-mingw32/include/crtdefs.h:37:22: note: previous d                                           eclaration of 'size_t' was here
 typedef unsigned int size_t;
                      ^~~~~~
In file included from ../app/src/controller.h:10:0,
                 from ../app/src/controller.c:1:
../app/src/net.h:13:19: error: conflicting types for 'ssize_t'
   typedef SSIZE_T ssize_t;
                   ^~~~~~~
In file included from C:/msys32_new/mingw32/i686-w64-mingw32/include/sys/types.h                                           :13:0,
                 from C:/msys32_new/mingw32/include/SDL2/SDL_stdinc.h:34,
                 from C:/msys32_new/mingw32/include/SDL2/SDL_mutex.h:31,
                 from ../app/src/controlevent.h:4,
                 from ../app/src/controller.h:4,
                 from ../app/src/controller.c:1:
C:/msys32_new/mingw32/i686-w64-mingw32/include/crtdefs.h:47:13: note: previous d                                           eclaration of 'ssize_t' was here
 typedef int ssize_t;
             ^~~~~~~
[5/30] Compiling C object app/scrcpy@exe/src_device.c.obj.
FAILED: app/scrcpy@exe/src_device.c.obj
cc @app/scrcpy@exe/src_device.c.obj.rsp
In file included from ../app/src/device.h:7:0,
                 from ../app/src/device.c:1:
../app/src/net.h:12:18: error: conflicting types for 'size_t'
   typedef SIZE_T size_t;
                  ^~~~~~
In file included from C:/msys32_new/mingw32/i686-w64-mingw32/include/sys/types.h                                           :13:0,
                 from C:/msys32_new/mingw32/include/SDL2/SDL_stdinc.h:34,
                 from ../app/src/device.h:4,
                 from ../app/src/device.c:1:
C:/msys32_new/mingw32/i686-w64-mingw32/include/crtdefs.h:37:22: note: previous d                                           eclaration of 'size_t' was here
 typedef unsigned int size_t;
                      ^~~~~~
In file included from ../app/src/device.h:7:0,
                 from ../app/src/device.c:1:
../app/src/net.h:13:19: error: conflicting types for 'ssize_t'
   typedef SSIZE_T ssize_t;
                   ^~~~~~~
In file included from C:/msys32_new/mingw32/i686-w64-mingw32/include/sys/types.h                                           :13:0,
                 from C:/msys32_new/mingw32/include/SDL2/SDL_stdinc.h:34,
                 from ../app/src/device.h:4,
                 from ../app/src/device.c:1:
C:/msys32_new/mingw32/i686-w64-mingw32/include/crtdefs.h:47:13: note: previous d                                           eclaration of 'ssize_t' was here
 typedef int ssize_t;
             ^~~~~~~
[6/30] Compiling C object app/scrcpy@exe/src_frames.c.obj.
[7/30] Compiling C object app/scrcpy@exe/src_command.c.obj.
In file included from ../app/src/command.c:7:0:
../app/src/command.c: In function 'process_check_success':
../app/src/command.c:89:18: warning: format '%u' expects argument of type 'unsig                                           ned int', but argument 4 has type 'exit_code_t {aka long unsigned int}' [-Wforma                                           t=]
             LOGE("\"%s\" returned with value %" PRIexitcode, name, exit_code);
                  ^
../app/src/log.h:9:62: note: in definition of macro 'LOGE'
 #define LOGE(...) SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, __VA_ARGS__)
                                                              ^~~~~~~~~~~
In file included from ../app/src/command.c:1:0:
../app/src/command.h:15:25: note: format string is defined here
 #   define PRIexitcode "u"
[8/30] Compiling C object app/scrcpy@exe/src_main.c.obj.
[9/30] Compiling C object app/scrcpy@exe/src_decoder.c.obj.
FAILED: app/scrcpy@exe/src_decoder.c.obj
cc @app/scrcpy@exe/src_decoder.c.obj.rsp
In file included from ../app/src/decoder.h:7:0,
                 from ../app/src/decoder.c:1:
../app/src/net.h:12:18: error: conflicting types for 'size_t'
   typedef SIZE_T size_t;
                  ^~~~~~
In file included from C:/msys32_new/mingw32/i686-w64-mingw32/include/sys/types.h                                           :13:0,
                 from C:/msys32_new/mingw32/include/SDL2/SDL_stdinc.h:34,
                 from ../app/src/decoder.h:4,
                 from ../app/src/decoder.c:1:
C:/msys32_new/mingw32/i686-w64-mingw32/include/crtdefs.h:37:22: note: previous d                                           eclaration of 'size_t' was here
 typedef unsigned int size_t;
                      ^~~~~~
In file included from ../app/src/decoder.h:7:0,
                 from ../app/src/decoder.c:1:
../app/src/net.h:13:19: error: conflicting types for 'ssize_t'
   typedef SSIZE_T ssize_t;
                   ^~~~~~~
In file included from C:/msys32_new/mingw32/i686-w64-mingw32/include/sys/types.h                                           :13:0,
                 from C:/msys32_new/mingw32/include/SDL2/SDL_stdinc.h:34,
                 from ../app/src/decoder.h:4,
                 from ../app/src/decoder.c:1:
C:/msys32_new/mingw32/i686-w64-mingw32/include/crtdefs.h:47:13: note: previous d                                           eclaration of 'ssize_t' was here
 typedef int ssize_t;
             ^~~~~~~
ninja: build stopped: subcommand failed.

What did I do wrong now?

rom1v added a commit that referenced this issue Mar 16, 2018
The types size_t and ssize_t are defined on Windows (in MSYS2), so there
is no need to typedef SIZE_T and SSIZE_T.

Exit code is "unsigned long" both on Windows 32 and 64 bits.

See <#46 (comment)>.
@rom1v
Copy link
Collaborator

rom1v commented Mar 16, 2018

What did I do wrong now?

Nothing, thank you for the report. 👍

I just fixed it on master: 821ec98

Just update to the last version (git pull).

@rom1v rom1v added the build label Mar 16, 2018
@BuTau
Copy link
Author

BuTau commented Mar 18, 2018

Thanks @rom1v. got it all working now! Cheers!

@rom1v rom1v closed this as completed Mar 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants