[Webinar] Streamline your web hosting managementRegister Today


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

Posted on 2008-01-25
Medium Priority
Last Modified: 2010-05-19
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.

Question by:bcresanta
  • 3
LVL 20

Assisted Solution

REA_ANDREW earned 80 total points
ID: 20745790
It maybe this library:



Author Comment

ID: 20745897
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.
LVL 86

Assisted Solution

jkr earned 80 total points
ID: 20746079
This one http://www.lemurproject.org/phorum/read.php?11,2223 looks like a similar problem. Could you try that suggestion?

Author Comment

ID: 20747044
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.

Accepted Solution

bcresanta earned 0 total points
ID: 21133270
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.

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I was prompted to write this article after the recent World-Wide Ransomware outbreak. For years now, System Administrators around the world have used the excuse of "Waiting a Bit" before applying Security Patch Updates. This type of reasoning to me …
This article shows how to use a free utility called 'Parkdale' to easily test the performance and benchmark any Hard Drive(s) installed in your computer. We also look at RAM Disks and their speed comparisons.
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
Suggested Courses

612 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question