<div dir="ltr"><div dir="ltr">On Sat, Apr 11, 2026 at 4:18 PM Danni Coy <<a href="mailto:danni.coy@gmail.com" target="_blank">danni.coy@gmail.com</a>> wrote:</div><div dir="ltr"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div>I currently have a linker error telling me<br><br>undefined reference to `initializer for event.Event`<br><br></div>Event is a struct with a union. Something Like<br><br></div><div>struct Event <br>{<br>    EventType type;<br>    union <br>    {<br>        EventA a;<br>        EventB b;<br>    }<br>}<br><br></div><div>Naming the union makes the linker errors go away.<br></div><div>Can anybody tell me what is going on here?</div></div></blockquote><div><br></div><div>ok with further investigation, linker errors come back as soon as I add the union into the struct.<br><br></div><div>eg <br></div><div>  union u<br>  {...<br>  ...}</div><div>  u event;<br>}</div><div> <br></div><div>why would my struct now no longer have an initializer?</div></div></div>
</div>