pbiggar / phc

A compiler for PHP
132 stars 37 forks source link

error: 'boost::BOOST_FOREACH' has not been declared #162

Closed pbiggar closed 8 years ago

pbiggar commented 9 years ago
What steps will reproduce the problem?
1. see bug 152

What is the expected output? What do you see instead?

In file included from ./src/lib/List.h:13:0,
                 from src/embed/embed.h:12,
                 from src/embed/optimize.cpp:8:
./src/process_ir/Foreach.h:13:17: error: 'boost::BOOST_FOREACH' has not been declared
 #define foreach BOOST_FOREACH
                 ^
src/embed/optimize.cpp: In static member function 'static Method_info* PHP::get_method_info(String*)':
src/embed/optimize.cpp:223:63: error: invalid conversion from 'zend_fcall_info* {aka
_zend_fcall_info*}' to 'uint {aka unsigned int}' [-fpermissive]
  int result = zend_fcall_info_init (&fn, &fci, &fcic TSRMLS_CC);
                                                               ^
src/embed/optimize.cpp:223:63: error: cannot convert 'zend_fcall_info_cache* {aka _zend_fcall_info_cache*}'
to 'zend_fcall_info* {aka _zend_fcall_info*}' for argument '3' to 'int zend_fcall_info_init(zval*,
uint, zend_fcall_info*, zend_fcall_info_cache*, char**, char**)'
src/embed/optimize.cpp: In member function 'virtual bool Internal_method_info::return_by_ref()':
src/embed/optimize.cpp:248:22: error: 'struct _zend_function::<anonymous>' has no member
named 'return_reference'
  return func->common.return_reference;
                      ^
src/embed/optimize.cpp:249:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
Makefile:2114: recipe for target 'optimize.lo' failed
make[2]: *** [optimize.lo] Error 1
make[2]: Leaving directory '/home/darko/Downloads/phc-read-only'
Makefile:3446: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/darko/Downloads/phc-read-only'
Makefile:1413: recipe for target 'all' failed
make: *** [all] Error 2

What version of the product are you using? On what operating system?

see bug 152

Original issue reported on code.google.com by info@icod.de on 2013-11-15 15:36:14

pbiggar commented 9 years ago
Hi,

  The foreach error seems like a problem in your installation of libboost, you should
install the development package. On ubuntu, we install everything related to boost
by using the following command:
    # apt-get install libboost-all-dev
  You can check further installation instructions on http://www.phpcompiler.org/doc/latest/install.html.
Unfortunately, it's mostly for debian/ubuntu.

  The other error, concerning zend_fcall_info_init is a problem in phc. We don’t support
newer version of PHP, only <= PHP 5.2.x. Please install an older version for compatibility.
You can refer to the following post: http://www.phpcompiler.org/lists/phc-internals/2011-February/005922.html

  Good luck,
    Andrei

Original issue reported on code.google.com by logytech on 2013-11-16 00:24:54

pbiggar commented 9 years ago
The error:

./src/process_ir/Foreach.h:13:17: error: 'boost::BOOST_FOREACH' has not been declared

also occurs on debian installation with libboost-all-dev installed.

You can prevent it by adding:
#include <boost/graph/adjacency_list.hpp>
as THE FIRST !!!!  include in src/lib/List.h  .

Somehow this prevents some circular macro eval.

Original issue reported on code.google.com by hans@dingemans.de on 2013-11-18 10:04:39

pbiggar commented 8 years ago

Fixed on master.