C ++ win32 console application profile with Visual Studio 2012

I have a simple (not so simple) win32 console application in C ++. I would like to profile this application, but when I try:

DEBUG > Start Performance Analysis 

An error occurred: "No launchable projects are available for profiling" .
Please note that the project compiles and works fine. This means that this does not work.

How can i decide? I am on Windows 8 with Visual Studio Ultimate 2012

Please note that I choose a simple one for this project:

 File > New Project > Win32 > Win32 Console Application (C++) 

I would like to get something like xcode does .

A simple list for each function or method is a cumulative usage time.

This is a mistake when I try to "Start Performance Analysis"

enter image description here

Note

I tried both release mode and debug mode with both x64 and Win32

enter image description here

Note2

In this project, I created two custom property sheets (for including the right opencv libraries)

 - OpenCV-Release - OpenCV-Debug 

9wPki.png

Note3

enter image description here

+4
source share
1 answer

Open project properties. > Configration Manager> Active Solution Platform> select Create> and follow my screenshot. After that, your performance analysis will begin.

The project is not recognized because you configured it using x64. (As you can see from your first screenshot under Note )

Win32

Since your project is created in 64-bit operating systems, you need to manually associate the project with win32 sys, so the profiler recognizes the project as a win32 project.

http://en.wikipedia.org/wiki/Windows_API

I will leave it here, as it may be useful for some users.

Saving projects in Visual Studio should be done methodically and sequentially.

If a project is created and saved in a folder (for example), folder A on drive C, then the folders are rearranged, and then the project is in folder A, but folder A was transferred to drive D (or any changes). Visual Studio cannot find the project.

Be sure to check that all of your files for this project are in the correct folders. You need to open a subfolder and make sure that all files for your project are present.

Please see my screenshots. It doesn't matter why my folders are arranged the way they are, suffice it to say that it was easier for me to store them with program files on drive C.

Note that the file in the first vspx screen extension is a visual studio performance report.

Visual Studio Project Folder

Visual Studio Subdirectory

This may or may not answer your question. Please advise if you need further assistance.

Short cut

VS version

Long steps - which give you more options

VS debug menu VS Configuration button VS Configuraion Manager Try this (this is the same answer to both links):

 <ProjectConfiguration Include="Release|Win32"> <Configuration>Release</Configuration> <Platform>Win32</Platform> </ProjectConfiguration> 

http://social.msdn.microsoft.com/Forums/en-US/vsdebug/thread/56dcdb2a-5e30-4015-bc14-244f99f07b8b

Profiling with CMake, C ++, and Visual Studio 2012

And this link also.

Add the files to a directory outside the project, and then refer to these directories in the "Additional inclusion directories" in the properties β†’ Configuration Properties β†’ C / C ++ β†’ General.

VC ++ Visual Studio added .hpp files to a subdirectory, but get "Error: cannot open source file ..."

You can run the performance wizard on the Analysis tab.

This is a known bug in VS.

Without seeing your computer, it’s hard to understand what else I can offer. I know that it is important to go through all the suggested steps to deal with the problem. If I find anything else, I'll let you know.

Please note that my project is a downloaded sample.

0
source

Source: https://habr.com/ru/post/1484101/


All Articles