OSC block causes Call to explicitly deleted default constructor compiler error

I am in tech and quickly trying to add the new OSC block to my program.

Once I add (nothing more)

  • #include “Osc.h”

  • osc::ReceiverUdp mReceiver;

to my otherwise working iOS program, I immediately get

Call to explicitly deleted default constructor of ‘MyApp’ in AppCocoaTouch.h on this line:

  • AppCocoaTouch *app = static_cast<AppCocoaTouch *>( new AppT );

Has anybody seen this?

Quick help would be greatly appreciated.

Thanks

–8

There’s no default constructor, so you’ll either need to initialise it in your app’s constructor or heap allocate it.

YourApp::YourApp ( )
:  App()
,  mReceiver ( 2000 ) // port
{ }

or

// make mReceiver a std::unique_ptr<osc::ReceiverUdp>;
void YourApp::setup ( )
{
    mReceiver = std::make_unique<osc::ReceiverUdp>(2000); // c++14 for make_unique
}
1 Like

Yeah, there’s no default constructor. You can do what @lithium suggests, add a constructor to your cinder app, or use std::make_shared.

@ryanbartley @lithium Thanks guys.