problem loading MXO in Mac OS X

Mar 4, 2010 at 9:27am

problem loading MXO in Mac OS X

Hi everyone,

I’m trying to create my first Max external object. Very soon (I hope) the external will read from an Arduino-based haptic glove I’ve built, through a serial port, making the data available to a Max5 patcher.

I’ve followed this tutorial:

http://soundlab.kaist.ac.kr/courses/633/downloads/Writing_MaxMSP_Tutorial_1.pdf

…which gets me to the point of successfully building an MXO. After I place the MXO under the max-exernals directory, I am able to reference it in my patcher. However, I get this error message:

2010-03-03 18:00:22.420 MaxMSP[37128:20b] Attempt to load executable of a type that cannot be dynamically loaded for CFBundle 0x18e4bfb0 (executable, not loaded)

I haven’t been able to figure out what this means. Any idea what I’m doing wrong? I’m running Mac OS X 10.5. My XCode project and source code, which are based on the tutorial, are here:

http://github.com/joshsh/laboratory/tree/master/maxmsp/test/first_max_external/

Thanks for any tips!

#48897
Mar 5, 2010 at 3:28pm

You probably want to ask this in the Dev forum, more likely to find knowledgeable people there…

#175694
Mar 5, 2010 at 5:10pm

Hello maxers,

It seems that i have the magic power to move threads …

#175695
Mar 5, 2010 at 10:50pm

Thanks. The Dev forum seems like the place to be.

So, anyone seen this before? I’m new to both Max/MSP and Xcode, so it could very well be something simple, but so far I’m stuck.

#175696
Mar 6, 2010 at 12:34am

I’ve never seen that error exactly, but I can take a guess…You may be compiling for the wrong platform (intel/ppc) – check the project settings for architecture – also get info on the .mxo in the finder to see whether you’ve made a ppc or intel or universal package. If the type is not universal and doesn’t match the machine type I’d say that’s your problem. Otherwise I’d guess one of your other project settings to do with the package type etc. is not right….

A.

#175697
Mar 6, 2010 at 6:55am

Hello maxers,

If my memory is good, I already had this kind of problem ;
i’m not sure but it can be a name conflict at it seems your external is :

first_max_external.mxo

while in your code :

c = class_new( “simplemax”

IHMO you should give all the same, that is :

toto.c
toto_prefix.pch
c = class_new(“toto” …
void toto_new ( ) …

Info.plist default settings gives project’s name to your external.

HTH.

((P.S : I’m X.code 2.5 ;
i can send you a nutshell example project,
if you can’t solve your problem)).

#175698
Mar 17, 2010 at 10:19pm

Thanks for the suggestions! Actually, I think a number of things may be wrong:

1) XCode seems to be confused as to whether I’m building an application or an external object. When I attempt to execute the binary file in Contents/MacOS of a normal mxo bundle, I get an error message. However, when I try to execute mine, I get an additional error message indicating that this library can’t be loaded:
@executable_path/../Frameworks/MaxAPI.framework/Versions/A/MaxAPI
However, only *.app’s seem to have a Frameworks folder, while *.mxo’s do not.

2) I get a warning when I build that the max-includes file has been skipped (“unexpected type ‘folder’ in Frameworks & Libraries build phase”).

I’ve fixed the naming issues (thanks, vanille, for pointing that out), so maybe I’m one step closer. An example project sounds really nice, though! Do you suppose that Xcode 3.2 is backwards compatible with your example?

I guess I need to improve my understanding of Xcode in general. I don’t know what I’m doing.

#175699
Mar 18, 2010 at 5:23am

Alright, I’ve given up on my attempt to follow that tutorial. I’m moving right along now that I’ve turned to the examples and documentation provided with the Max 5 SDK. Thanks again for the feedback.

#175700
Mar 18, 2010 at 5:14pm

Hello maxers,

i’m not sure it’s compatible as i’m Xcode 2.5 and OS 10.4.11, but here a link to download the example http://dl.free.fr/iCGiZqMWD ;

anyway HOWTO :

---
new project -> bundle -> carbon bundle
file name : flop
delete    : main.c + info.plist
add       : flop.c (in source)
          : maxmspsdk.xconfig
          : maxAPI.framework (in external frameworks, from c74support in SDK)

edit project settings :	Based on maxmspdsk
edit active target    : info.plist file : $(SRCROOT)/../info.plist
			wrapper extension : .mxo
---

That’s it !? (work for me, i test it !) ;

In 5.1.1 SDK’s examples, you just have to push the build button ;-)

Anyway do you have problems when building, or later with maxMSP ?

HTH

#175701
Mar 19, 2010 at 1:01am

Thanks, vanille. Your example doesn’t build on my machine: Xcode complains that “GCC 4.2 is not compatible with the Mac OS X 10.4 SDK”. No worries, though. As you say, the Max 5 SDK examples build at the press of a button (I just wasn’t aware of them before). Thanks again.

#175702

You must be logged in to reply to this topic.