# Output is not generated when executing simple-integers.cpp

**URL:** <https://openfhe.discourse.group/t/output-is-not-generated-when-executing-simple-integers-cpp/810>\
**Category:** Library Questions\
**Tags:** openfhe-help\
**Created:** [September 13, 2023, 7:46pm UTC](https://openfhe.discourse.group/t/output-is-not-generated-when-executing-simple-integers-cpp/810 "2023-09-13T19:46:25Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![Poojitha](https://avatars.discourse-cdn.com/v4/letter/p/779978/32.png) [@Poojitha](https://openfhe.discourse.group/u/Poojitha)\
**Post date:** [September 13, 2023, 7:46pm UTC](https://openfhe.discourse.group/t/output-is-not-generated-when-executing-simple-integers-cpp/810/1 "2023-09-13T19:46:25Z")

</div>

Hi,

I installed OpenFHE from stable branch ( v 1.0.4 ) and executed unit tests using “make testall”, all cases were passed. I tried to build and execute simple-integers.cpp as per the instructions in README file available in “openfhe-development\src\pke\examples” path. “make” command has created the the build without any errors, but when i try to run it no output is displayed. I checked the code simple-integers.cpp and it does have cout statments. I am not sure what i am missing here and would appreciate any help.  
Attached screenshots for reference.

 ![image](https://canada1.discourse-cdn.com/flex031/uploads/openfhe/original/1X/83e8be50a893952425fa579e7ae0edd6e20ac49b.png)  
 ![image](https://canada1.discourse-cdn.com/flex031/uploads/openfhe/original/1X/3d2c50fc48d77b0c545f24430fb052ccf49d60fe.png)

---

<div class="post-metadata">

**Author:** ![dcousins](https://yyz1.discourse-cdn.com/flex031/user_avatar/openfhe.discourse.group/dcousins/32/71_2.png) [@dcousins](https://openfhe.discourse.group/u/dcousins)\
**Post date:** [September 14, 2023, 4:52pm UTC](https://openfhe.discourse.group/t/output-is-not-generated-when-executing-simple-integers-cpp/810/2 "2023-09-14T16:52:26Z")

</div>

simple-integers should be in build/bin/examples/pke/simple-integers

You should not run build target test. after make testall there should be a build/unittest directory with three gtest executables for core, pke and binfhe.

---

<div class="post-metadata">

**Author:** ![Poojitha](https://avatars.discourse-cdn.com/v4/letter/p/779978/32.png) [@Poojitha](https://openfhe.discourse.group/u/Poojitha)\
**Post date:** [September 14, 2023, 5:10pm UTC](https://openfhe.discourse.group/t/output-is-not-generated-when-executing-simple-integers-cpp/810/3 "2023-09-14T17:10:45Z")

</div>

I was analyzing how to run code in OpenFHE, so instead of writing code of my own i choose one of the .cpp file provided as examples to see how it executes.  
In order to check this i copied simple-integers.cpp to a new directory “my\_work” and tried to run this after make was successfully completed.

I attached make testall screenshot just to show that installation of OpenFHE is good.

My main question here is how i can execute my own code ? which location should i should place the file and steps to be followed.

---

<div class="post-metadata">

**Author:** ![dcousins](https://yyz1.discourse-cdn.com/flex031/user_avatar/openfhe.discourse.group/dcousins/32/71_2.png) [@dcousins](https://openfhe.discourse.group/u/dcousins)\
**Post date:** [September 14, 2023, 5:48pm UTC](https://openfhe.discourse.group/t/output-is-not-generated-when-executing-simple-integers-cpp/810/4 "2023-09-14T17:48:12Z")

</div>

We recommend build/install OpenFHE on your system, then build your application in another directory using the approach listed here: [“building\_user\_applications”](https://openfhe-development.readthedocs.io/en/latest/sphinx_rsts/intro/building_user_applications.html)

That separates your cmake files from the complicated cmake files of the OpenFHE build process, and is much less error prone.

---

<div class="post-metadata">

**Author:** ![Poojitha](https://avatars.discourse-cdn.com/v4/letter/p/779978/32.png) [@Poojitha](https://openfhe.discourse.group/u/Poojitha)\
**Post date:** [September 14, 2023, 6:50pm UTC](https://openfhe.discourse.group/t/output-is-not-generated-when-executing-simple-integers-cpp/810/5 "2023-09-14T18:50:40Z")

</div>

Sorry, if i am confusing you are not being clear. I have installed OpenFHE on my system and follwed the steps mentioned in [“building\_user\_applications”](https://openfhe-development.readthedocs.io/en/latest/sphinx_rsts/intro/building_user_applications.html).  
I created my\_work folder as my project and followed the steps 3 to 8. Step 8 created my build named test, how do i execute it now? ( i tried ./test )

---

<div class="post-metadata">

**Author:** ![s\_ali](https://avatars.discourse-cdn.com/v4/letter/s/c2a13f/32.png) [@s\_ali](https://openfhe.discourse.group/u/s_ali)\
**Post date:** [September 26, 2023, 8:22pm UTC](https://openfhe.discourse.group/t/output-is-not-generated-when-executing-simple-integers-cpp/810/6 "2023-09-26T20:22:08Z")

</div>

Hi @Poojitha, did you solve the problem of running your own program? If yes, great 👍. And if not, then I’ll try to help you based on my understanding.

---

<div class="post-metadata">

**Author:** ![Poojitha](https://avatars.discourse-cdn.com/v4/letter/p/779978/32.png) [@Poojitha](https://openfhe.discourse.group/u/Poojitha)\
**Post date:** [September 27, 2023, 4:45am UTC](https://openfhe.discourse.group/t/output-is-not-generated-when-executing-simple-integers-cpp/810/7 "2023-09-27T04:45:37Z")

</div>

Hi Ali,

Thank you for response. I am still having problem running my program. I have created new directory and followed instructions specified in [“building\_user\_applications”](https://openfhe-development.readthedocs.io/en/latest/sphinx_rsts/intro/building_user_applications.html). But not getting any output and there aren’t any errors while executing cmake or make command. It would be really wonderful if you can help me with this.  
Attaching cmake file, .cpp file and output screenshots

 ![image](https://canada1.discourse-cdn.com/flex031/uploads/openfhe/original/1X/2ec7f84b6b524c8ad760033ac8b11a9c44c1c174.png)

 ![image](https://canada1.discourse-cdn.com/flex031/uploads/openfhe/original/1X/c062171c8c8fd81b2c296b4c3af22f8380cf4c8a.png)  
 ![image](https://canada1.discourse-cdn.com/flex031/uploads/openfhe/original/1X/066b754b0c2c3896c3969775c4e7900a2bceb462.png)

---

<div class="post-metadata">

**Author:** ![Poojitha](https://avatars.discourse-cdn.com/v4/letter/p/779978/32.png) [@Poojitha](https://openfhe.discourse.group/u/Poojitha)\
**Post date:** [September 27, 2023, 4:46am UTC](https://openfhe.discourse.group/t/output-is-not-generated-when-executing-simple-integers-cpp/810/8 "2023-09-27T04:46:49Z")

</div>

@s_ali please do let me know if you need any other info from my end

---

<div class="post-metadata">

**Author:** ![s\_ali](https://avatars.discourse-cdn.com/v4/letter/s/c2a13f/32.png) [@s\_ali](https://openfhe.discourse.group/u/s_ali)\
**Post date:** [September 28, 2023, 5:59am UTC](https://openfhe.discourse.group/t/output-is-not-generated-when-executing-simple-integers-cpp/810/9 "2023-09-28T05:59:54Z")

</div>

@Poojitha since things are working on my Ubuntu machine, therefore, I thought it should be easy to do the same on Windows machine but I was wrong. So far, I am having on luck in finding the the reason and like you, I’m also having **no output on screen** after running the program on **Windows**.

For the time being – may be not recommended by OpenFHE developers/contributors, I would suggest to safe your program in the sub-directory of **src** e.g., safe your **sample.cpp** in **./openfhe-development/src/pke/examples/**. Next to build your program, go to **./openfhe-development/build/** and run **make allpkeexamples**. Finally, to run your program run **./bin/examples/pke/sample**.

I hope this could solve your problem of running your own program for time being. If I could solve the no output on screen in Windows, then I’ll update you.

---

<div class="post-metadata">

**Author:** ![Poojitha](https://avatars.discourse-cdn.com/v4/letter/p/779978/32.png) [@Poojitha](https://openfhe.discourse.group/u/Poojitha)\
**Post date:** [September 30, 2023, 4:38pm UTC](https://openfhe.discourse.group/t/output-is-not-generated-when-executing-simple-integers-cpp/810/10 "2023-09-30T16:38:46Z")

</div>

@s_ali Thank you i will try the suggested solution for now, hope we can figure this out.

---

<div class="post-metadata">

**Author:** ![ypolyakov](https://yyz1.discourse-cdn.com/flex031/user_avatar/openfhe.discourse.group/ypolyakov/32/47_2.png) [@ypolyakov](https://openfhe.discourse.group/u/ypolyakov)\
**Post date:** [October 3, 2023, 9:34pm UTC](https://openfhe.discourse.group/t/output-is-not-generated-when-executing-simple-integers-cpp/810/11 "2023-10-03T21:34:29Z")

</div>

Hi @Poojitha, @s_ali

I would like to confirm. Are you seeing an issue running a test program based on simple-integers.cpp in a user project when using MingGW? I want to try recreating it.

Another question. Did you try it using the `main` branch (latest pre-release), i.e., v1.1.1? I see a MinGW-specific fix in the issues/PRs for v1.1.0. Maybe it is already fixed in v1.1.x?

Thanks,  
Yuriy

---

<div class="post-metadata">

**Author:** ![Poojitha](https://avatars.discourse-cdn.com/v4/letter/p/779978/32.png) [@Poojitha](https://openfhe.discourse.group/u/Poojitha)\
**Post date:** [October 4, 2023, 5:11am UTC](https://openfhe.discourse.group/t/output-is-not-generated-when-executing-simple-integers-cpp/810/12 "2023-10-04T05:11:05Z")

</div>

Hi @ypolyakov

I have tried running test program based on simple-integers.cpp as well as simple-real-numbers.cpp following the instructions specified in [“building\_user\_applications”](https://openfhe-development.readthedocs.io/en/latest/sphinx_rsts/intro/building_user_applications.html). My intension was to test the steps mentioned in the document.

I have used stable branch (v1.0.4) to clone, haven’t tried main branch.

Thank you in advance!

---

<div class="post-metadata">

**Author:** ![s\_ali](https://avatars.discourse-cdn.com/v4/letter/s/c2a13f/32.png) [@s\_ali](https://openfhe.discourse.group/u/s_ali)\
**Post date:** [October 4, 2023, 2:53pm UTC](https://openfhe.discourse.group/t/output-is-not-generated-when-executing-simple-integers-cpp/810/13 "2023-10-04T14:53:38Z")

</div>

Hi @ypolyakov,

Yes, I’m still having **no output on screen** using simple-integers.cpp in a user project when using MingGW. On the other hand, after setting **export PATH=$PATH:lib** and running **./bin/examples/pke/simple-integers** from **/openfhe-development/build** , I get output on screen.

Yes, I’m using the `main` branch and the log is showing the latest commit **4ebb28ea7bdd894a73bc5b73e59fcfbc78253308** on **Fri Sep 8 12:30:29 2023**. Sorry, I don’t know how to check/confirm the version number i.e., v1…

---

<div class="post-metadata">

**Author:** ![dsuponitskiy-duality](https://avatars.discourse-cdn.com/v4/letter/d/c68b51/32.png) [@dsuponitskiy-duality](https://openfhe.discourse.group/u/dsuponitskiy-duality)\
**Post date:** [October 4, 2023, 6:57pm UTC](https://openfhe.discourse.group/t/output-is-not-generated-when-executing-simple-integers-cpp/810/14 "2023-10-04T18:57:10Z")

</div>

Confirming that there is no output on the screen. I will open a bug ticket and investigate the issue.

---

<div class="post-metadata">

**Author:** ![dsuponitskiy-duality](https://avatars.discourse-cdn.com/v4/letter/d/c68b51/32.png) [@dsuponitskiy-duality](https://openfhe.discourse.group/u/dsuponitskiy-duality)\
**Post date:** [October 12, 2023, 9:54pm UTC](https://openfhe.discourse.group/t/output-is-not-generated-when-executing-simple-integers-cpp/810/15 "2023-10-12T21:54:31Z")

</div>

HI @Poojitha,  
In order to run ./test.exe you should add the absolute path to the location of the openfhe libraries to PATH. I guess that you didn’t run “make install” and used the libraries directly from ~/openfhe-development/build/lib.  
In this case you should run from the command line: **export PATH=/home/pooji/openfhe-development/build/lib:${PATH}**  
After that you can run ./test.exe and it should produce an output

---

<div class="post-metadata">

**Author:** ![iquah](https://yyz1.discourse-cdn.com/flex031/user_avatar/openfhe.discourse.group/iquah/32/8_2.png) [@iquah](https://openfhe.discourse.group/u/iquah)\
**Post date:** [October 13, 2023, 6:06pm UTC](https://openfhe.discourse.group/t/output-is-not-generated-when-executing-simple-integers-cpp/810/16 "2023-10-13T18:06:57Z")

</div>

Sounds like the issue is solved. @Poojitha and @s_ali can you confirm if what @dsuponitskiy-duality suggested addressed the problem?

---

<div class="post-metadata">

**Author:** ![Poojitha](https://avatars.discourse-cdn.com/v4/letter/p/779978/32.png) [@Poojitha](https://openfhe.discourse.group/u/Poojitha)\
**Post date:** [October 13, 2023, 9:33pm UTC](https://openfhe.discourse.group/t/output-is-not-generated-when-executing-simple-integers-cpp/810/17 "2023-10-13T21:33:12Z")

</div>

Hi @dsuponitskiy-duality,

Suggested solution worked for me. Thank you for helping!!

---

<div class="post-metadata">

**Author:** ![dsuponitskiy-duality](https://avatars.discourse-cdn.com/v4/letter/d/c68b51/32.png) [@dsuponitskiy-duality](https://openfhe.discourse.group/u/dsuponitskiy-duality)\
**Post date:** [October 13, 2023, 10:14pm UTC](https://openfhe.discourse.group/t/output-is-not-generated-when-executing-simple-integers-cpp/810/18 "2023-10-13T22:14:18Z")

</div>

i am glad to hear this

---

<div class="post-metadata">

**Author:** ![s\_ali](https://avatars.discourse-cdn.com/v4/letter/s/c2a13f/32.png) [@s\_ali](https://openfhe.discourse.group/u/s_ali)\
**Post date:** [October 16, 2023, 2:55pm UTC](https://openfhe.discourse.group/t/output-is-not-generated-when-executing-simple-integers-cpp/810/19 "2023-10-16T14:55:12Z")

</div>

Hi @dsuponitskiy-duality,

Thanks! The suggested solution works.
