title: No realize class procedure defined
body: <p>I just want to share how I found the solution to the error</p>
  
  <blockquote>
    <p>No realize class procedure defined</p>
  </blockquote>
  
  <p>when running a X/Motif C application. I am posting this because I only found one reference to this problem while searching online, and it contained no solutions. </p>
  
  <p>I managed to solve the problem and wanted to share my findings if you do come across this problem again (<strong>Notice:</strong> I am not saying my solution will <em>always</em> solve this type of error).</p>
  
  <p><strong>Problem</strong></p>
  
  <p>I found this problem while running a simple C program that used the Motif and X Intrinsics toolkits.</p>
  
  <pre><code>$ gcc -Wall -c push.c
  $ gcc -Wall -o push push.o -lXt -lXm
  $ ./push
  Error: No realize class procedure defined
  </code></pre>
  
  <p>The C source code was the following:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;Xm/Xm.h&gt;
  #include &lt;Xm/PushB.h&gt;
  
  /* Prototype Callback function */
  void pushed_fn(Widget, XtPointer, XmPushButtonCallbackStruct *);
  
  int main(int argc, char **argv)
  {
    Widget top_wid, button;
    XtAppContext  app;
    Display* display;
  
    XtToolkitInitialize();
    app = XtCreateApplicationContext();
    display = XtOpenDisplay(app, "localhost:10.0","push","push", NULL,0, &amp;argc,argv);
    top_wid = XtAppCreateShell(NULL, "Form", applicationShellWidgetClass, display, NULL, 0);
  
    button = XmCreatePushButton(top_wid, "Push_me", NULL, 0);
  
    /* tell Xt to manage button */
    XtManageChild(button);
  
    /* attach fn to widget */
    XtAddCallback(button, XmNactivateCallback, (XtCallbackProc) pushed_fn, NULL);
  
    XtRealizeWidget(top_wid); /* display widget hierarchy */
    XtAppMainLoop(app); /* enter processing loop */
    return 0;
  }
  
  void pushed_fn(Widget w, XtPointer client_data, XmPushButtonCallbackStruct *cbs)
  {
    printf("Don't Push Me!!\n");
  }
  </code></pre>