C++ objects in a Max/MSP external (not using flext)?

Dec 30, 2006 at 2:44am

C++ objects in a Max/MSP external (not using flext)?

Has anyone done this? [I want to avoid flext because of the message
calling/memory overhead]

Are there any things I should know? Any special settings for the
Xcode project?

Any simple example of using C++ code in a max object would be great!

Thanks in advance

#29426
Dec 30, 2006 at 9:23am

Graham Wakefield wrote:
> Has anyone done this? [I want to avoid flext because of the message
> calling/memory overhead]
>
> Are there any things I should know? Any special settings for the Xcode
> project?

Hi Graham,

as long as your main() is declared as

extern “C” void main(void)

you can do the rest in C++. I don’t have any code that looks really C++,
only soemthing inbetween, but Max doesn’t care what you code, as long as
your compiler likes it.

Olaf

#92017
Dec 31, 2006 at 1:14pm

Quote: lists@grahamwakefield wrote on Sat, 30 December 2006 03:44
—————————————————-
> Any simple example of using C++ code in a max object would be
> great!
—————————————————-

Oh yes, the two provided examples (2 only) are written in C.
Having a couple of examples in C++ would be more than welcome.
Could someone share some little examples?

Thanks!

Best regards,
Philippe

#92018
Jan 2, 2007 at 6:00pm

Some cpp examples without flext, here:

< http://www.akustische-kunst.org/index.html>

#92019
Jan 16, 2007 at 6:54pm
#92020
Jan 17, 2007 at 7:24am

Thanks for the ObjectiveC example, exactly what I was looking for!

Cheers,
Philippe

#92021
Jan 21, 2007 at 5:25pm

hi remy,

i’m trying you understand and compile your objective-C example: i
keep getting the following errors on compilation:

/usr/bin/ld: Undefined symbols:
.objc_class_name_NSObject
_objc_msgSend
/path/fraction/build/Fraction.build/Development/fraction.build/
Objects-normal/ppc/Fraction.o reference to
undefined .objc_class_name_NSObject
/path/fraction/build/Fraction.build/Development/fraction.build/
Objects-normal/ppc/Fraction.o reference to undefined _objc_msgSend

i’ve tried #include/#importing a bunch of things but no such luck.

see the status of my source attached:

any ideas?

thanks

/*j

> and here’s a toy example using ObjectiveC
> http://recherche.ircam.fr/equipes/temps-reel/movement/muller/
> index.php?entry=entry061109-110500

#92022
Jan 22, 2007 at 6:28pm

You need to add the Foundation framework to the “Link Binary with
Libraries” step in your main target.

_Mark

On Jan 21, 2007, at 9:25 AM, jasch wrote:

> hi remy,
>
> i’m trying you understand and compile your objective-C example: i
> keep getting the following errors on compilation:
>
> /usr/bin/ld: Undefined symbols:
> .objc_class_name_NSObject
> _objc_msgSend
> /path/fraction/build/Fraction.build/Development/fraction.build/
> Objects-normal/ppc/Fraction.o reference to
> undefined .objc_class_name_NSObject
> /path/fraction/build/Fraction.build/Development/fraction.build/
> Objects-normal/ppc/Fraction.o reference to undefined _objc_msgSend
>
>
> i’ve tried #include/#importing a bunch of things but no such luck.
>
> see the status of my source attached:
>
>
>
> any ideas?
>
> thanks
>
> /*j
>
>
>> and here’s a toy example using ObjectiveC
>> http://recherche.ircam.fr/equipes/temps-reel/movement/muller/index.php?entry=entry061109-110500
>
>
>

#92023
Jan 22, 2007 at 9:33pm

thanks,
that was it.

/*j

On 22 Jan 2007, at 19:28, Mark Pauley wrote:

> You need to add the Foundation framework to the “Link Binary with
> Libraries” step in your main target.
>
> _Mark
>
> On Jan 21, 2007, at 9:25 AM, jasch wrote:
>
>> hi remy,
>>
>> i’m trying you understand and compile your objective-C example: i
>> keep getting the following errors on compilation:
>>
>> /usr/bin/ld: Undefined symbols:
>> .objc_class_name_NSObject
>> _objc_msgSend
>> /path/fraction/build/Fraction.build/Development/fraction.build/
>> Objects-normal/ppc/Fraction.o reference to
>> undefined .objc_class_name_NSObject
>> /path/fraction/build/Fraction.build/Development/fraction.build/
>> Objects-normal/ppc/Fraction.o reference to undefined _objc_msgSend
>>
>>
>> i’ve tried #include/#importing a bunch of things but no such luck.
>>
>> see the status of my source attached:

#92024

You must be logged in to reply to this topic.