# Slot DoDraw() does not exist compiled guide

**URL:** <https://root-forum.cern.ch/t/slot-dodraw-does-not-exist-compiled-guide/44408>\
**Category:** Newbie\
**Tags:** graphics\
**Created:** [April 14, 2021, 2:23am UTC](https://root-forum.cern.ch/t/slot-dodraw-does-not-exist-compiled-guide/44408 "2021-04-14T02:23:41Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![petrstepanov](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/petrstepanov/32/19884_2.png) [@petrstepanov](https://root-forum.cern.ch/u/petrstepanov)\
**Post date:** [April 18, 2021, 5:31pm UTC](https://root-forum.cern.ch/t/slot-dodraw-does-not-exist-compiled-guide/44408/6 "2021-04-18T17:31:21Z")

</div>

Hi Dr. Kolev,

I apologize for the incomplete answer given above. I believed that your issue is related to the build configuration. However, there is more to it.

Now that we clarified the build steps, let us look at the code itself. According to an example in the documentation for [Standalone Version, Writing a GUI](https://root.cern/root/htmldoc/guides/users-guide/WritingGUI.html#a-standalone-version) we have to do the following (refer to the `example2b` option):

- Uncommented `ClassDef(MyMainFrame, 0)` macro in definition of your `MyMainFrame` class.
- Split `MyMainFrame` class definition and implementation into separate `*.h` and `*.cpp` files.

It turns out that both above criteria are required for the stand-alone version to work correctly. I have modified your program code to satisfy the above requirements. Please download the archive with your code below. I’m attaching the example with CMake project generator. Please note that even though the number of source and header files was changed in the project, `CMakeLists.txt` remains the same. It automatically builds corresponding lists of files by searching in the project folder. I favor CMake project generator option over the GNU Makefile because it comes with more possibilities.

[kolev-gui.zip](https://root-forum.cern.ch/uploads/short-url/6NOhwhLr3FtPgr0p2j9EyrlIUVr.zip) (3.5 KB)

Please let me know if this resolves your issue. Also please mark this post as “Solution” if everything works out well.

P.S. @kolev20n, I’ve added a minor fix to your code that correctly terminates ROOT event loop when the main GUI window is closed. Method is implemented in `MyMainFrame::Exit()`. You can find similar code in ROOT GUI examples.

Also it seems that correct location for the `*rdict.pcm` file is [not in dynamic library search path](https://root-forum.cern.ch/t/cannot-find-my-rdict-pcm-files/21901/5), but `/usr/local/bin` instead. So I had to fix that in `CMakeLists.txt`

---

_[View the full topic](https://root-forum.cern.ch/t/slot-dodraw-does-not-exist-compiled-guide/44408)._
