No realize class procedure defined

I suspected the problem could be on the libXt since the XtRealizeWidget symbol is defined in that library. I looked at it using nm but all seemed well:

$ nm -D /usr/lib/libXt.so |grep XtRealizeWidget
02b39870 T XtRealizeWidget

The “T” means the symbol is in the text (code) section of the object files that compose the libXt library, so this symbol is defined. The path for the system libraries was also correct and I only had a single version of libXt.

I then thought that the order in which the libraries were being passed on to the gcc linker might be the cause and started reading about it, ending up on this stackoverflow thread

After switching the order of the libraries to:

$ gcc -Wall -o push push.o -lXm -lXt

the problem was solved.

Pay attention to the order in which the libraries and being passed to the linker!

Leave a Comment