# Issue in building Fesapi-example-code for C++

**URL:** <https://discourse.f2i-consulting.com/t/issue-in-building-fesapi-example-code-for-c/193>\
**Category:** FESAPI\
**Created:** [November 10, 2021, 5:39am UTC](https://discourse.f2i-consulting.com/t/issue-in-building-fesapi-example-code-for-c/193 "2021-11-10T05:39:46Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jeenal1612](https://discourse.f2i-consulting.com/user_avatar/discourse.f2i-consulting.com/jeenal1612/32/56_2.png) [@Jeenal1612](https://discourse.f2i-consulting.com/u/Jeenal1612)\
**Post date:** [November 10, 2021, 5:39am UTC](https://discourse.f2i-consulting.com/t/issue-in-building-fesapi-example-code-for-c/193/1 "2021-11-10T05:39:46Z")

</div>

Hi,

I’m trying to build example code given in:

> **[fesapi/example at master · F2I-Consulting/fesapi](https://github.com/F2I-Consulting/fesapi/tree/master/example)**
>
> master/example

For that I’m trying to generate makefile using CMAKE utility.  
But in the generation process I’m getting below errors in cmake.txt source file.  
Please find the screenshot below.

x-special/nautilus-clipboard  
copy  
file:///home/ubtadmin/Pictures/Screenshot%20from%202021-11-08%2017-00-10.png

Can you please instruct me for the process I’m following to resolve it?

Thanks,  
Jinal.

---

<div class="post-metadata">

**Author:** ![philippeVerney](https://discourse.f2i-consulting.com/user_avatar/discourse.f2i-consulting.com/philippeverney/32/29_2.png) [@philippeVerney](https://discourse.f2i-consulting.com/u/philippeVerney)\
**Post date:** [November 10, 2021, 8:39am UTC](https://discourse.f2i-consulting.com/t/issue-in-building-fesapi-example-code-for-c/193/2 "2021-11-10T08:39:37Z")

</div>

Hi Jeenal,

There is no screenshot.

---

<div class="post-metadata">

**Author:** ![Jeenal1612](https://discourse.f2i-consulting.com/user_avatar/discourse.f2i-consulting.com/jeenal1612/32/56_2.png) [@Jeenal1612](https://discourse.f2i-consulting.com/u/Jeenal1612)\
**Post date:** [November 11, 2021, 5:19am UTC](https://discourse.f2i-consulting.com/t/issue-in-building-fesapi-example-code-for-c/193/3 "2021-11-11T05:19:56Z")

</div>

Hi Philippe,

PFA.

 ![CMAKE_example](https://discourse.f2i-consulting.com/uploads/default/original/1X/2bd162d0d0858ba70058755d62f76925bb201847.png)

---

<div class="post-metadata">

**Author:** ![philippeVerney](https://discourse.f2i-consulting.com/user_avatar/discourse.f2i-consulting.com/philippeverney/32/29_2.png) [@philippeVerney](https://discourse.f2i-consulting.com/u/philippeVerney)\
**Post date:** [November 11, 2021, 3:31pm UTC](https://discourse.f2i-consulting.com/t/issue-in-building-fesapi-example-code-for-c/193/4 "2021-11-11T15:31:07Z")

</div>

It seems you try to build the example in a standalone way. This is not possible with this CMake File, you would need to create your own if you want to do that.  
If you want to build the example as delivered in Github, you need to follow the [documentation](https://github.com/F2I-Consulting/fesapi) and

> OPTIONALLY, you can build the tutorial example by setting WITH\_EXAMPLE cmake variable to ON"

directly on the main (i.e. FESAPI root) CMake File.

---

<div class="post-metadata">

**Author:** ![Jeenal1612](https://discourse.f2i-consulting.com/user_avatar/discourse.f2i-consulting.com/jeenal1612/32/56_2.png) [@Jeenal1612](https://discourse.f2i-consulting.com/u/Jeenal1612)\
**Post date:** [November 15, 2021, 4:35am UTC](https://discourse.f2i-consulting.com/t/issue-in-building-fesapi-example-code-for-c/193/5 "2021-11-15T04:35:46Z")

</div>

Thanks Philippe,

I’m able to generate makefile for example code.  
Now, how to generate .exe file from example code and Fesapi root code?

Please let me know the process.

---

<div class="post-metadata">

**Author:** ![philippeVerney](https://discourse.f2i-consulting.com/user_avatar/discourse.f2i-consulting.com/philippeverney/32/29_2.png) [@philippeVerney](https://discourse.f2i-consulting.com/u/philippeVerney)\
**Post date:** [November 15, 2021, 8:35am UTC](https://discourse.f2i-consulting.com/t/issue-in-building-fesapi-example-code-for-c/193/6 "2021-11-15T08:35:30Z")

</div>

Hi Jeenal,  
This forum focuses only on FESAPI, not on C++ build. I think your question is out of scope. The community may answer to you but I would bet the opposite.  
Look to your C++ documentation (which mainly depends on your OS, your compiler) in order to find this answer or ask this kind of question on more general forum (such as stack overflow) or contract a C++ developer would be my recommendation.

As a start of answer, a makefile allows you to type “make” in a shell (same directory than the Makefile) in order to run the build.

---

<div class="post-metadata">

**Author:** ![Jeenal1612](https://discourse.f2i-consulting.com/user_avatar/discourse.f2i-consulting.com/jeenal1612/32/56_2.png) [@Jeenal1612](https://discourse.f2i-consulting.com/u/Jeenal1612)\
**Post date:** [November 17, 2021, 4:46am UTC](https://discourse.f2i-consulting.com/t/issue-in-building-fesapi-example-code-for-c/193/7 "2021-11-17T04:46:21Z")

</div>

Hi Philippe,

I’ve build the makefile as suggested and .so files are generated.  
Now can you please tell what can be the process after make build?

---

<div class="post-metadata">

**Author:** ![philippeVerney](https://discourse.f2i-consulting.com/user_avatar/discourse.f2i-consulting.com/philippeverney/32/29_2.png) [@philippeVerney](https://discourse.f2i-consulting.com/u/philippeVerney)\
**Post date:** [November 17, 2021, 8:51am UTC](https://discourse.f2i-consulting.com/t/issue-in-building-fesapi-example-code-for-c/193/8 "2021-11-17T08:51:53Z")

</div>

You should have an “example” executable which has been built next to your .so file if you have correctly configured your cmake build.  
Just execute it.

---

<div class="post-metadata">

**Author:** ![Jeenal1612](https://discourse.f2i-consulting.com/user_avatar/discourse.f2i-consulting.com/jeenal1612/32/56_2.png) [@Jeenal1612](https://discourse.f2i-consulting.com/u/Jeenal1612)\
**Post date:** [November 23, 2021, 7:12pm UTC](https://discourse.f2i-consulting.com/t/issue-in-building-fesapi-example-code-for-c/193/9 "2021-11-23T19:12:50Z")

</div>

@philippeVerney thanks for your quick response. I’m able to execute sample code now.

---

<div class="post-metadata">

**Author:** ![Jeenal1612](https://discourse.f2i-consulting.com/user_avatar/discourse.f2i-consulting.com/jeenal1612/32/56_2.png) [@Jeenal1612](https://discourse.f2i-consulting.com/u/Jeenal1612)\
**Post date:** [November 23, 2021, 7:29pm UTC](https://discourse.f2i-consulting.com/t/issue-in-building-fesapi-example-code-for-c/193/10 "2021-11-23T19:29:45Z")

</div>

I’ve few more questions relevant to Fesapi source & example code:

1. What is the purpose of this example code? And by executing, what is it printing in its output?

2. After Fesapi source build, it is generating .so (dynamic) libraries. Can we generate static library instead? If yes then how?

3. There’s one fetpapiServer as in link below  
[GitHub - F2I-Consulting/fetpapiServer](https://github.com/F2I-Consulting/fetpapiServer)  
Can this server be build like simulator?

---

<div class="post-metadata">

**Author:** ![philippeVerney](https://discourse.f2i-consulting.com/user_avatar/discourse.f2i-consulting.com/philippeverney/32/29_2.png) [@philippeVerney](https://discourse.f2i-consulting.com/u/philippeVerney)\
**Post date:** [November 24, 2021, 3:06pm UTC](https://discourse.f2i-consulting.com/t/issue-in-building-fesapi-example-code-for-c/193/11 "2021-11-24T15:06:43Z")

</div>

Hi Jeenal

1. This example creates a RESQML file (epc + h5) on disk with some very basic RESQML data, reads back this RESQML file and print some information about what has been read.

2. Please create another thread/post for another question. Nobody would be able to find the question/answer otherwise which would lead to a non productive answer…

3. Same answer than 2. And there is a dedicated forum about FETPAPI not to mix it with FESAPI : [FETPAPI - F2i-consulting](https://discourse.f2i-consulting.com/c/etp/7)

Finally, I am quite busy honoring contracts for this end of year. Don’t expect quick answer on my side. I hope you’ll get answers from the community in the mean time.
