首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在Windows上从源代码构建PhantomJS-2

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

Stack Overflow用户
提问于 2015-01-04 18:46:19
回答 3查看 2.1K关注 0票数 3

我试图在Windows8.1 PhantomJS上基于这些x64从源代码构建使用说明 2的开发版本。

但是,我得到以下错误

代码语言:javascript
复制
'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."

我不确定如何解决这个问题,请有人帮助和/或给出如何在Windowsx64上构建这个程序的步骤吗?

我迄今所做的一切..。

  1. 已安装的Perl、Python、Ruby和Git确保它们都在PATH环境变量中
  2. 安装qt-开源-windows exe
  3. 在Visual命令提示符中,输入了以下命令:
代码语言:javascript
复制
- git clone git://github.com/ariya/phantomjs.git
- cd phantomjs
- cd src/qt
- git clone [https://github.com/Vitallium/phantomjs-3rdparty-win](https://github.com/Vitallium/phantomjs-3rdparty-win)
- rename phantomjs-3rdparty-win 3rdparty
- cd ../../
- build.cmd

最后一个试图构建的步骤给出了错误。

我还安装了mingw32-mak-3.80.0-3.exe,并将路径C:\mingw\bin\mingw32-make.exe添加到path环境变量中,这仍然会导致错误。

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

代码语言:javascript
复制
*************************************
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>

*************************************
EN

回答 3

Stack Overflow用户

回答已采纳

发布于 2015-01-06 23:06:06

确保qmake & nmake的路径对我来说是正确的% path %,它是:

代码语言:javascript
复制
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

对于“交友32-制造”也可能是一样的。

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

  1. 设置以下文件的路径: nmake.exe、rc.exe和mt.exe - C:\Program (x86)\Microsoft \Windows\v7.1A\bin;C:\Program(X86)\MicrosoftVisualStudio12.0\VC\bin
  2. 环境变量:
    • 包括: VC和Windows包含文件夹- C:\Program (X86)\ 12.0\VC\ include ;C:\Program (x86)\Microsoft \Windows\v7.1A\include
    • LIB: VC & Windows文件夹- C:\Program (X86)\ 12.0\VC\ Lib ;C:\Program (x86)\Microsoft \Windows\v7.1A\lib

在开始构建之前,您需要使用正确的配置运行vcvarsall.bat,在我的例子中,我使用amd64_x86参数来运行构建,我执行了以下步骤:- git克隆git://github.com/ariya/幻影js.git- cd幻影cd构建

票数 3
EN

Stack Overflow用户

发布于 2015-06-08 21:22:32

对于使用Cygwin的用户,请确保在Cygwin二进制文件之前安装了perl的windows。

我遇到了所有步骤都进行得很顺利的问题,但是当我使用Cygwin perl时,文件路径是/cygdrive/c/。哪些窗口不理解,因此在build.cmd中没有有用的输出就失败了。

这是通过在幻影qt/src/qt中运行preconfig.cmd发现的。

票数 2
EN

Stack Overflow用户

发布于 2018-08-15 13:14:19

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

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/27769056

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档