Re: compiling sapi/embed module and unknown symbols.
| From: | Edward Rudd | Date: | Tue, 22 Apr 2003 22:37:42 +0000 |
| Subject: | Re: compiling sapi/embed module and unknown symbols. | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-144917@lists.php.net to get a copy of this message | ||
allright I found part of the problem.. but have no clue how to get around
it..
if I create a test program of this
#include "php_embed.h"
int main (int argc, char **argv)
{
zend_alter_ini_entry("test",4,"1",1,PHP_INI_SYSTEM,PHP_INI_STAGE_ACTIVATE);
return 0;
}
and compile it like this
libtool --mode=link gcc -o test test.c -I./include -I./include/Zend
-I./include/TSRM ./libs/libphp4.la
it compiles fine.
BUT if I compile it like this
libtool --mode=link g++ -o test test.c -I./include -I./include/Zend
-I./include/TSRM ./libs/libphp4.la
if failes with the undefinied reference error.
My program IS a C++ program that I am writing so I need to use g++.. Now
why are only SOME functions in the libphp4 affected and how do I work
around the other ones??
On Tue, 22 Apr 2003 17:26:11 -0500, Edward Rudd wrote:
> I am working on using the php_embed sapi module.. This far I have things
> *mostly* working OK. But I am having one annoying, and confusing issue..
>
> I configure php like this.
> ./configure --enable-embed=static --disable-all make
>
> Now when compiling my program I have it link to the libphp4.la (using
> libtool) so it links the libphp4.a file and the required shared libs for
> libphp4.a.. Everthing compiles and links and runs fine.
>
> The problem happens when I try to use function zend_alter_ini_entry and
> various other functions.. I get a link error of "undefined reference to
> 'zend_alter_ini_entry(char *,unsigned in, char *, unsigned int, int,
> int)'"
>
> using nm to list the symbols in libphp4.a I see that the function
> zend_alter_ini_entry IS defined and in the zend_ini.o file.
>
> Now I know those symbols HAVE to be defined and linked in as the
> php_embed sapi module USES them when initializing the php engine. and I
> can debug my program and trace through those functions.. but when I try
> to use them in my function it doesn't work. If anyone can shed any light
> onto why this is happening to me.. I will be greatly appreciated.
>
> Edward Rudd