We help IT Professionals succeed at work.

Linking SWIG PHP5 Extension -- Error on Zend Symbols -- Where to Find Them?

bcresanta
bcresanta asked
on
I am getting linker errors for unresolved Zend symbols.   Messages given here:
Undefined symbols:
  "_zend_register_long_constant", referenced from:
      SWIG_Php4_SetModule(swig_module_info*)      in SWIGCrawler_wrap.o
  "_compiler_globals", referenced from:
      _compiler_globals$non_lazy_ptr in SWIGCrawler_wrap.o
  "__efree", referenced from:
      SWIG_Php4_GetModule()     in SWIGCrawler_wrap.o
  "__emalloc", referenced from:
      SWIG_Php4_GetModule()     in SWIGCrawler_wrap.o
  "_zend_get_constant", referenced from:
      SWIG_Php4_GetModule()     in SWIGCrawler_wrap.o
--------------------
The errors are generated from the SWIG generated portion of the file, the xx_wrap.o file.   Does anyone know what library __efree, __emalloc, and the others come from.   I am using Mac OSX Leopard.


Comment
Watch Question

It maybe this library:

http://directory.fsf.org/project/libmemcache/

Andrew

Author

Commented:
I've downloaded, compiled, and linked against memcache at your advice, and the linker is still reporting the same errors.  I'm pretty sure they are Zend specific.  The methods are pretty fundamental and rudimentary if they are __emailloc, etc.   Still Stumped.
jkr
BRONZE EXPERT
Top Expert 2012
Commented:
This one http://www.lemurproject.org/phorum/read.php?11,2223 looks like a similar problem. Could you try that suggestion?

Author

Commented:
I had already worked through this problem as posted at  http://www.lemurproject.org/phorum/read.php?11,2223.  It appears he has the same problem,  but the problem isn't solved there.   The discussion becomes distracted over the fact that MacOSX uses -bundle as a linker option instead of -share.  I've been over the Google resources pretty thoroughly. Not solved yet.  I continue to work on it too.
Compile PHP from scratch and use libtool to create libraries from the object files in the <php-dist>/Zend and <php-dist>/TSRM directories.   Link against the resulting libraries.   The problem is that PHP incrmentailly links against these object files during compilation wiithout formally creating a library of them.

Explore More ContentExplore courses, solutions, and other research materials related to this topic.