LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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

Reply
 
Search this Thread
Old 05-25-2012, 03:23 PM   #1
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Colombia
Distribution: Kubuntu, Debian, Knoppix
Posts: 1,982
Blog Entries: 1

Rep: Reputation: 83
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);
}
 
Old 05-25-2012, 03:24 PM   #2
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Colombia
Distribution: Kubuntu, Debian, Knoppix
Posts: 1,982
Blog Entries: 1

Original Poster
Rep: Reputation: 83
Specifically, the line with the problem is

Code:
int result = zend_fcall_info_init (&fn, &fci, &fcic TSRMLS_CC);
 
Old 05-25-2012, 03:55 PM   #3
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Colombia
Distribution: Kubuntu, Debian, Knoppix
Posts: 1,982
Blog Entries: 1

Original Poster
Rep: Reputation: 83
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.
 
Old 05-25-2012, 04:10 PM   #4
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Colombia
Distribution: Kubuntu, Debian, Knoppix
Posts: 1,982
Blog Entries: 1

Original Poster
Rep: Reputation: 83
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?
 
Old 05-25-2012, 04:15 PM   #5
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Colombia
Distribution: Kubuntu, Debian, Knoppix
Posts: 1,982
Blog Entries: 1

Original Poster
Rep: Reputation: 83
Another libboost version perhaps?
 
Old 05-25-2012, 05:17 PM   #6
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Colombia
Distribution: Kubuntu, Debian, Knoppix
Posts: 1,982
Blog Entries: 1

Original Poster
Rep: Reputation: 83
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
 
Old 05-25-2012, 06:10 PM   #7
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Colombia
Distribution: Kubuntu, Debian, Knoppix
Posts: 1,982
Blog Entries: 1

Original Poster
Rep: Reputation: 83
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?
 
Old 05-25-2012, 10:52 PM   #8
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Colombia
Distribution: Kubuntu, Debian, Knoppix
Posts: 1,982
Blog Entries: 1

Original Poster
Rep: Reputation: 83
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.
 
  


Reply

Tags
compilation, phc, precise


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] phc (php compiler) - How to compile on kubuntu precise eantoranz Linux - Software 3 05-25-2012 03:20 PM
[SOLVED] Invalid Conversion from... Zssfssz Programming 4 01-21-2012 12:30 AM
invalid conversion from `int*' to `socklen_t*' r350 Programming 5 10-02-2011 05:34 PM
invalid conversion m.dehghan Programming 1 07-28-2011 05:18 AM
Invalid conversion from bool fsshl Programming 3 07-19-2011 06:42 PM


All times are GMT -5. The time now is 01:40 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration