Dynamic library (dylib) for external object.

Nov 29, 2012 at 12:07am

Dynamic library (dylib) for external object.

Hello,

I’m kind of new in developing external objects in C. So far I managed to compile my object, but when I shared it to friends to test it.
It did not work because the library wasn’t install on their computer.

So I’m wondering if there is a way to include it in my object ??

To enter in details, I’m using liblo library to use OSC message (to send and receive). So when the object is loaded on a different computer, max can’t find the dylib (liblo.7.dylib) on their computers.

Maybe I should not use a library and code in C myself. I went to http://archive.cnmat.berkeley.edu/OpenSoundControl/, but it wasn’t a good help for me.

Anyone would have an hint for ?

Thanks a lot.

Rom

#65418
Nov 29, 2012 at 12:40am

Hi,

this problem has been discussed more generally on the Forum before, basically with the ‘usual’ MS Visual Studio-related missing DLL hell (see http://cycling74.com/forums/topic.php?id=32989 or http://cycling74.com/forums/topic.php?id=33680 etc.). The most usual solution to the missing shared library trouble is: just compile your external with static libraries. It will increase the size of your external, obviously, but you won’t have the portability trouble…

Hope that helps,
Ádám

#235731
Nov 29, 2012 at 12:58am

HI Adam,

Thank you for your quick answer, I forgot to mention that I’m on mac. I’m using Xcode 3.2.6.

I try the solution of the static lib, liblo.a. But this time the object was even not loaded at all (Unknown external object type).

#235732
Nov 29, 2012 at 1:14am

Hi Rom,

yep, this is always a pain, both on Win and Mac (although I’m basically on Mac, too, so for me it’s double-pain when compiling on Win due to my lack of Win-skills). But with proper compiler configuration, you can do it (I just don’t remember, how, but wanted to encourage you to find the right way). Probably you should google it up.

Another alternative (which is what I do in most cases) would be — if you have the source code of the library — to simply copy the original source code files into your project and compile your external that way. Of course, you’ll need to make some additional config stuff in most cases, but still, for me this method proved easier than anything else.

HTH,
Ádám

#235733
Nov 29, 2012 at 1:30am

Hi again Ádám,

I will try this way, if I understand well, I should include the headers and the rest within my Xcode project ?

#235734
Nov 29, 2012 at 1:58am

Hi Ron,

exactly. To see a (hopefully still) working example, check out the source code of my object called [sadam.lzo] in The sadam Library (see http://cycling74.com/forums/topic.php?id=42930 ).

Hope that helps,
Ádám

#235735
Nov 29, 2012 at 3:49am

Hey Adam,

So I tried this way, but it didn’t work.

By chance I found on monome forum, that someone made a Framework of the Liblo library, and managed to have it worked following this thread (http://cycling74.com/forums/topic.php?id=29994). At the moment I have to place the Framework into Max app. But will see if I can put it directly into the Max external.

Thanks for your help :)

#235736

You must be logged in to reply to this topic.