# Limesuiteng example code help

**URL:** <https://discourse.myriadrf.org/t/limesuiteng-example-code-help/8552>\
**Category:** General Discussion\
**Created:** [3 November 2024 07:08 UTC](https://discourse.myriadrf.org/t/limesuiteng-example-code-help/8552 "2024-11-03T07:08:02Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![pixelated](https://avatars.discourse-cdn.com/v4/letter/p/34f0e0/32.png) [@pixelated](https://discourse.myriadrf.org/u/pixelated)\
**Post date:** [3 November 2024 07:08 UTC](https://discourse.myriadrf.org/t/limesuiteng-example-code-help/8552/1 "2024-11-03T07:08:02Z")

</div>

I’m very new in developing in C++ and I can’t quite seem to compile and run the example codes that was provided in the limesuiteng repo. Limesuiteng was built from source, so shouldn’t the included files to link the library work?

For reference I’m using VSCode and Pop!\_OS (an Ubuntu based distro) to try to get this running.

Any help would be appreciated.

---

<div class="post-metadata">

**Author:** ![ricardas](https://yyz2.discourse-cdn.com/flex034/user_avatar/discourse.myriadrf.org/ricardas/32/86_2.png) [@ricardas](https://discourse.myriadrf.org/u/ricardas)\
**Post date:** [3 November 2024 07:45 UTC](https://discourse.myriadrf.org/t/limesuiteng-example-code-help/8552/2 "2024-11-03T07:45:54Z")

</div>

Are you trying to build the examples as your own separate project? What errors you are getting?

---

<div class="post-metadata">

**Author:** ![pixelated](https://avatars.discourse-cdn.com/v4/letter/p/34f0e0/32.png) [@pixelated](https://discourse.myriadrf.org/u/pixelated)\
**Post date:** [3 November 2024 09:17 UTC](https://discourse.myriadrf.org/t/limesuiteng-example-code-help/8552/3 "2024-11-03T09:17:19Z")

</div>

Here’s `dualRXTX.cpp` unmodified inside `limesuiteng_test` directory when I run `g++ dualRXTX.cpp -o dualRXTX` in the terminal:

 ![Screenshot from 2024-11-03 01-18-36](https://canada1.discourse-cdn.com/flex034/uploads/myriadrf/original/2X/b/b9ac4bafe76129dcfa6deb0948d68bc3a843d2ca.png)

---

<div class="post-metadata">

**Author:** ![ricardas](https://yyz2.discourse-cdn.com/flex034/user_avatar/discourse.myriadrf.org/ricardas/32/86_2.png) [@ricardas](https://discourse.myriadrf.org/u/ricardas)\
**Post date:** [3 November 2024 09:33 UTC](https://discourse.myriadrf.org/t/limesuiteng-example-code-help/8552/4 "2024-11-03T09:33:59Z")

</div>

C++ builds are done in two steps. Compilation and linking.  
Your command does only the compilation step, so after it’s done it cannot find those functions, because they are located in external library. You need to explicitly specify to your compiler where to find those functions/which libraries should be linked to your application.  
In this case you need to add `-llimesuiteng` to your command.

---

<div class="post-metadata">

**Author:** ![pixelated](https://avatars.discourse-cdn.com/v4/letter/p/34f0e0/32.png) [@pixelated](https://discourse.myriadrf.org/u/pixelated)\
**Post date:** [3 November 2024 09:56 UTC](https://discourse.myriadrf.org/t/limesuiteng-example-code-help/8552/5 "2024-11-03T09:56:38Z")

</div>

I was able to run the command but encountered this after:

 ![Screenshot from 2024-11-03 01-52-55](https://canada1.discourse-cdn.com/flex034/uploads/myriadrf/original/2X/5/541fc7731167d64d8a99d6b55756669224c4bca7.png)

I was able to find that specific file, but what am I supposed to do with it?

---

<div class="post-metadata">

**Author:** ![ricardas](https://yyz2.discourse-cdn.com/flex034/user_avatar/discourse.myriadrf.org/ricardas/32/86_2.png) [@ricardas](https://discourse.myriadrf.org/u/ricardas)\
**Post date:** [3 November 2024 11:09 UTC](https://discourse.myriadrf.org/t/limesuiteng-example-code-help/8552/6 "2024-11-03T11:09:13Z")

</div>

when linux runs the application, it needs to know where to search for the shared libraries. The default search directories are listed in `LD_LIBRARY_PATH` environment variable, so if it doesn’t contain /usr/local/lib, then it won’t find the library. The other solution is to define the library search path during compilation with `-Wl,-rpath=`  
Or you might just simply need to update your system installed libraries cache by `sudo ldconfig`

These issues you are having are not related to LimeSuiteNG, they are generic C++ build process and host system configuration issue. I suggest using CMake to manage your C++ project, it will handle most of these issues by giving the compiler all the necessary flags and paths.

---

<div class="post-metadata">

**Author:** ![pixelated](https://avatars.discourse-cdn.com/v4/letter/p/34f0e0/32.png) [@pixelated](https://discourse.myriadrf.org/u/pixelated)\
**Post date:** [4 November 2024 17:54 UTC](https://discourse.myriadrf.org/t/limesuiteng-example-code-help/8552/7 "2024-11-04T17:54:12Z")

</div>

Thanks, everything is working now! I can’t believe I missed the `sudo ldconfig` command and you’ve saved me from a lot of difficulties.

It would be really helpful if you included the example compile command in the documentations or as a comment inside the examples to help newbies like me (:

Thanks again!
