# Build fails because of IText

**URL:** <https://iplug2.discourse.group/t/build-fails-because-of-itext/411>\
**Category:** macOS\
**Created:** [13 June 2021 23:31 UTC](https://iplug2.discourse.group/t/build-fails-because-of-itext/411 "2021-06-13T23:31:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![snfk](https://yyz2.discourse-cdn.com/free1/user_avatar/iplug2.discourse.group/snfk/32/140_2.png) [@snfk](https://iplug2.discourse.group/u/snfk)\
**Post date:** [13 June 2021 23:31 UTC](https://iplug2.discourse.group/t/build-fails-because-of-itext/411/1 "2021-06-13T23:31:55Z")

</div>

I’m working on compiling some of my stuff for Mac. I was able to get a project working and compiled via XCode, but I ran into an issue while compiling a project with a custom control -

 ![Screen Shot 2021-06-13 at 7.18.07 PM](https://global.discourse-cdn.com/free1/uploads/iplug2/original/1X/6e8b46c42992ca1592e8ba5d21ad434114f0880d.png)  
Ignore the `const IText* te` - I just forgot to remove it.

Any ideas on how to fix this? This is really gamebreaking and I would appreciate any help. Thanks

Edit: It works on Windows, but not Mac

---

<div class="post-metadata">

**Author:** ![olilarkin](https://yyz2.discourse-cdn.com/free1/user_avatar/iplug2.discourse.group/olilarkin/32/2_2.png) [@olilarkin](https://iplug2.discourse.group/u/olilarkin)\
**Post date:** [14 June 2021 06:50 UTC](https://iplug2.discourse.group/t/build-fails-because-of-itext/411/2 "2021-06-14T06:50:20Z")

</div>

I would create your ITexts as members of the class. In the screenshot you have a memory leak because you’re allocating a new text object on the heap each draw call using the new keyword but you don’t delete it

---

<div class="post-metadata">

**Author:** ![Ric](https://avatars.discourse-cdn.com/v4/letter/r/c77e96/32.png) [@Ric](https://iplug2.discourse.group/u/Ric)\
**Post date:** [15 June 2021 01:59 UTC](https://iplug2.discourse.group/t/build-fails-because-of-itext/411/3 "2021-06-15T01:59:35Z")

</div>

It works for me with curly brackets, like this:

e.g.

`pGraphics-> AttachControl (new ICaptionControl(IRECT (50,117,150,147), kMode, IText {23.,"Roboto-Regular"}, text_bg));`

If they are too complex I create an `IText` variable inside `mLayoutFunc` like this:

```auto
IText myText;
myText.mSize = 20.;
myText.mFGColor = IColor(255,0,0,50);
myText.mTextEntryBGColor = IColor(0,0,0,0);
myText.mAlign = EAlign::Center;

```

But then again, as Oli mentioned above, it would probably be best to create member variables.
