Forums > Dev

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

December 30, 2006 | 2:44 am

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


December 30, 2006 | 9:23 am

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


December 31, 2006 | 1:14 pm

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


January 2, 2007 | 6:00 pm

Some cpp examples without flext, here:

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


January 16, 2007 | 6:54 pm

Sure you can

here’s an external I wrote in C++

https://svn.sourceforge.net/svnroot/osctools/trunk/oscbonjour/oscbonjour.cpp

and here’s a toy example using ObjectiveC

http://recherche.ircam.fr/equipes/temps-reel/movement/muller/index.php?entry=entry061109-110500


January 17, 2007 | 7:24 am

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

Cheers,
Philippe


January 21, 2007 | 5:25 pm

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


January 22, 2007 | 6:28 pm

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
>
>
>


January 22, 2007 | 9:33 pm

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:


Viewing 9 posts - 1 through 9 (of 9 total)