RTKConsortium / RTK

Reconstruction Toolkit
Apache License 2.0
241 stars 142 forks source link

Unable to debug hxx files and h files #599

Closed xem123 closed 3 months ago

xem123 commented 3 months ago

I recompiled ITK and RTK using the following configuration parameters, and I want 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 image

xem123 commented 3 months ago

I encountered these errors when compiling ITK and RTK, but I ignored them and did not solve the issues. Is it related to the error that I cannot access the hxx and h files? Is it necessary to solve it? How can I solve it? image

SimonRit commented 3 months ago

Is the CMAKE_BUILD_TYPE option Debug? This is not a code issue and you should probably get some advice on discourse.itk.org.

xem123 commented 3 months ago

Is the CMAKE_BUILD_TYPE option Debug? This is not a code issue and you should probably get some advice on discourse.itk.org. I didn't choose debug, I chose release. Is it because I made the wrong choice that caused this? image

SimonRit commented 3 months ago

So Release will not allow you to debug indeed, this is the problem. Compile ITK and RTK with Debug or RelWithDebInfo to be able to use step-by-step debugging.

xem123 commented 3 months ago

Thanks! When I compiled ITK, I checked the FFTW related options as shown in Figure 1, but during the build process, I encountered many errors related to FFTW as shown in Figure 2. What is the reason for this? Do I need to configure the FFTW path separately in the environment variables, or should I configure the FFTW related libraries in the all_build properties? 1716342366740_92F9B542-FD3E-4354-95FC-DBED9C27C26F 1716342352851_D54B1532-7A16-44dd-8E97-386775D44E96

xem123 commented 3 months ago

Thank you for your reply!I compiled the FFTW library separately and then combined it with ITK for compilation. The Build and install processes were completed smoothly, and the errors I encountered above were resolved. 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 now have 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 this? 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? image image image image image

SimonRit commented 3 months ago

Can you please stop duplicating your posts? See https://github.com/InsightSoftwareConsortium/ITK/issues/4684#issuecomment-2128387948

xem123 commented 3 months ago

Sorry to bother you, because I'm not sure if this is a problem related to ITK or RTK I am sorry