'VS profiler, source information not available

I'm trying to use visual studio performance profiler for the first time and I'm interested in a specific function of mine which is successfully detected by the profiler. However, when I click on it I get "Source information is not available" .

How do I fix this?

enter image description here

All external functions from libraries are visible. Any function that is in "lab.cpp" won't show. I mean, not even "main" is available. This is the only file I edit, I write all my code in there:

enter image description here

Solution 1:[1]

In case someone else has the same problem, I solved it by setting the "Debug Information Format" which was previously empty in my cpp file's(the file containing the functions) General Properties:

enter image description here

Solution 2:[2]

The accepted answer for this question says that you just need to add a Debug Information Format in Release, for me doing this was not enough. I needed to add a Debug Information Format and turn on "Generate Debug Info" in Release.

I recommend creating a new configuration called "Release with Debug Info" using the Configuration Manager (which you can get to from the Configuration combobox/dropdown), copying the settings from "Release" into "Release with Debug Info" and then making the two changes documented in this answer in the new configuration.


This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 John Katsantas
Solution 2 jwezorek