Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
05-25-2012, 03:23 PM
|
#1
|
|
Senior Member
Registered: Apr 2003
Location: Colombia
Distribution: Kubuntu, Debian, Knoppix
Posts: 1,888
Rep:
|
phc compilation on precise - invalid conversion
Hi!
I'm trying to compile phc on kubuntu precise. After nailing a problem in configure now I find a compilation problem:
Code:
/bin/bash ./libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I/usr/include -I/usr/include -I/usr/include/xercesc -I./src -I. -I./3rdparty/getopt -I./src/generated -isystem/usr/local/php/include/php -isystem/usr/local/php/include/php/main -isystem/usr/local/php/include/php/TSRM -isystem/usr/local/php/include/php/Zend -DDATADIR=\"/usr/local/share\" -DPKGLIBDIR=\"/usr/local/lib/phc\" -Wall -Wextra -Wno-unused-parameter -Wno-write-strings -Wno-deprecated -g -O2 -MT optimize.lo -MD -MP -MF .deps/optimize.Tpo -c -o optimize.lo `test -f 'src/embed/optimize.cpp' || echo './'`src/embed/optimize.cpp
libtool: compile: g++ -DHAVE_CONFIG_H -I. -I/usr/include -I/usr/include -I/usr/include/xercesc -I./src -I. -I./3rdparty/getopt -I./src/generated -isystem/usr/local/php/include/php -isystem/usr/local/php/include/php/main -isystem/usr/local/php/include/php/TSRM -isystem/usr/local/php/include/php/Zend -DDATADIR=\"/usr/local/share\" -DPKGLIBDIR=\"/usr/local/lib/phc\" -Wall -Wextra -Wno-unused-parameter -Wno-write-strings -Wno-deprecated -g -O2 -MT optimize.lo -MD -MP -MF .deps/optimize.Tpo -c src/embed/optimize.cpp -fPIC -DPIC -o .libs/optimize.o
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]
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'
src/embed/optimize.cpp:249:1: warning: control reaches end of non-void function [-Wreturn-type]
make[2]: *** [optimize.lo] Error 1
make[2]: Leaving directory `/home/antoranz/Descargas/php/phc-0.3.0.1'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/antoranz/Descargas/php/phc-0.3.0.1'
make: *** [all] Error 2
Perhaps one api has changed? What can I do to solve this?
Code in question:
Code:
Method_info*
PHP::get_method_info (String* name)
{
zval fn;
INIT_PZVAL (&fn);
ZVAL_STRING (&fn, const_cast<char*> (name->c_str ()), 0);
zend_fcall_info fci;
zend_fcall_info_cache fcic;
int result = zend_fcall_info_init (&fn, &fci, &fcic TSRMLS_CC);
if (result != SUCCESS)
return NULL;
return new Internal_method_info (name, fcic.function_handler);
}
|
|
|
|
05-25-2012, 03:24 PM
|
#2
|
|
Senior Member
Registered: Apr 2003
Location: Colombia
Distribution: Kubuntu, Debian, Knoppix
Posts: 1,888
Original Poster
Rep:
|
Specifically, the line with the problem is
Code:
int result = zend_fcall_info_init (&fn, &fci, &fcic TSRMLS_CC);
|
|
|
|
05-25-2012, 03:55 PM
|
#3
|
|
Senior Member
Registered: Apr 2003
Location: Colombia
Distribution: Kubuntu, Debian, Knoppix
Posts: 1,888
Original Poster
Rep:
|
I'm still compiling but I think I got past that point when I tried with php 5.2 so I think it's a matter of PHP's API having changed from 5.2.
|
|
|
|
05-25-2012, 04:10 PM
|
#4
|
|
Senior Member
Registered: Apr 2003
Location: Colombia
Distribution: Kubuntu, Debian, Knoppix
Posts: 1,888
Original Poster
Rep:
|
It took a while to stop but I got a different error message now:
Code:
/bin/bash ./libtool --tag=CXX --mode=link g++ -Wextra -Wno-unused-parameter -Wno-write-strings -Wno-deprecated -g -O2 -export-dynamic -o src/phc phc.o -lgc -lgccpp -lltdl -lboost_regex-mt libphc.la -lxerces-c -lgccpp -lgc -lphp5 -L/usr/local/php/lib -ldl
libtool: link: g++ -Wextra -Wno-unused-parameter -Wno-write-strings -Wno-deprecated -g -O2 -o src/.libs/phc phc.o -Wl,--export-dynamic /usr/lib/i386-linux-gnu/libltdl.so -lboost_regex-mt ./.libs/libphc.so -L/usr/lib -L/usr/local/php/lib /usr/lib/libxerces-c.so -lnsl -lpthread -lgccpp -lgc -lphp5 -ldl
./.libs/libphc.so: undefined reference to `boost::re_detail::raise_runtime_error(std::runtime_error const&)'
./.libs/libphc.so: undefined reference to `boost::re_detail::perl_matcher<char const*, std::allocator<boost::sub_match<char const*> >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::construct_init(boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > > const&, boost::regex_constants::_match_flags)'
./.libs/libphc.so: undefined reference to `boost::cpp_regex_traits<char>::toi(char const*&, char const*, int) const'
./.libs/libphc.so: undefined reference to `boost::re_detail::put_mem_block(void*)'
./.libs/libphc.so: undefined reference to `boost::match_results<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > >::maybe_assign(boost::match_results<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > > const&)'
./.libs/libphc.so: undefined reference to `boost::match_results<char const*, std::allocator<boost::sub_match<char const*> > >::maybe_assign(boost::match_results<char const*, std::allocator<boost::sub_match<char const*> > > const&)'
./.libs/libphc.so: undefined reference to `boost::re_detail::get_mem_block()'
./.libs/libphc.so: undefined reference to `boost::re_detail::perl_matcher<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::construct_init(boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > > const&, boost::regex_constants::_match_flags)'
./.libs/libphc.so: undefined reference to `boost::re_detail::verify_options(unsigned int, boost::regex_constants::_match_flags)'
./.libs/libphc.so: undefined reference to `boost::re_detail::get_default_error_string(boost::regex_constants::error_type)'
./.libs/libphc.so: undefined reference to `boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::do_assign(char const*, char const*, unsigned int)'
./.libs/libphc.so: undefined reference to `boost::re_detail::cpp_regex_traits_implementation<char>::transform(char const*, char const*) const'
./.libs/libphc.so: undefined reference to `boost::re_detail::cpp_regex_traits_implementation<char>::transform_primary(char const*, char const*) const'
collect2: ld returned 1 exit status
make[2]: *** [src/phc] Error 1
make[2]: Leaving directory `/home/antoranz/Descargas/php/phc-0.3.0.1'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/antoranz/Descargas/php/phc-0.3.0.1'
make: *** [all] Error 2
Any tips?
|
|
|
|
05-25-2012, 04:15 PM
|
#5
|
|
Senior Member
Registered: Apr 2003
Location: Colombia
Distribution: Kubuntu, Debian, Knoppix
Posts: 1,888
Original Poster
Rep:
|
Another libboost version perhaps?
|
|
|
|
05-25-2012, 05:17 PM
|
#6
|
|
Senior Member
Registered: Apr 2003
Location: Colombia
Distribution: Kubuntu, Debian, Knoppix
Posts: 1,888
Original Poster
Rep:
|
Just tried with 1.45 and it failed.... what's the latest version I can use to build phc?
Code:
/bin/bash ./libtool --tag=CXX --mode=link g++ -Wextra -Wno-unused-parameter -Wno-write-strings -Wno-deprecated -g -O2 -export-dynamic -o src/phc phc.o -lgc -lgccpp -lltdl -lboost_regex libphc.la -lxerces-c -lgccpp -lgc -lphp5 -L/usr/local/php/lib -ldl
libtool: link: g++ -Wextra -Wno-unused-parameter -Wno-write-strings -Wno-deprecated -g -O2 -o src/.libs/phc phc.o -Wl,--export-dynamic /usr/lib/i386-linux-gnu/libltdl.so -lboost_regex ./.libs/libphc.so -L/usr/local/boost/lib -L/usr/lib -L/usr/local/php/lib /usr/lib/libxerces-c.so -lnsl -lpthread -lgccpp -lgc -lphp5 -ldl -Wl,-rpath -Wl,/usr/local/phc/lib
./.libs/libphc.so: undefined reference to `boost::re_detail::raise_runtime_error(std::runtime_error const&)'
./.libs/libphc.so: undefined reference to `boost::re_detail::perl_matcher<char const*, std::allocator<boost::sub_match<char const*> >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::construct_init(boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > > const&, boost::regex_constants::_match_flags)'
./.libs/libphc.so: undefined reference to `boost::cpp_regex_traits<char>::toi(char const*&, char const*, int) const'
./.libs/libphc.so: undefined reference to `boost::re_detail::put_mem_block(void*)'
./.libs/libphc.so: undefined reference to `boost::match_results<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > >::maybe_assign(boost::match_results<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > > const&)'
./.libs/libphc.so: undefined reference to `boost::match_results<char const*, std::allocator<boost::sub_match<char const*> > >::maybe_assign(boost::match_results<char const*, std::allocator<boost::sub_match<char const*> > > const&)'
./.libs/libphc.so: undefined reference to `boost::re_detail::get_mem_block()'
./.libs/libphc.so: undefined reference to `boost::re_detail::perl_matcher<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::construct_init(boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > > const&, boost::regex_constants::_match_flags)'
./.libs/libphc.so: undefined reference to `boost::re_detail::verify_options(unsigned int, boost::regex_constants::_match_flags)'
./.libs/libphc.so: undefined reference to `boost::re_detail::get_default_error_string(boost::regex_constants::error_type)'
./.libs/libphc.so: undefined reference to `boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::do_assign(char const*, char const*, unsigned int)'
./.libs/libphc.so: undefined reference to `boost::re_detail::cpp_regex_traits_implementation<char>::transform(char const*, char const*) const'
./.libs/libphc.so: undefined reference to `boost::re_detail::cpp_regex_traits_implementation<char>::transform_primary(char const*, char const*) const'
collect2: ld returned 1 exit status
make[2]: *** [src/phc] Error 1
make[2]: Leaving directory `/home/antoranz/Descargas/php/phc-0.3.0.1'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/antoranz/Descargas/php/phc-0.3.0.1'
make: *** [all] Error 2
|
|
|
|
05-25-2012, 06:10 PM
|
#7
|
|
Senior Member
Registered: Apr 2003
Location: Colombia
Distribution: Kubuntu, Debian, Knoppix
Posts: 1,888
Original Poster
Rep:
|
Well.... this is beyond me. Why is this failing?
First, the -lboost_regex option is being included when calling g++ and also -L/usr/local/boost/lib. See for yourself in the previous post.
I nmed the boost_regex.so file to see if the symbol is there. It is:
Code:
$ nm /usr/local/boost/lib/libboost_regex.so | grep raise_runtime_error
0009d3e0 T _ZN5boost9re_detail19raise_runtime_errorERKSt13runtime_error
And, of course, the function is defined in ./libs/regex/src/regex.cpp:
Code:
.
.
.
namespace boost {
.
.
.
namespace re_detail{
BOOST_REGEX_DECL void BOOST_REGEX_CALL raise_runtime_error(const std::runtime_error& ex)
{
::boost::throw_exception(ex);
}
.
.
.
}
.
.
.
}
What the hell is going on?
|
|
|
|
05-25-2012, 10:52 PM
|
#8
|
|
Senior Member
Registered: Apr 2003
Location: Colombia
Distribution: Kubuntu, Debian, Knoppix
Posts: 1,888
Original Poster
Rep:
|
The problem is now related to linking and the problem to which this thread was about has been solved so I'll open a new thread with a more proper heading. This is marked as solved as of now.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 09:36 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|