在Windows上从源代码构建PhantomJS-2

时间:2015-01-04 18:46:19

标签: git visual-studio qt build phantomjs

我正在尝试根据这些instructions在Windows 8.1 x64上从源代码构建PhantomJS 2的开发版本。

但是我收到以下错误

'mingw32-make' is not recognized as an internal or external command, operable program or batch file.
'nmake' is not recognized as an internal or external command, operable program or batch file.
Error: "qmake.exe is missing Can't proceed."

我不确定如何解决此问题,请有人帮忙和/或提供有关如何在Windows x64上构建此功能的步骤吗?

到目前为止我做了什么......

  1. 已安装的Perl,Python,Ruby和Git确保所有内容都在PATH环境变量中
  2. 已安装qt-opensource-windows exe
  3. 在Visual Studio命令提示符中输入了以下命令:

  4. 尝试构建的最后一步会产生错误。

    我还安装了mingw32-make-3.80.0-3.exe并将路径C:\ mingw \ bin \ mingw32-make.exe添加到仍然出错的PATH环境变量中。

    完整的命令提示符输入/输出如下:

    *************************************
    Microsoft Windows [Version 6.3.9600]
    (c) 2013 Microsoft Corporation. All rights reserved.
    
    C:\Users\o\Documents\GitHub>git clone git://github.com/ariya/phantomjs.git
    Cloning into 'phantomjs'...
    remote: Counting objects: 56882, done.
    remote: Total 56882 (delta 0), reused 0 (delta 0)
    Receiving objects: 100% (56882/56882), 113.63 MiB | 1.59 MiB/s, done.
    Resolving deltas: 100% (29939/29939), done.
    Checking connectivity... done.
    Checking out files: 100% (25015/25015), done.
    
    C:\Users\o\Documents\GitHub>cd phantomjs
    
    C:\Users\o\Documents\GitHub\phantomjs>cd src/qt
    
    C:\Users\o\Documents\GitHub\phantomjs\src\qt>git clone https://github.com/Vitall
    ium/phantomjs-3rdparty-win
    Cloning into 'phantomjs-3rdparty-win'...
    remote: Counting objects: 1073, done.
    remote: Total 1073 (delta 0), reused 0 (delta 0)
    Receiving objects: 100% (1073/1073), 77.26 MiB | 1.67 MiB/s, done.
    Resolving deltas: 100% (376/376), done.
    Checking connectivity... done.
    
    C:\Users\o\Documents\GitHub\phantomjs\src\qt>rename phantomjs-3rdparty-win 3rdparty
    
    C:\Users\o\Documents\GitHub\phantomjs\src\qt>
    
    C:\Users\o\Documents\GitHub\phantomjs\src\qt>cd ../../
    
    C:\Users\o\Documents\GitHub\phantomjs>build.cmd
    
    Build type: release
    
    GIT found. Getting 3rd party libraries.
    LIB: C:\Users\o\Documents\GitHub\phantomjs\src\qt\3rdparty\openssl\lib;C:\Users\
    o\Documents\GitHub\phantomjs\src\qt\3rdparty\libicu\lib;C:\Users\o\Documents\Git
    Hub\phantomjs\src\qt\3rdparty\libxml\lib;
    INCLUDE: C:\Users\o\Documents\GitHub\phantomjs\src\qt\3rdparty\openssl\include;C
    :\Users\o\Documents\GitHub\phantomjs\src\qt\3rdparty\libicu\include;C:\Users\o\D
    ocuments\GitHub\phantomjs\src\qt\3rdparty\libxml\include\libxml2;
    'mingw32-make' is not recognized as an internal or external command,
    operable program or batch file.
    'nmake' is not recognized as an internal or external command,
    operable program or batch file.
    
    
    Error: "qmake.exe is missing Can't proceed."
    
    Contact vitaliy.slobodin@gmail.com
    
    C:\Users\o\Documents\GitHub\phantomjs>
    
    *************************************
    

3 个答案:

答案 0 :(得分:4)

确保通往qmake&的路径nmake在你的正确%PATH% 对我来说是:

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

'mingw32-make'

可能相同

我已经仔细检查了Phantomjs的源代码,似乎你不需要下载并安装qt,它已经是源代码的一部分。 要构建PhantomJS 2,您需要:

  1. 设置以下文件的路径:nmake.exe,rc.exe和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变量:
    • 包括:VC& Windows SDK包含文件夹 - 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文件夹 - C:\ Program Files(x86)\ Microsoft Visual Studio 12.0 \ VC \ lib; C:\ Program Files(x86)\ Microsoft SDKs \ Windows \ v7.1A \ lib
  3. 同样在开始构建之前,你需要运行vcvarsall.bat并使用正确的配置,在我的例子中我使用了amd64_x86参数 要运行构建,我做了以下步骤:    - git clone git://github.com/ariya/phantomjs.git    - cd phantomjs    - 构建

答案 1 :(得分:2)

对于那些使用Cygwin的人,请确保在Cygwin二进制文件之前,perl的windows安装位于PATH中。

我遇到的问题是所有步骤都没问题,但是当我使用Cygwin perl时,文件路径的格式为/ cygdrive / c / ..哪些窗口无法理解,因此失败,没有有用的输出build.cmd。

通过在phantomjs / src / qt中运行preconfig.cmd找到了这个

答案 2 :(得分:0)

将可执行文件 mingw32-make.exe 放入 phantomjs \ src \ qt \ 3rdparty \ gnuwin32 \ bin 内,为我解决了这个问题。