php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #55669 compile is ok, but can not run it
Submitted: 2011-09-11 18:00 UTC Modified: 2011-09-12 03:14 UTC
From: inqing at gmail dot com Assigned:
Status: Not a bug Package: Dynamic loading
PHP Version: trunk-SVN-2011-09-11 (SVN) OS: ubuntu server 64bit
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: inqing at gmail dot com
New email:
PHP Version: OS:

 

 [2011-09-11 18:00 UTC] inqing at gmail dot com
Description:
------------
Hi phper, There's a trouble with my extension, I just make a sample extension. compile is ok, but when i use ld() function to load my extension, it tells me that 'php: symbol lookup error: /usr/local/lib/php/extensions/no-debug-non-zts-20060613/tintin.so: undefined symbol: init_array'. I don't know why, can you help me? My php version is 5.2.17 and system is Ubuntu Server 64

Test script:
---------------
PHP_FUNCTION(tintin_split){
        zval *new_chars;
        init_array(new_chars);
}

I use this command to compile as follow:

cc -fpic -DCOMPILE_DL_TINTIN=1 -I/usr/local/include -I. -I../.. -I../../Zend -I../../main -I../../TSRM -c -o tintin.o tintin.c
cc -shared -L/usr/local/lib -L/usr/local/lib/php -L/usr/lib -L. -rdynamic -o tintin.so tintin.o
cp tintin.so /usr/local/lib/php/extensions/no-debug-non-zts-20060613/



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-09-12 03:14 UTC] laruence@php.net
-Status: Open +Status: Bogus
 [2011-09-12 03:14 UTC] laruence@php.net
plz *DO NOT* send your own question to bug-web, pecl-dev mail list is which you 
should trun to.

and for you question, as a comment, use -Wall, you will see a implicit declaration 
of function, 

and btw you should use php_ext_skel to generate/compile extension
 
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Thu Sep 28 15:01:25 2023 UTC