# C++ Example compiles but does not run properly

**URL:** <https://discuss.ray.io/t/c-example-compiles-but-does-not-run-properly/1496>\
**Category:** Ray Core\
**Created:** [March 31, 2021, 8:57pm UTC](https://discuss.ray.io/t/c-example-compiles-but-does-not-run-properly/1496 "2021-03-31T20:57:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![HuangLED](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/huangled/32/132_2.png) [@HuangLED](https://discuss.ray.io/u/HuangLED)\
**Post date:** [March 31, 2021, 8:57pm UTC](https://discuss.ray.io/t/c-example-compiles-but-does-not-run-properly/1496/1 "2021-03-31T20:57:25Z")

</div>

I was able to build cpp/example, it runs, with ray service started

 ![screen_shot_2021-03-29_at_5.50.44_pm](https://us1.discourse-cdn.com/flex020/uploads/ray/original/1X/14dbdeda85fc9d65b3e0eb2eb563900ed36c6660.png) , but end up completely silent no output. Looks like none of the subsequent operation ever executes.

see the output and the code change side by side.

---

<div class="post-metadata">

**Author:** ![HuangLED](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/huangled/32/132_2.png) [@HuangLED](https://discuss.ray.io/u/HuangLED)\
**Post date:** [March 31, 2021, 8:58pm UTC](https://discuss.ray.io/t/c-example-compiles-but-does-not-run-properly/1496/2 "2021-03-31T20:58:54Z")

</div>

Never mind. The problem is gone with following operations: refreshed python environment using pyenv, installed ray from python folder, then recomplile. Now it works.

Root cause still unknown.

---

<div class="post-metadata">

**Author:** ![qicosmos](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/qicosmos/32/993_2.png) [@qicosmos](https://discuss.ray.io/u/qicosmos)\
**Post date:** [May 13, 2021, 5:39am UTC](https://discuss.ray.io/t/c-example-compiles-but-does-not-run-properly/1496/3 "2021-05-13T05:39:42Z")

</div>

You could look at this link:[C++ API: running example and cluster\_mode\_test segfaults on Mac OS](https://discuss.ray.io/t/c-api-running-example-and-cluster-mode-test-segfaults-on-mac-os/1665)

Let me know if you have any questions.
