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

Build Failed in Mac #321

Open
kstan79 opened this issue Apr 4, 2017 · 3 comments
Open

Build Failed in Mac #321

kstan79 opened this issue Apr 4, 2017 · 3 comments

Comments

@kstan79
Copy link

kstan79 commented Apr 4, 2017

Hi,

I'd tried to build php-cpp in mac seems failed:

kstans-MacBook-Pro:PHP-CPP kstan$ make

mkdir -p shared/common
mkdir -p shared/zend
c++ -Wall -c -std=c++11 -fvisibility=hidden -DBUILDING_PHPCPP -Wno-write-strings -MD -g -fpic -o shared/common/modifiers.o common/modifiers.cpp
c++ -Wall -c -std=c++11 -fvisibility=hidden -DBUILDING_PHPCPP -Wno-write-strings -MD -g -fpic -o shared/common/streambuf.o common/streambuf.cpp
c++ -Wall -c -std=c++11 -fvisibility=hidden -DBUILDING_PHPCPP -Wno-write-strings -MD -g `php-config --includes` -fpic -o shared/zend/base.o zend/base.cpp
In file included from zend/base.cpp:8:
zend/includes.h:40:10: fatal error: 'php.h' file not found

I'm tried to download php7.0.15, replace zend folder result same.

Currently I'm use MAMP, I'd further edit Makefile as below:
PHP_CONFIG=/Applications/MAMP/bin/php/php7.0.15/bin/php-config

It build for sometimes but halt at:

......
zend/valueiteratorimpl.h:37:32: note: overridden virtual function is here
    virtual ValueIteratorImpl *clone() = 0;
                               ^
5 warnings generated.
c++ -shared -g `/Applications/MAMP/bin/php/php7.0.15/bin/php-config --ldflags` -Wl,-soname,libphpcpp.so.2.0 -o libphpcpp.so.2.0.0 shared/common/modifiers.o shared/common/streambuf.o shared/zend/base.o shared/zend/callable.o shared/zend/classbase.o shared/zend/classimpl.o shared/zend/constant.o shared/zend/constantfuncs.o shared/zend/eval.o shared/zend/exception_handler.o shared/zend/exists.o shared/zend/extension.o shared/zend/extensionimpl.o shared/zend/fatalerror.o shared/zend/file.o shared/zend/function.o shared/zend/functor.o shared/zend/global.o shared/zend/globals.o shared/zend/hashmember.o shared/zend/ini.o shared/zend/inivalue.o shared/zend/iteratorimpl.o shared/zend/members.o shared/zend/module.o shared/zend/namespace.o shared/zend/object.o shared/zend/sapi.o shared/zend/script.o shared/zend/streambuf.o shared/zend/streams.o shared/zend/super.o shared/zend/value.o shared/zend/valueiterator.o shared/zend/zendcallable.o shared/zend/zval.o
ld: unknown option: -soname
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [libphpcpp.so.2.0.0] Error 1

Anything I can do for make it work?

@neyaoz
Copy link

neyaoz commented May 17, 2017

Up!

@sjinks
Copy link
Contributor

sjinks commented May 21, 2017

Please see https://lists.apple.com/archives/unix-porting/2003/Oct/msg00032.html

It looks like for Mac instead of -Wl,-soname,libphpcpp.so.2.0 you will have to use -Wl,-dylib_install_name -Wl,libphpcpp.so.2.0

@guweigang
Copy link
Contributor

guweigang commented May 21, 2017

I just replaced -soname with -install_name in Makefile, and it works.

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

4 participants