# OSC block causes Call to explicitly deleted default constructor compiler error

**URL:** <https://discourse.libcinder.org/t/osc-block-causes-call-to-explicitly-deleted-default-constructor-compiler-error/244>\
**Category:** Uncategorized\
**Created:** [September 1, 2016, 9:42am UTC](https://discourse.libcinder.org/t/osc-block-causes-call-to-explicitly-deleted-default-constructor-compiler-error/244 "2016-09-01T09:42:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![eight\_io](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.libcinder.org/eight_io/32/57_2.png) [@eight\_io](https://discourse.libcinder.org/u/eight_io)\
**Post date:** [September 1, 2016, 9:42am UTC](https://discourse.libcinder.org/t/osc-block-causes-call-to-explicitly-deleted-default-constructor-compiler-error/244/1 "2016-09-01T09:42:17Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![lithium](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.libcinder.org/lithium/32/38_2.png) [@lithium](https://discourse.libcinder.org/u/lithium)\
**Post date:** [September 1, 2016, 11:45am UTC](https://discourse.libcinder.org/t/osc-block-causes-call-to-explicitly-deleted-default-constructor-compiler-error/244/2 "2016-09-01T11:45:56Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ryanbartley](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.libcinder.org/ryanbartley/32/5_2.png) [@ryanbartley](https://discourse.libcinder.org/u/ryanbartley)\
**Post date:** [September 1, 2016, 6:12pm UTC](https://discourse.libcinder.org/t/osc-block-causes-call-to-explicitly-deleted-default-constructor-compiler-error/244/3 "2016-09-01T18:12:14Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![eight\_io](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.libcinder.org/eight_io/32/57_2.png) [@eight\_io](https://discourse.libcinder.org/u/eight_io)\
**Post date:** [September 2, 2016, 7:11pm UTC](https://discourse.libcinder.org/t/osc-block-causes-call-to-explicitly-deleted-default-constructor-compiler-error/244/4 "2016-09-02T19:11:46Z")

</div>

@ryanbartley @lithium Thanks guys.
