Building PhantomJS-2 from source on Windows

与世无争的帅哥 提交于 2019-12-03 20:25:29

Make sure that path to qmake & nmake are correct in you %PATH% For me it was:

Path to qmake - C:\Qt\Qt5.3.2\5.3\msvc2013_64\bin 
Path to nmake - C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin

Possible the same for 'mingw32-make'

I've double checked on Phantomjs source code and it seems that you don't need to download and install qt, it is already part of the source code. To build PhantomJS 2 you need:

  1. Set path to following files nmake.exe, rc.exe and to mt.exe - C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Bin;C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin
  2. ENV Variables:
    • INCLUDE: VC & Windows SDK include folder - C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include;C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\include
    • LIB: VC & Windows SDK Lib folder - C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\lib;C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\lib

Also before start build you need to run vcvarsall.bat with correct configuration, In my case I used amd64_x86 parameter To run build I made following steps: - git clone git://github.com/ariya/phantomjs.git - cd phantomjs - build

For those using Cygwin, make sure that a windows install of perl is in PATH before the Cygwin binaries.

I had the issue where all the steps were going okay but as I was using Cygwin perl the file paths were in the format of /cygdrive/c/.. which windows doesn't understand and so fails with no useful output in build.cmd.

This was found by running the preconfig.cmd inside phantomjs/src/qt

Putting the executable mingw32-make.exe inside phantomjs\src\qt\3rdparty\gnuwin32\bin solved this issue for me.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!