# How to compile my code

**URL:** <https://root-forum.cern.ch/t/how-to-compile-my-code/32780>\
**Category:** Newbie\
**Created:** [February 18, 2019, 11:41am UTC](https://root-forum.cern.ch/t/how-to-compile-my-code/32780 "2019-02-18T11:41:26Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [February 18, 2019, 11:58am UTC](https://root-forum.cern.ch/t/how-to-compile-my-code/32780/3 "2019-02-18T11:58:05Z")

</div>

```auto
#include "TH1.h"

// "ROOT Script" entry point.
void wth() {
  TH1F *aPointer = new TH1F("a", "a", 10, 0., 1.);
  aPointer->Draw();
}

#if !defined( __CINT__ ) && !defined( __CLING__ ) && !defined( __ACLIC__ )
// "Standalone Application" entry point.
// `root-config --cxx --cflags` -o wth wth.cc `root-config --libs`
int main()
{
  wth();
  return 0;
}
#endif /* !defined( __CINT__ ) && !defined( __CLING__ ) && !defined( __ACLIC__ ) */

```

BTW. When you post “source code” or “output” here, do remember to enclose them into two lines which contain just three characters ``` (see how your post has been edited above).

---

_[View the full topic](https://root-forum.cern.ch/t/how-to-compile-my-code/32780)._
