# After compiling the ITK and RTK libraries, cannot use breakpoints to enter the corresponding source code in debug mode

**URL:** <https://discourse.itk.org/t/after-compiling-the-itk-and-rtk-libraries-cannot-use-breakpoints-to-enter-the-corresponding-source-code-in-debug-mode/6660>\
**Category:** Community\
**Tags:** itk, visual-studio, rtk\
**Created:** [May 24, 2024, 9:47am UTC](https://discourse.itk.org/t/after-compiling-the-itk-and-rtk-libraries-cannot-use-breakpoints-to-enter-the-corresponding-source-code-in-debug-mode/6660 "2024-05-24T09:47:55Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![xem123](https://discourse.itk.org/user_avatar/discourse.itk.org/xem123/32/4080_2.png) [@xem123](https://discourse.itk.org/u/xem123)\
**Post date:** [May 24, 2024, 9:47am UTC](https://discourse.itk.org/t/after-compiling-the-itk-and-rtk-libraries-cannot-use-breakpoints-to-enter-the-corresponding-source-code-in-debug-mode/6660/1 "2024-05-24T09:47:55Z")

</div>

Hello everyone,I have a question to ask.  
I compiled the FFTW library separately before compiling it with ITK. Then, the Build and install processes were completed smoothly without any errors. Then, I placed my project code into the ITK solution in order to access the RTK source code during runtime, as shown in Figure 1. However, I encountered a problem. I cannot use breakpoints to access the source code of rtkFFTProjectionsConvolutionImageFilter.hxx. I added cout to this hxx source code and recompiled it. The cout in this hxx can print to the console normally as shown in Figure 2, but I still cannot access the hxx source code as shown in Figure 3 and Figure 4. And I hope to output the image after padding, so I added some code to save the image in the source code as shown in Figure 5. However, after normal operation, the image I specified was not saved. Why is that?  
The ability to print cout to the console indicates that the function in hxx is running, but why can’t the breakpoint be entered? Why doesn’t the code to save the image execute?  
Thanks!  
 ![image](https://discourse.itk.org/uploads/default/original/2X/c/c0eec7c6ee38aeb3beda28d5be27ab07135fb53d.png)

 ![image](https://discourse.itk.org/uploads/default/original/2X/8/85a6bd8fd36b8feb00a1c9898f78d0388e381af3.png)  
 ![image](https://discourse.itk.org/uploads/default/original/2X/0/035666fca689e42e257b2cc231c9977a4d705450.png)  
 ![image](https://discourse.itk.org/uploads/default/original/2X/a/ae594257c5475681eed71b4bd0981672a858b2fe.png)  
 ![image](https://discourse.itk.org/uploads/default/original/2X/0/09f45f191bd1dc096e74f4dfd8f480ad8e9aec89.png)

---

<div class="post-metadata">

**Author:** ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)\
**Post date:** [May 24, 2024, 2:28pm UTC](https://discourse.itk.org/t/after-compiling-the-itk-and-rtk-libraries-cannot-use-breakpoints-to-enter-the-corresponding-source-code-in-debug-mode/6660/2 "2024-05-24T14:28:43Z")

</div>

Maybe related to some weirdness in the build system, e.g. copying source or header files around the filesystem (such as installing them). Perhaps @simon.rit has a suggestion?

---

<div class="post-metadata">

**Author:** ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)\
**Post date:** [May 24, 2024, 2:31pm UTC](https://discourse.itk.org/t/after-compiling-the-itk-and-rtk-libraries-cannot-use-breakpoints-to-enter-the-corresponding-source-code-in-debug-mode/6660/3 "2024-05-24T14:31:25Z")

</div>

I now see that this was cross-posted from:

> <https://github.com/InsightSoftwareConsortium/ITK/issues/4684#issuecomment-2128387948>
>
> I recompiled ITK and RTK using the following configuration parameters, and I wan…t to use the debug mode to debug the code. Currently, I can normally enter the cxx files related to RTK during debugging（picture2）, but I cannot debug the related .h files and .hxx files, and I cannot enter the source code of the .h files and .hxx files（picture1）. What is the reason? Is there something wrong with my configuration? Or did I not check a certain option when using cmak for compilation?
> I am in hurry,thanks!
> cmake=3.24
> visual studio 2022
> ITK=5.3.0
> moudle\_RTK=on
> Module\_RTK\_GIT\_TAG=3f0aa3145d03b8cbc7c6d44bbfd03728b531909c
> fftw-3.3.5-dll64
> !\[image\](https://github.com/InsightSoftwareConsortium/ITK/assets/52185519/c726c1b2-cbfe-4e53-a756-6a044aff9b0f)
> !\[image\](https://github.com/InsightSoftwareConsortium/ITK/assets/52185519/dbf20102-dc75-4197-aaa7-facee7c98dc0)

---

<div class="post-metadata">

**Author:** ![simon.rit](https://discourse.itk.org/letter_avatar_proxy/v4/letter/s/f08c70/32.png) [@simon.rit](https://discourse.itk.org/u/simon.rit)\
**Post date:** [May 24, 2024, 2:36pm UTC](https://discourse.itk.org/t/after-compiling-the-itk-and-rtk-libraries-cannot-use-breakpoints-to-enter-the-corresponding-source-code-in-debug-mode/6660/4 "2024-05-24T14:36:04Z")

</div>

No sorry, I am not familiar with MSVC. You’re might be right, it may be the wrong file.

---

<div class="post-metadata">

**Author:** ![lassoan](https://discourse.itk.org/user_avatar/discourse.itk.org/lassoan/32/27_2.png) [@lassoan](https://discourse.itk.org/u/lassoan)\
**Post date:** [May 25, 2024, 5:04pm UTC](https://discourse.itk.org/t/after-compiling-the-itk-and-rtk-libraries-cannot-use-breakpoints-to-enter-the-corresponding-source-code-in-debug-mode/6660/5 "2024-05-25T17:04:05Z")

</div>

If you hover over the breakpoint with the exclamation mark `(!)` then you may get more information. The problem most commonly is that the .pdb file is not up-to-date (the source code is modified and the .dll, .exe, and .pdb files are not updated; rebuild to fix). It may also happen that no symbol is found for the file at all, for example because the pdb file is not found (if you move the .exe or .dll files after build, then make sure you move the .pdb files along with them).

---

<div class="post-metadata">

**Author:** ![xem123](https://discourse.itk.org/user_avatar/discourse.itk.org/xem123/32/4080_2.png) [@xem123](https://discourse.itk.org/u/xem123)\
**Post date:** [May 27, 2024, 10:02am UTC](https://discourse.itk.org/t/after-compiling-the-itk-and-rtk-libraries-cannot-use-breakpoints-to-enter-the-corresponding-source-code-in-debug-mode/6660/6 "2024-05-27T10:02:15Z")

</div>

Thank you all for your help！  
I have an other question.After compiling the ITK and RTK libraries, why can some.hxx files be reached by breakpoint in debug mode, but some others cannot? For example, in the following two images, rtkBoellaardScatterCorrectionImageFilter.hxx can be reached by breakpoint in source code in debug mode, but rtkFFTProjectionsConvolutionImageFilter.hxx cannot be reached by breakpoint in source code in debug mode.

 ![image](https://discourse.itk.org/uploads/default/original/2X/0/04a22c33ea2e3d4824cf17b515f450b377b2c6ad.png)  
 ![image](https://discourse.itk.org/uploads/default/original/2X/b/b20ba133a67564539542247a1ca4c7ef4aa60e7c.png)  
 ![image](https://discourse.itk.org/uploads/default/original/2X/4/4038c4c4657dcc3207feb54357797c3f8266e18e.png)  
 ![image](https://discourse.itk.org/uploads/default/original/2X/9/993600b7c4b4d92a35c6d06bf5881a327b67421f.png)

---

<div class="post-metadata">

**Author:** ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)\
**Post date:** [May 27, 2024, 1:00pm UTC](https://discourse.itk.org/t/after-compiling-the-itk-and-rtk-libraries-cannot-use-breakpoints-to-enter-the-corresponding-source-code-in-debug-mode/6660/7 "2024-05-27T13:00:48Z")

</div>

The usual reason for a file not to be reachable is when it is not part of the executable you are trying to debug. Another reason might be that it is part of a DLL which has not been loaded yet. The third reason might be that it is CUDA/GPU code, and Visual Studio does not support it well.

---

<div class="post-metadata">

**Author:** ![xem123](https://discourse.itk.org/user_avatar/discourse.itk.org/xem123/32/4080_2.png) [@xem123](https://discourse.itk.org/u/xem123)\
**Post date:** [May 28, 2024, 2:23am UTC](https://discourse.itk.org/t/after-compiling-the-itk-and-rtk-libraries-cannot-use-breakpoints-to-enter-the-corresponding-source-code-in-debug-mode/6660/8 "2024-05-28T02:23:31Z")

</div>

Thank you for appreciate！The thrid reason helps me.

---

<div class="post-metadata">

**Author:** ![lassoan](https://discourse.itk.org/user_avatar/discourse.itk.org/lassoan/32/27_2.png) [@lassoan](https://discourse.itk.org/u/lassoan)\
**Post date:** [June 2, 2024, 2:46am UTC](https://discourse.itk.org/t/after-compiling-the-itk-and-rtk-libraries-cannot-use-breakpoints-to-enter-the-corresponding-source-code-in-debug-mode/6660/9 "2024-06-02T02:46:14Z")

</div>

The tooltip in your screenshot explains why the breakpoint is ignored.
