Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"STREQUAL" "x86_64" Unknown arguments specified error message when compiling php-cpp on windows #393

Open
Eyad-Bereh opened this issue Sep 5, 2018 · 3 comments

Comments

@Eyad-Bereh
Copy link

I'm compiling PHP-CPP on windows 10 x64 bit using CMake:
cmake .
But i'am getting the following error message:

CMake Error at CMakeLists.txt:46 (IF):
  if given arguments:

    "STREQUAL" "x86_64"

  Unknown arguments specified


-- Configuring incomplete, errors occurred!
See also "E:/PHP-CPP/CMakeFiles/CMakeOutput.log".

How can i resolve this problem?

@atvise
Copy link
Contributor

atvise commented Sep 6, 2018

Hi,

look at the comments in the CMakeLists.txt ->

# Use CMake File with following options
# PHPCPP_COMPILE_TS     Set flag if PHP was compiled with thread safe
# PHPCPP_MSVCRT_STATIC  Set flag if you want to compile the MSVC runtime as a static library
# PHPCPP_ARCH           Set to "x86_64" if architecture and PHP was compiled under x64 or "x86" for 32 bit
# PHPCPP_PHP_PATH       The path to PHP sources

@Eyad-Bereh
Copy link
Author

@atvise Thanks for your reply
Here's the changes i made to the CMakeLists.txt file:

#IF (${PHPCPP_ARCH} STREQUAL "x86_64")
  SET(PHP_LIB_PATH "x64/")
#ENDIF()
#IF (${PHPCPP_ARCH} STREQUAL "x86_64")
    ADD_DEFINITIONS(-DPHP_WIN32 -DZEND_WIN32)
#ELSE()
    #ADD_DEFINITIONS(-DPHP_WIN32 -DZEND_WIN32 -D_USE_32BIT_TIME_T)
#ENDIF()

Then i made PHPCPP_PHP_PATH point to the folder where i've extracted PHP 7.0.31 source:

SET(PHPCPP_PHP_PATH "../php-src")

After this i used cmake . to create the solution files , until here everything seems to be fine.
However , when i open the phpcpp solution and try building it i'am getting a group of errors like this one:

e:\php-src\zend\zend_config.w32.h(25): fatal error C1083: Cannot open include file: '../main/config.w32.h': No such file or directory

(Here's the full log if that helps):

1>------ Build started: Project: ZERO_CHECK, Configuration: Debug Win32 ------
1>Checking Build System
1>CMake is re-running because E:/PHP-CPP/CMakeFiles/generate.stamp is out-of-date.
1>  the file 'E:/PHP-CPP/CMakeLists.txt'
1>  is newer than 'E:/PHP-CPP/CMakeFiles/generate.stamp.depend'
1>  result='-1'
1>-- Selecting Windows SDK version 10.0.14393.0 to target Windows 10.0.16299.
1>Compile PHPCPP with dynamic runtime
1>-- Configuring done
1>-- Generating done
1>-- Build files have been written to: E:/PHP-CPP
2>------ Build started: Project: phpcpp-common, Configuration: Debug Win32 ------
2>phpcpp-common.vcxproj -> E:\PHP-CPP\Debug\phpcpp-common.lib
3>------ Build started: Project: phpcpp, Configuration: Debug Win32 ------
3>D:\Visual Studio 2017\VC\Tools\MSVC\14.10.25017\bin\HostX86\x86\CL.exe /c /I"E:\PHP-CPP\..\php-src" /I"E:\PHP-CPP\..\php-src\main" /I"E:\PHP-CPP\..\php-src\Zend" /I"E:\PHP-CPP\..\php-src\TSRM" /I"E:\PHP-CPP\..\php-src\ext" /I"E:\PHP-CPP\..\php-src\build\main" /I"E:\PHP-CPP\..\php-src\build\Zend" /Zi /nologo /W3 /WX- /diagnostics:classic /Od /Ob0 /Oy- /D WIN32 /D _WINDOWS /D ZEND_DEBUG=0 /D _MSC_STDINT_H_ /D _CRT_SECURE_NO_WARNINGS /D BUILDING_PHPCPP /D ZEND_WIN32_KEEP_INLINE /D PHP_WIN32 /D ZEND_WIN32 /D "CMAKE_INTDIR=\"Debug\"" /D _MBCS /Gm- /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /GR /Fo"phpcpp.dir\Debug\\" /Fd"phpcpp.dir\Debug\phpcpp.pdb" /Gd /TP /analyze- /errorReport:prompt "E:\PHP-CPP\zend\base.cpp" "E:\PHP-CPP\zend\callable.cpp" "E:\PHP-CPP\zend\classbase.cpp" "E:\PHP-CPP\zend\classimpl.cpp" "E:\PHP-CPP\zend\constant.cpp" "E:\PHP-CPP\zend\constantfuncs.cpp" "E:\PHP-CPP\zend\eval.cpp" "E:\PHP-CPP\zend\exception_handler.cpp" "E:\PHP-CPP\zend\exists.cpp" "E:\PHP-CPP\zend\extension.cpp" "E:\PHP-CPP\zend\extensionimpl.cpp" "E:\PHP-CPP\zend\fatalerror.cpp" "E:\PHP-CPP\zend\file.cpp" "E:\PHP-CPP\zend\function.cpp" "E:\PHP-CPP\zend\functor.cpp" "E:\PHP-CPP\zend\global.cpp" "E:\PHP-CPP\zend\globals.cpp" "E:\PHP-CPP\zend\hashmember.cpp" "E:\PHP-CPP\zend\ini.cpp" "E:\PHP-CPP\zend\inivalue.cpp" "E:\PHP-CPP\zend\iteratorimpl.cpp" "E:\PHP-CPP\zend\members.cpp" "E:\PHP-CPP\zend\module.cpp" "E:\PHP-CPP\zend\namespace.cpp" "E:\PHP-CPP\zend\object.cpp" "E:\PHP-CPP\zend\sapi.cpp" "E:\PHP-CPP\zend\script.cpp" "E:\PHP-CPP\zend\streambuf.cpp" "E:\PHP-CPP\zend\streams.cpp" "E:\PHP-CPP\zend\super.cpp" "E:\PHP-CPP\zend\value.cpp" "E:\PHP-CPP\zend\valueiterator.cpp" "E:\PHP-CPP\zend\zendcallable.cpp" "E:\PHP-CPP\zend\zval.cpp"
3>base.cpp
3>e:\php-src\zend\zend_config.w32.h(25): fatal error C1083: Cannot open include file: '../main/config.w32.h': No such file or directory
3>callable.cpp
3>e:\php-src\zend\zend_config.w32.h(25): fatal error C1083: Cannot open include file: '../main/config.w32.h': No such file or directory
3>classbase.cpp
3>e:\php-src\zend\zend_config.w32.h(25): fatal error C1083: Cannot open include file: '../main/config.w32.h': No such file or directory
3>classimpl.cpp
3>e:\php-src\zend\zend_config.w32.h(25): fatal error C1083: Cannot open include file: '../main/config.w32.h': No such file or directory
3>constant.cpp
3>e:\php-src\zend\zend_config.w32.h(25): fatal error C1083: Cannot open include file: '../main/config.w32.h': No such file or directory
3>constantfuncs.cpp
3>e:\php-src\zend\zend_config.w32.h(25): fatal error C1083: Cannot open include file: '../main/config.w32.h': No such file or directory
3>eval.cpp
3>e:\php-src\zend\zend_config.w32.h(25): fatal error C1083: Cannot open include file: '../main/config.w32.h': No such file or directory
3>exception_handler.cpp
3>e:\php-src\zend\zend_config.w32.h(25): fatal error C1083: Cannot open include file: '../main/config.w32.h': No such file or directory
3>exists.cpp
3>e:\php-src\zend\zend_config.w32.h(25): fatal error C1083: Cannot open include file: '../main/config.w32.h': No such file or directory
3>extension.cpp
3>e:\php-src\zend\zend_config.w32.h(25): fatal error C1083: Cannot open include file: '../main/config.w32.h': No such file or directory
3>extensionimpl.cpp
3>e:\php-src\zend\zend_config.w32.h(25): fatal error C1083: Cannot open include file: '../main/config.w32.h': No such file or directory
3>fatalerror.cpp
3>e:\php-src\zend\zend_config.w32.h(25): fatal error C1083: Cannot open include file: '../main/config.w32.h': No such file or directory
3>file.cpp
3>e:\php-src\zend\zend_config.w32.h(25): fatal error C1083: Cannot open include file: '../main/config.w32.h': No such file or directory
3>function.cpp
3>e:\php-src\zend\zend_config.w32.h(25): fatal error C1083: Cannot open include file: '../main/config.w32.h': No such file or directory
3>functor.cpp
3>e:\php-src\zend\zend_config.w32.h(25): fatal error C1083: Cannot open include file: '../main/config.w32.h': No such file or directory
3>global.cpp
3>e:\php-src\zend\zend_config.w32.h(25): fatal error C1083: Cannot open include file: '../main/config.w32.h': No such file or directory
3>globals.cpp
3>e:\php-src\zend\zend_config.w32.h(25): fatal error C1083: Cannot open include file: '../main/config.w32.h': No such file or directory
3>hashmember.cpp
3>e:\php-src\zend\zend_config.w32.h(25): fatal error C1083: Cannot open include file: '../main/config.w32.h': No such file or directory
3>ini.cpp
3>e:\php-src\zend\zend_config.w32.h(25): fatal error C1083: Cannot open include file: '../main/config.w32.h': No such file or directory
3>inivalue.cpp
3>e:\php-src\zend\zend_config.w32.h(25): fatal error C1083: Cannot open include file: '../main/config.w32.h': No such file or directory
3>Generating Code...
3>Compiling...
3>iteratorimpl.cpp
3>e:\php-src\zend\zend_config.w32.h(25): fatal error C1083: Cannot open include file: '../main/config.w32.h': No such file or directory
3>members.cpp
3>e:\php-src\zend\zend_config.w32.h(25): fatal error C1083: Cannot open include file: '../main/config.w32.h': No such file or directory
3>module.cpp
3>e:\php-src\zend\zend_config.w32.h(25): fatal error C1083: Cannot open include file: '../main/config.w32.h': No such file or directory
3>namespace.cpp
3>e:\php-src\zend\zend_config.w32.h(25): fatal error C1083: Cannot open include file: '../main/config.w32.h': No such file or directory
3>object.cpp
3>e:\php-src\zend\zend_config.w32.h(25): fatal error C1083: Cannot open include file: '../main/config.w32.h': No such file or directory
3>sapi.cpp
3>e:\php-src\zend\zend_config.w32.h(25): fatal error C1083: Cannot open include file: '../main/config.w32.h': No such file or directory
3>script.cpp
3>e:\php-src\zend\zend_config.w32.h(25): fatal error C1083: Cannot open include file: '../main/config.w32.h': No such file or directory
3>streambuf.cpp
3>e:\php-src\zend\zend_config.w32.h(25): fatal error C1083: Cannot open include file: '../main/config.w32.h': No such file or directory
3>streams.cpp
3>e:\php-src\zend\zend_config.w32.h(25): fatal error C1083: Cannot open include file: '../main/config.w32.h': No such file or directory
3>super.cpp
3>e:\php-src\zend\zend_config.w32.h(25): fatal error C1083: Cannot open include file: '../main/config.w32.h': No such file or directory
3>value.cpp
3>e:\php-src\zend\zend_config.w32.h(25): fatal error C1083: Cannot open include file: '../main/config.w32.h': No such file or directory
3>valueiterator.cpp
3>e:\php-src\zend\zend_config.w32.h(25): fatal error C1083: Cannot open include file: '../main/config.w32.h': No such file or directory
3>zendcallable.cpp
3>e:\php-src\zend\zend_config.w32.h(25): fatal error C1083: Cannot open include file: '../main/config.w32.h': No such file or directory
3>zval.cpp
3>e:\php-src\zend\zend_config.w32.h(25): fatal error C1083: Cannot open include file: '../main/config.w32.h': No such file or directory
3>Generating Code...
3>Done building project "phpcpp.vcxproj" -- FAILED.
4>------ Skipped Build: Project: ALL_BUILD, Configuration: Debug Win32 ------
4>Project not selected to build for this solution configuration 
5>------ Skipped Deploy: Project: ZERO_CHECK, Configuration: Debug Win32 ------
5>Project not selected to build for this solution configuration 
6>------ Skipped Deploy: Project: phpcpp-common, Configuration: Debug Win32 ------
6>Project not selected to build for this solution configuration 
7>------ Skipped Deploy: Project: phpcpp, Configuration: Debug Win32 ------
7>Project not selected to build for this solution configuration 
========== Build: 2 succeeded, 1 failed, 0 up-to-date, 1 skipped ==========
========== Deploy: 0 succeeded, 0 failed, 3 skipped ==========

What should i do now to solve this problem?

@atvise
Copy link
Contributor

atvise commented Sep 7, 2018

:\php-src\zend\zend_config.w32.h(25): fatal error C1083: Cannot open include file: '../main/config.w32.h': No such file or directory`

This file will be automatically created by the php build. Do you have build the php sources?
Here are the instructions to do so:

https://wiki.php.net/internals/windows/stepbystepbuild_sdk_2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant