Sorry for being a C newby. Could you please help me? I try to follow Sarah's 
extending PHP book and fail to use the embeded PHP sapi:

I compile PHP5.3:
./configure --enable-embed

have a c "program":
#include <sapi/embed/php_embed.h>

int main(int argc, char *argv[]) 
{ 
    PHP_EMBED_START_BLOCK(argc,argv) 
    PHP_EMBED_END_BLOCK() 
    return 0; 
}

and a makefile:
CC=gcc 
CFLAGS=-c -I/usr/local/include/php/ \
            -I/usr/local/include/php/main \
            -I/usr/local/include/php/Zend \
            -I/usr/local/include/php/TSRM \
            -Wall -g 
LDFLAGS=-L/usr/local/lib -lphp5
all: worker.c 
        $(CC) -o worker.o worker.c $(CFLAGS)
        $(CC) -o worker worker.o $(LDFLAGS)


and get after running make:
gcc  -c -I/usr/local/include/php/ -I/usr/local/include/php/main -
I/usr/local/include/php/Zend -I/usr/local/include/php/TSRM -Wall -g -o 
worker.o worker.c
gcc  -L/usr/local/lib -lphp5 -o worker worker.o
worker.o: In function `main':
/var/checkouts/gearman-php-worker/worker.c:5: undefined reference to 
`php_embed_init'
/var/checkouts/gearman-php-worker/worker.c:6: undefined reference to 
`php_embed_shutdown'
collect2: ld returned 1 exit status
make: *** [all] Error 1







Thomas Koch, http://www.koch.ro

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to