Here is the error:<div><br></div><div><div>code 4, error number 0 (Symbol not found: _Py_DebugFlag</div><div> Referenced from: /Library/Application Support/Digidesign/Plug-Ins/Play.dpm/Contents/MacOS/Play</div><div> Expected in: /System/Library/Frameworks/AudioUnit.framework/Versions/A/AudioUnit</div>
<div>)</div><br><div class="gmail_quote">On Thu, May 22, 2008 at 10:13 AM, Patrick Stinson <<a href="mailto:patrickstinson.lists@gmail.com">patrickstinson.lists@gmail.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
I get an error reporting an unfound symbol using a statically linked release build of python2.5 on a OSX-Tiger. This works fine on leopard, where the system default python is version 2.5.1 - the same version that I'm using to link to.<br>
<br>Sorry, I'm currently screwing with my configs and don't have a build to run (my bad :) anymore, but the error is basically this:<br><br>Undefined symbol: _PY_DebugFlag<br>Referenced From: <my exe><br>Expected in: <core audio framework lib image location><br>
<br>I moved the system python frameworks out of the frameworks path for the build and run just to make sure that they weren't somehow getting in the way. I found that that symbol is defined in pydebug.h for both release and debug builds. Also, I discovered that I can fix the problem with some of my targets (I have both standalone exe and plugin lib versions of my app code) by referencing the variable directly like this: int mine = Py_DebugFlag, which fixes that symbol but then the next symbol in pydebug (PY_VerboseFlag) is reported as undefined. After some playing with it, I found that the following code will fix the problem in a basic standalone app:<br>
<br> int _________mine;<br> void *__________p = NULL;<br> _________mine = Py_DebugFlag;<br> _________mine = Py_VerboseFlag;<br> _________mine = Py_InteractiveFlag;<br> _________mine = Py_OptimizeFlag;<br>
_________mine = Py_NoSiteFlag;<br> _________mine = Py_UseClassExceptionsFlag;<br> _________mine = Py_FrozenFlag;<br> _________mine = Py_TabcheckFlag;<br> _________mine = Py_UnicodeFlag;<br> _________mine = Py_IgnoreEnvironmentFlag;<br>
_________mine = Py_DivisionWarningFlag;<br> _________mine = _Py_QnewFlag;<br> __________p = (void *) _PyOS_ReadlineTState;<br> __________p = (void *) PyOS_ReadlineFunctionPointer;<br><br><br>Woah, don't I feel like the lib is jerking me around a little? Anyway, this works if I put it in main() for a standalone target, in a semi-random class constructor for the AudioUnit target, and I still can't find the right place to put it for the RTAS (<a href="http://www.digidesign.com/index.cfm?query=developers%20plugin_info%20rtas.cfm&langid=1" target="_blank">http://www.digidesign.com/index.cfm?query=developers%20plugin_info%20rtas.cfm&langid=1</a>) target. It's a little weird that I'm getting this at runtime and not at link-time since I'm linking statically.<br>
<br>This is the standalone main() that works, but fails if I remove the above code:<br><br>#include <Python.h><br><br>int main(int, char **)<br>{<br> int mine = -1;<br> void *p = NULL;<br><br> mine = Py_DebugFlag;<br>
mine = Py_VerboseFlag;<br> mine = Py_InteractiveFlag;<br> mine = Py_OptimizeFlag;<br> mine = Py_NoSiteFlag;<br> mine = Py_UseClassExceptionsFlag;<br> mine = Py_FrozenFlag;<br> mine = Py_TabcheckFlag;<br> mine = Py_UnicodeFlag;<br>
mine = Py_IgnoreEnvironmentFlag;<br> mine = Py_DivisionWarningFlag;<br> mine = _Py_QnewFlag;<br> p = (void *) _PyOS_ReadlineTState;<br> p = (void *) PyOS_ReadlineFunctionPointer;<br><br> Py_Initialize();<br><br> Py_Finalize();<br>
}<br><br><br>It seems to me like this might have something to do with setting up a symbol lookup table correctly or something, I don't know. I'm not having any problems with debug builds. This is the relevant part of my config.status.<br>
<br>ac_cs_version="\ <br>python config.status 2.5 <br>
configured by ./configure, generated by GNU Autoconf 2.59, <br> with options \"'--enable-universalsdk' '--disable-shared'\"<br>
<br><br>Help? *whimper*.. Cheers.<br><br>
</blockquote></div><br></div>