Hi,
I guess I should introduce myself first: I'm Manfred Stienstra, I'm a
parttime web application programmer and parttime student Artificial
Intelligence.
I was asked by a teacher to create a php api for MonetDB [1], I started
working on that today, and I can't find out how to create a dynamic
loadable extension. The code I'm using is the standard code from
ext_skel.
I've tried this:
gcc -fpic -DCOMPILE_DL=1 -I/usr/local/include -I. -I.. -I ../..
-I../../Zend -I../../include -I../../main -I../../TSRM -c -o monet.o
monet.c
ld --export-dynamic -shared -L/usr/lib -o monet.so monet.o
but php gives this error:
Warning: dl(): Invalid library (maybe not a PHP library) 'monet.so' in
/var/www/tail.dwerg.net/htdocs/monet/index.php on line 3
Is there some way to use the php build structure to create dynamic
loadable extensions or does someone know how to fix this?
Manfred Stienstra
gcc -fpic -DCOMPILE_DL=1 -I/usr/local/include -I. -I.. -I ../..
-I../../Zend -I../../include -I../../main -I../../TSRM -c -o monet.o
monet.c
I had this problem myself recently before I figured out how to build the
standalone shared module. If memory serves me correctly your above line
is incorrect and should be as follows:
gcc -fpic -DCOMPILE_DL_MONET=1 -I/usr/local/include -I. -I.. -I ../..
-I../../Zend -I../../include -I../../main -I../../TSRM -c -o monet.o
monet.c
The change was to add _MONET to the -DCOMPILE_DL portion of the
statement.
HTH,
Rob.
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting |
| a powerful, scalable system for accessing system services |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`------------------------------------------------------------'
Hi,
As some might remember from last week, I'm trying to develop a php
extension, but I'm having a little trouble getting it compiled...
/home/dwerg/code/2003/monetdb/php-4.3.3/ext/monet/monet.c:42: error:
`zif_monet_connect' undeclared here (not in a function)
/home/dwerg/code/2003/monetdb/php-4.3.3/ext/monet/monet.c:42: error:
initializer element is not constant
Does anyone know how I can fix this?
Manfred
p.s. I didn't attach the code, because I don't want to spam the list
with big files.
Manfred Stienstra wrote:
Hi,
As some might remember from last week, I'm trying to develop a php
extension, but I'm having a little trouble getting it compiled.../home/dwerg/code/2003/monetdb/php-4.3.3/ext/monet/monet.c:42: error:
`zif_monet_connect' undeclared here (not in a function)
/home/dwerg/code/2003/monetdb/php-4.3.3/ext/monet/monet.c:42: error:
initializer element is not constantDoes anyone know how I can fix this?
Manfred
p.s. I didn't attach the code, because I don't want to spam the list
with big files.
Then, please place the files somewhere on the web, so we can see the code
Andrey
Manfred Stienstra wrote:
Hi,
As some might remember from last week, I'm trying to develop a php
extension, but I'm having a little trouble getting it compiled.../home/dwerg/code/2003/monetdb/php-4.3.3/ext/monet/monet.c:42: error:
`zif_monet_connect' undeclared here (not in a function)
/home/dwerg/code/2003/monetdb/php-4.3.3/ext/monet/monet.c:42: error:
initializer element is not constantDoes anyone know how I can fix this?
Then, please place the files somewhere on the web, so we can see the code
Here are the files:
http://tail.dwerg.net/monet/monet.c
http://tail.dwerg.net/monet/php_monet.h
http://tail.dwerg.net/monet/config.m4
Manfred
Manfred Stienstra wrote:
Manfred Stienstra wrote:
Hi,
As some might remember from last week, I'm trying to develop a php
extension, but I'm having a little trouble getting it compiled.../home/dwerg/code/2003/monetdb/php-4.3.3/ext/monet/monet.c:42: error:
`zif_monet_connect' undeclared here (not in a function)
/home/dwerg/code/2003/monetdb/php-4.3.3/ext/monet/monet.c:42: error:
initializer element is not constantDoes anyone know how I can fix this?
Then, please place the files somewhere on the web, so we can see the code
Here are the files:
http://tail.dwerg.net/monet/monet.c
http://tail.dwerg.net/monet/php_monet.h
http://tail.dwerg.net/monet/config.m4Manfred
I see something bad in php_monet.h :
PHP_FUNCTION(mysql_connect);
PHP_FUNCTION(mysql_close);
As you probably see this you misspelled the names.
Andrey
I see something bad in php_monet.h :
PHP_FUNCTION(mysql_connect);
PHP_FUNCTION(mysql_close);As you probably see this you misspelled the names.
Oops, sorry to have bothered you with this...
Manfred