norman784 / libimobiledevice-node

A cross-platform software protocol library and tools to communicate with iOS® devices natively.
MIT License
25 stars 8 forks source link

Windows errors when trying to compile it #3

Closed didix21 closed 5 years ago

didix21 commented 5 years ago

I was trying to compile your project in windows. To do so, I have used cygwin for compiling the libimobiledevice library and its dependencies. The problems appear when executing node-gyp command because it is using msvc compiler and apperently there is no way to change the compiler.

The error is the following:

[1/4] Resolving packages...
success Already up-to-date.
$ node-gyp rebuild && dos2unix postinstall.sh && dos2unix sh postinstall.sh
gyp info it worked if it ends with ok
gyp info using node-gyp@3.6.2
gyp info using node@8.15.0 | win32 | x64
gyp info spawn C:\Python27\python.exe
gyp info spawn args [ 'C:\\Users\\lospepes\\repos\\libimobiledevice-node\\node_modules\\node-gyp\\gyp\\gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'msvs',
gyp info spawn args   '-G',
gyp info spawn args   'msvs_version=2015',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\lospepes\\repos\\libimobiledevice-node\\build\\config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\lospepes\\repos\\libimobiledevice-node\\node_modules\\node-gyp\\addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\lospepes\\.node-gyp\\8.15.0\\include\\node\\common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=C:\\Users\\lospepes\\.node-gyp\\8.15.0',
gyp info spawn args   '-Dnode_gyp_dir=C:\\Users\\lospepes\\repos\\libimobiledevice-node\\node_modules\\node-gyp',
gyp info spawn args   '-Dnode_lib_file=C:\\Users\\lospepes\\.node-gyp\\8.15.0\\<(target_arch)\\node.lib',
gyp info spawn args   '-Dmodule_root_dir=C:\\Users\\lospepes\\repos\\libimobiledevice-node',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'C:\\Users\\lospepes\\repos\\libimobiledevice-node\\build',
gyp info spawn args   '-Goutput_dir=.' ]
gyp info spawn C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\MSBuild.exe
gyp info spawn args [ 'build/binding.sln',
gyp info spawn args   '/clp:Verbosity=minimal',
gyp info spawn args   '/nologo',
gyp info spawn args   '/p:Configuration=Release;Platform=x64' ]

  binding.cc
  win_delay_load_hook.cc
  id.c
  info.c
  backup2.c
c:\users\lospepes\repos\libimobiledevice-node\src\idevice\backup2.c(12): fatal error C1083: No se puede abrir el archiv
o incluir: 'unistd.h': No such file or directory [C:\Users\lospepes\repos\libimobiledevice-node\build\libimobiledevice.
vcxproj]
  common_binding.c
  utils.c
c:\users\lospepes\repos\libimobiledevice-node\src\common\utils.c(30): fatal error C1083: No se puede abrir el archivo i
ncluir: 'sys/time.h': No such file or directory [C:\Users\lospepes\repos\libimobiledevice-node\build\libimobiledevice.v
cxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\MSBuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Users\lospepes\repos\libimobiledevice-node\node_modules\node-gyp\lib\build.js:258:23)
gyp ERR! stack     at emitTwo (events.js:126:13)
gyp ERR! stack     at ChildProcess.emit (events.js:214:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Windows_NT 10.0.17763
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\lospepes\\repos\\libimobiledevice-node\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\lospepes\repos\libimobiledevice-node
gyp ERR! node -v v8.15.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

Software versions:

norman784 commented 5 years ago

I don't use Node in Windows nor cygwin, so I don't know exactly how to solve this at the moment. If you found a solution feel free to send a PR.

didix21 commented 5 years ago

I close the issue because I couldn't find any way to compile it with cygwim. Right know I'm developing a windows version using the following libimobiledevice-win32 package.