[GEM-dev] Some hints for external on osx

Pierre Laborde pedro.laborde at wanadoo.fr
Wed Feb 2 21:32:53 CET 2005


Hello everybody,

So as suggested Jamie, I've patched my pd from the cvs. And there is  
some progress but it's not enough. As you can compare the console log  
when pd load my external :

Now :

__ZNSt8ios_base4InitC1Ev
__ZNSt8ios_base4InitD1Ev
__ZTVN10__cxxabiv117__class_type_infoE
__ZTVN10__cxxabiv120__si_class_type_infoE
__ZdlPv
__Znwm
___gxx_personality_v0

Before :

__ZN7GemBase11setModifiedEv
__ZN7GemBase17obj_setupCallbackEP6_class
__ZN7GemBase17realStopRenderingEv
__ZN7GemBaseC2Ev
__ZN7GemBaseD2Ev
__ZN9CPPExtern16setCPPObjectNameEPc
__ZN9CPPExtern8m_holderE
__ZNSt8ios_base4InitC1Ev
__ZNSt8ios_base4InitD1Ev
__ZTVN10__cxxabiv117__class_type_infoE
__ZTVN10__cxxabiv120__si_class_type_infoE
__ZdlPv
__Znwm
__ZnwmPvS_
___gxx_personality_v0


Anyway, thanks to Sebastian, I've got now a way to compile my externals  
(with some "extern "C" " for the setup methods) which work fine. I  
shall try later to figure out what is exactly the issue with externals  
on osx. To continue...

Thanks for all your messages that have really helped me,

Pierre



On Feb 1, 2005, at 10:25 PM, james tittle wrote:

> On Feb 1, 2005, at 3:32 PM, Pierre Laborde wrote:
>
>> By the way, as a workaround, I was thinking in compiling the whole  
>> GEM from the Xcode project file that comes with the GEM source. But I  
>> miss the GemLibs folder that is available only for NT and Linux.  
>> Where could I find GemLibs for OSX ?
>
> ...GemLibs is also in cvs, and needs to be checked out like Gem  
> was...however, you only really need freetype-2.1.9 and FTGL, and you  
> can install them anywhere as long as you tell Xcode about it (via  
> cmd-I "get info" on the red colored names)
>
>> g++ -o pix_myblur.o -c pix_myblur.cpp -I../src
>> g++ -bundle -undefined suppress -flat_namespace -o  
>> pix_myblur.pd_darwin
>> pix_myblur.o
>>
>> running "./pd  -lib Gem -lib pix_myblur" results in the following:
>>
>> dyld: ./pd Undefined symbols:
>> __ZN11imageStruct5clearEv
>>
>
> ...actually, doesn't look like you're missing anything except for a  
> patched version of pd :-)
>
> http://sourceforge.net/tracker/index.php? 
> func=detail&aid=1083495&group_id=55736&atid=478072
>
> ...this patch hasn't made it into miller's version (I'll commit it to  
> the devel branches in cvs), but essentially solves yr problem...long  
> ago we had a problem with loading externals that had similarly named  
> symbols (ie. cyclone's prepend vs. maxlib's prepend):  this is known  
> as the dreaded "namespace" problem...
>
> ...on linux and windoze, the behavior is that the "first symbol loaded  
> wins", which means that if you wanted maxlib's prepend, you'd have to  
> include it before cyclone in pd's flag list of loading libs
>
> ...on osx, there is an artificial partitioning of libraries into their  
> own namespaces:  this was done several years ago because otherwise, if  
> you tried to load two libraries with symbol's of the same name, pd  
> would crash...the down side of this was that it prevented libraries  
> from accessing symbols in other loaded libs, and this is what you're  
> seeing:  you're "pix_myblur" can't access any of GEM's symbols...
>
> ...however, I found a way around this when I as trying to get the  
> pdp2gem bridge to work, very simple...this patch only affects  
> bundle/library loading on osx, and prevents crashing on multiple  
> symbols (instead, it prints out a warning)...it also behaves like the  
> other platforms as far as library precedence...
>
> l8r,
> jamie
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/enriched
Size: 3595 bytes
Desc: not available
URL: <http://lists.puredata.info/pipermail/gem-dev/attachments/20050202/e66fe89d/attachment.bin>


More information about the GEM-dev mailing list