# debug - step-into a library function

**URL:** <https://discourse.cmake.org/t/debug-step-into-a-library-function/8193>\
**Category:** Code\
**Tags:** os:linux\
**Created:** [May 24, 2023, 9:55am UTC](https://discourse.cmake.org/t/debug-step-into-a-library-function/8193 "2023-05-24T09:55:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ygratz](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/y/d26b3c/32.png) [@ygratz](https://discourse.cmake.org/u/ygratz)\
**Post date:** [May 24, 2023, 9:55am UTC](https://discourse.cmake.org/t/debug-step-into-a-library-function/8193/1 "2023-05-24T09:55:23Z")

</div>

Hi,  
I downloaded an open-source project (c++ project).  
It includes a library which has its own CMakeLists.txt.  
It also includes an example, with a main() and its own CMakeLists.txt. It includes:  
find\_package()  
target\_link\_libraries()  
for the library.  
It runs ok and I can debug the example.  
However, when I try to step-into a library function - it doesn’t.  
Can you please advise on what might be missing?  
Thank you

---

<div class="post-metadata">

**Author:** ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)\
**Post date:** [May 29, 2023, 12:50pm UTC](https://discourse.cmake.org/t/debug-step-into-a-library-function/8193/2 "2023-05-29T12:50:49Z")

</div>

The library function may be optimized away?

More details would be helpful though.

---

<div class="post-metadata">

**Author:** ![assignUser](https://discourse.cmake.org/user_avatar/discourse.cmake.org/assignuser/32/3367_2.png) [@assignUser](https://discourse.cmake.org/u/assignUser)\
**Post date:** [May 31, 2023, 5:53pm UTC](https://discourse.cmake.org/t/debug-step-into-a-library-function/8193/3 "2023-05-31T17:53:11Z")

</div>

As it uses `find_package` you have built the library before the example, did you build it as debug? The library might default to Relase?
