doushishi2415 2019-05-29 06:45 采纳率: 0%
浏览 3497

NMAKE:致命错误U1077:'“':返回代码'0x1'

我正在尝试使用c / c ++创建php扩展。

我已使用修改后的安装方式安装了Visual Studio 2019:

  • 仅安装MSVC v140-VS 2015 C ++构建工具(v14.00)
  • 安装工作负载 Windows

并下载了php7.1.28源码。

以下是我的文件C:\php-7.1.28\ext\helloworld\ 文件:config.w32

ARG_ENABLE("helloworld", "helloworld support", "no");

if (PHP_HELLOWORLD == "yes") {
    EXTENSION("helloworld", "php_helloworld.c", true);
}

文件:php_helloworld.h

// we define Module constants
#define PHP_HELLOWORLD_EXTNAME "php_helloworld"
#define PHP_HELLOWORLD_VERSION "0.0.1"

// then we declare the function to be exported
PHP_FUNCTION(helloworld_php);

文件:php_helloworld.c

// include the PHP API itself
#include <php.h>
// then include the header of your extension
#include "php_helloworld.h"

// register our function to the PHP API 
// so that PHP knows, which functions are in this module
zend_function_entry helloworld_php_functions[] = {
    PHP_FE(helloworld_php, NULL)
    {NULL, NULL, NULL}
};

// some pieces of information about our module
zend_module_entry helloworld_php_module_entry = {
    STANDARD_MODULE_HEADER,
    PHP_HELLOWORLD_EXTNAME,
    helloworld_php_functions,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    PHP_HELLOWORLD_VERSION,
    STANDARD_MODULE_PROPERTIES
};

// use a macro to output additional C code, to make ext dynamically loadable
ZEND_GET_MODULE(helloworld_php)

// Finally, we implement our "Hello World" function
// this function will be made available to PHP
// and prints to PHP stdout using printf
PHP_FUNCTION(helloworld_php) {
    php_printf("Hello World! (from our extension)
");
}

当我想要使用php7.1.28 source with compiler MSVC14 (Visual c++ 2015) 以下日志是我的错误:

C:\php-7.1.28>nmake

Microsoft (R) Program Maintenance Utility Version 14.00.24245.0
Copyright (C) Microsoft Corporation.  All rights reserved.

Recreating build dirs 
type ext\pcre\php_pcre.def > C:\php-7.1.28\x64\Release_TS\php7ts.dll.def
"" -h win32\ -r C:\php-7.1.28\x64\Release_TS\ -x C:\php-7.1.28\x64\Release_TS\ 
win32\build\wsyslog.mc
'-h' is not recognized as an internal or external command,
operable program or batch file.

NMAKE : fatal error U1077: '"' : return code '0x1'
Stop.    

为什么会得到错误,我该如何修复?

  • 写回答

1条回答 默认 最新

  • duan5801 2019-06-03 14:55
    关注

    An error like that witnesses the absent Windows 10 SDK. There should be better error messages in the later PHP versions, the tools needed from there are mt.exe and mc.exe.

    Other than that, I'd recommend using the documented Visual Studio versions and SDK for better experience.

    Thanks

    评论

报告相同问题?

悬赏问题

  • ¥15 Windows server update services
  • ¥15 关于#c语言#的问题:我现在在做一个墨水屏设计,2.9英寸的小屏怎么换4.2英寸大屏
  • ¥15 模糊pid与pid仿真结果几乎一样
  • ¥15 java的GUI的运用
  • ¥15 Web.config连不上数据库
  • ¥15 我想付费需要AKM公司DSP开发资料及相关开发。
  • ¥15 怎么配置广告联盟瀑布流
  • ¥15 Rstudio 保存代码闪退
  • ¥20 win系统的PYQT程序生成的数据如何放入云服务器阿里云window版?
  • ¥50 invest生境质量模块