phpv8 / v8js

V8 Javascript Engine for PHP — This PHP extension embeds the Google V8 Javascript Engine
http://pecl.php.net/package/v8js
MIT License
1.84k stars 200 forks source link

Doesn't compile #81

Closed hinzundcode closed 10 years ago

hinzundcode commented 10 years ago

Hi,

v8js doesn't compile on my system. I use gcc 4.6.3 and get the following error:

$ make
/bin/bash /tmp/v8js/libtool --mode=compile g++ -std=c++0x -I. -I/tmp/v8js -DPHP_ATOM_INC -I/tmp/v8js/include -I/tmp/v8js/main -I/tmp/v8js -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib  -DHAVE_CONFIG_H  -g -O2   -c /tmp/v8js/v8js.cc -o v8js.lo 
libtool: compile:  g++ -std=c++0x -I. -I/tmp/v8js -DPHP_ATOM_INC -I/tmp/v8js/include -I/tmp/v8js/main -I/tmp/v8js -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /tmp/v8js/v8js.cc  -fPIC -DPIC -o .libs/v8js.o
/tmp/v8js/v8js.cc:61:1: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
/tmp/v8js/v8js.cc: In function 'int php_v8js_v8_call_method(const char*, int, zval*, zval**, zval*, int)':
/tmp/v8js/v8js.cc:421:23: error: 'GetCurrent' is not a member of 'v8::Context'
/tmp/v8js/v8js.cc: In function 'void zim_V8Object___construct(int, zval*, zval**, zval*, int)':
/tmp/v8js/v8js.cc:516:54: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
/tmp/v8js/v8js.cc: In function 'void zim_V8Function___construct(int, zval*, zval**, zval*, int)':
/tmp/v8js/v8js.cc:526:54: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
/tmp/v8js/v8js.cc: In function 'void php_v8js_free_storage(void*)':
/tmp/v8js/v8js.cc:569:58: error: no matching function for call to 'v8::Context::Scope::Scope(v8::Isolate*&, v8::Persistent<v8::Context>&)'
/tmp/v8js/v8js.cc:569:58: note: candidates are:
/usr/include/v8.h:5081:24: note: v8::Context::Scope::Scope(v8::Handle<v8::Context>)
/usr/include/v8.h:5081:24: note:   candidate expects 1 argument, 2 provided
/usr/include/v8.h:5079:9: note: constexpr v8::Context::Scope::Scope(const v8::Context::Scope&)
/usr/include/v8.h:5079:9: note:   candidate expects 1 argument, 2 provided
/usr/include/v8.h:5079:9: note: constexpr v8::Context::Scope::Scope(v8::Context::Scope&&)
/usr/include/v8.h:5079:9: note:   candidate expects 1 argument, 2 provided
/tmp/v8js/v8js.cc:572:3: error: 'GetCurrent' is not a member of 'v8::Context'
/tmp/v8js/v8js.cc: In function 'void zim_V8Js___construct(int, zval*, zval**, zval*, int)':
/tmp/v8js/v8js.cc:782:23: error: no matching function for call to 'v8::Isolate::SetData(php_v8js_ctx*&)'
/tmp/v8js/v8js.cc:782:23: note: candidate is:
/usr/include/v8.h:6357:6: note: void v8::Isolate::SetData(uint32_t, void*)
/usr/include/v8.h:6357:6: note:   candidate expects 2 arguments, 1 provided
/tmp/v8js/v8js.cc:868:2: error: 'GetCurrent' is not a member of 'v8::Context'
/tmp/v8js/v8js.cc: In function 'void zim_V8Js_executeString(int, zval*, zval**, zval*, int)':
/tmp/v8js/v8js.cc:1011:2: error: no matching function for call to 'v8::Context::Scope::Scope(v8::Isolate*&, v8::Persistent<v8::Context>&)'
/tmp/v8js/v8js.cc:1011:2: note: candidates are:
/usr/include/v8.h:5081:24: note: v8::Context::Scope::Scope(v8::Handle<v8::Context>)
/usr/include/v8.h:5081:24: note:   candidate expects 1 argument, 2 provided
/usr/include/v8.h:5079:9: note: constexpr v8::Context::Scope::Scope(const v8::Context::Scope&)
/usr/include/v8.h:5079:9: note:   candidate expects 1 argument, 2 provided
/usr/include/v8.h:5079:9: note: constexpr v8::Context::Scope::Scope(v8::Context::Scope&&)
/usr/include/v8.h:5079:9: note:   candidate expects 1 argument, 2 provided
/tmp/v8js/v8js.cc:1035:2: error: 'GetCurrent' is not a member of 'v8::Context'
/tmp/v8js/v8js.cc: In function 'void zim_V8Js___destruct(int, zval*, zval**, zval*, int)':
/tmp/v8js/v8js.cc:1131:2: error: no matching function for call to 'v8::Context::Scope::Scope(v8::Isolate*&, v8::Persistent<v8::Context>&)'
/tmp/v8js/v8js.cc:1131:2: note: candidates are:
/usr/include/v8.h:5081:24: note: v8::Context::Scope::Scope(v8::Handle<v8::Context>)
/usr/include/v8.h:5081:24: note:   candidate expects 1 argument, 2 provided
/usr/include/v8.h:5079:9: note: constexpr v8::Context::Scope::Scope(const v8::Context::Scope&)
/usr/include/v8.h:5079:9: note:   candidate expects 1 argument, 2 provided
/usr/include/v8.h:5079:9: note: constexpr v8::Context::Scope::Scope(v8::Context::Scope&&)
/usr/include/v8.h:5079:9: note:   candidate expects 1 argument, 2 provided
/tmp/v8js/v8js.cc: In function 'void zim_V8Js_startDebugAgent(int, zval*, zval**, zval*, int)':
/tmp/v8js/v8js.cc:1156:2: error: no matching function for call to 'v8::Context::Scope::Scope(v8::Isolate*&, v8::Persistent<v8::Context>&)'
/tmp/v8js/v8js.cc:1156:2: note: candidates are:
/usr/include/v8.h:5081:24: note: v8::Context::Scope::Scope(v8::Handle<v8::Context>)
/usr/include/v8.h:5081:24: note:   candidate expects 1 argument, 2 provided
/usr/include/v8.h:5079:9: note: constexpr v8::Context::Scope::Scope(const v8::Context::Scope&)
/usr/include/v8.h:5079:9: note:   candidate expects 1 argument, 2 provided
/usr/include/v8.h:5079:9: note: constexpr v8::Context::Scope::Scope(v8::Context::Scope&&)
/usr/include/v8.h:5079:9: note:   candidate expects 1 argument, 2 provided
/tmp/v8js/v8js.cc: In function 'void php_v8js_persistent_zval_ctor(zval**)':
/tmp/v8js/v8js.cc:1232:4: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
/tmp/v8js/v8js.cc: In function 'void php_v8js_persistent_zval_dtor(zval**)':
/tmp/v8js/v8js.cc:1245:4: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
/tmp/v8js/v8js.cc: In function 'void php_v8js_write_property(zval*, zval*, zval*, const zend_literal*)':
/tmp/v8js/v8js.cc:1443:2: error: no matching function for call to 'v8::Context::Scope::Scope(v8::Isolate*&, v8::Persistent<v8::Context>&)'
/tmp/v8js/v8js.cc:1443:2: note: candidates are:
/usr/include/v8.h:5081:24: note: v8::Context::Scope::Scope(v8::Handle<v8::Context>)
/usr/include/v8.h:5081:24: note:   candidate expects 1 argument, 2 provided
/usr/include/v8.h:5079:9: note: constexpr v8::Context::Scope::Scope(const v8::Context::Scope&)
/usr/include/v8.h:5079:9: note:   candidate expects 1 argument, 2 provided
/usr/include/v8.h:5079:9: note: constexpr v8::Context::Scope::Scope(v8::Context::Scope&&)
/usr/include/v8.h:5079:9: note:   candidate expects 1 argument, 2 provided
/tmp/v8js/v8js.cc:1450:33: error: 'GetCurrent' is not a member of 'v8::Context'
/tmp/v8js/v8js.cc: In function 'void php_v8js_unset_property(zval*, zval*, const zend_literal*)':
/tmp/v8js/v8js.cc:1463:2: error: no matching function for call to 'v8::Context::Scope::Scope(v8::Isolate*&, v8::Persistent<v8::Context>&)'
/tmp/v8js/v8js.cc:1463:2: note: candidates are:
/usr/include/v8.h:5081:24: note: v8::Context::Scope::Scope(v8::Handle<v8::Context>)
/usr/include/v8.h:5081:24: note:   candidate expects 1 argument, 2 provided
/usr/include/v8.h:5079:9: note: constexpr v8::Context::Scope::Scope(const v8::Context::Scope&)
/usr/include/v8.h:5079:9: note:   candidate expects 1 argument, 2 provided
/usr/include/v8.h:5079:9: note: constexpr v8::Context::Scope::Scope(v8::Context::Scope&&)
/usr/include/v8.h:5079:9: note:   candidate expects 1 argument, 2 provided
/tmp/v8js/v8js.cc:1467:32: error: 'GetCurrent' is not a member of 'v8::Context'
make: *** [v8js.lo] Fehler 1

What am I doing wrong? Thanks a lot

cscott commented 10 years ago

Try g++ 4.7?

satoshi75nakamoto commented 10 years ago

@cscott you beat me to it.

stesie commented 10 years ago

@schokocappucino you're trying to build against v8 3.24.4, aren't you?

I can reproduce the error with that version, see http://jenkins.brokenpipe.de/view/v8js-with-v8-versions/job/v8js-with-v8-3.24.4/1/console ... unfortunately the build badge on the README.md page here is wrong since GitHub started caching the image :-/

Just pick version 3.24.3 for the moment, it should compile fine (or any other version between 3.21.12 and 3.24.3)

stesie commented 10 years ago

Hey there,

as a side note I've started working on porting V8Js to 3.24.5 ... see https://github.com/stesie/v8js/tree/fix-ftbfs-v8-3.24.5

it's already passing the test suite fine, just wanna test with older V8 versions so it isn't limiting to the two or three most recent V8 versions ...

cheers stesie

satoshi75nakamoto commented 10 years ago

Awesome

hinzundcode commented 10 years ago

3.24.3 works, thanks a lot ;)