[Mono-list] Symbol not found: _environ (libmono.0.0.0.dylib)

Geoff Norton gnorton at novell.com
Tue Apr 8 22:11:45 EDT 2008


Wei & Joe,

   It looks like PythonNET is using _environ, which is decalred as a  
global in most unices, but not on OSX.

You can add

#if __APPLE__
#include <crt_externs.h>
#define environ *_NSGetEnviron();
#endif

To the file in PythonNET that needs _environ (or some global header)  
and it should work.

Let me know,

-g

On 8-Apr-08, at 9:46 PM, Joe Frayne wrote:

> Just to be clear, Wei and I are trying to get "Python for .NET"  
> working under mono:
>
> http://pythonnet.sourceforge.net/
>
> Thanks for any help!
>
> Joe Frayne
> Blizzard Entertainment
>
>
> From: Wei Qiao
> Sent: Tuesday, April 08, 2008 6:37 PM
> To: mono-list at lists.ximian.com
> Cc: Wei Qiao; Joe Frayne
> Subject: Symbol not found: _environ (libmono.0.0.0.dylib)
>
> Hello,
>
> I was wondering if someone could shed some light on this strange  
> loading error.
>
> I’m trying to compile and run PythonNET under mono. PythonNet  
> creates a dynamic library named clr.so.  clr.so compiled fine with  
> no errors.
>
> otool output on clr.so:
> /usr/lib/libiconv.2.dylib (compatibility version 7.0.0, current  
> version 7.0.0)
> /Library/Frameworks/Mono.framework/Versions/1.2.3.1/lib/ 
> libgmodule-2.0.0.600.3.dylib (compatibility version 601.0.0, current  
> version 601.3.0)
> /Library/Frameworks/Mono.framework/Versions/1.2.3.1/lib/libmono. 
> 0.0.0.dylib (compatibility version 1.0.0, current version 1.0.0)
> /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current  
> version 111.0.0)
> /Library/Frameworks/Mono.framework/Versions/1.2.3.1/lib/ 
> libglib-2.0.0.600.3.dylib (compatibility version 601.0.0, current  
> version 601.3.0)
> /Library/Frameworks/Mono.framework/Versions/1.2.3.1/lib/libintl. 
> 3.4.0.dylib (compatibility version 8.0.0, current version 8.0.0)
> /Library/Frameworks/Mono.framework/Versions/1.2.3.1/lib/ 
> libgthread-2.0.0.600.3.dylib (compatibility version 601.0.0, current  
> version 601.3.0)
> /System/Library/Frameworks/Python.framework/Versions/2.5/Python  
> (compatibility version 2.5.0, current version 2.5.1)
> /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current  
> version 1.0.0)
>
>
> But when I try to load clr.so. I get the following error:
> ImportError: dlopen(/Library/Python/2.5/site-packages/clr.so, 2):  
> Symbol not found: _environ
> Referenced from: /Library/Frameworks/Mono.framework/Versions/1.2.3.1/ 
> lib/libmono.0.0.0.dylib
> Expected in: flat namespace
>
>
> otool output on libmono.0.0.0.dylib:
>  /Library/Frameworks/Mono.framework/Versions/1.2.3.1/lib/libmono. 
> 0.0.0.dylib:
> /Library/Frameworks/Mono.framework/Versions/1.2.3.1/lib/libmono. 
> 0.0.0.dylib (compatibility version 1.0.0, current version 1.0.0)
> /Library/Frameworks/Mono.framework/Versions/1.2.3.1/lib/ 
> libgmodule-2.0.0.600.3.dylib (compatibility version 601.0.0, current  
> version 601.3.0)
> /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current  
> version 88.3.4)
> /Library/Frameworks/Mono.framework/Versions/1.2.3.1/lib/ 
> libgthread-2.0.0.600.3.dylib (compatibility version 601.0.0, current  
> version 601.3.0)
> /Library/Frameworks/Mono.framework/Versions/1.2.3.1/lib/ 
> libglib-2.0.0.600.3.dylib (compatibility version 601.0.0, current  
> version 601.3.0)
> /Library/Frameworks/Mono.framework/Versions/1.2.3.1/lib/libintl. 
> 3.4.0.dylib (compatibility version 8.0.0, current version 8.0.0)
> /usr/lib/libiconv.2.dylib (compatibility version 5.0.0, current  
> version 5.0.0)
>
>
> It looks like libmono.0.0.0.dylib couldn’t resolve symbol _environ.  
> Any ideas please?
>
> Thanks,
>
> Wei Qiao
> Sr. Cinematic Software Engineer
> Blizzard Entertainment
>
> _______________________________________________
> Mono-list maillist  -  Mono-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-list/attachments/20080408/41b005a2/attachment.html 


More information about the Mono-list mailing list