How to debug a single .cpp file in Visual Studio?

Is there a way to debug a single file in Visual Studio .NET? I'm still noob with C ++, but I want to start learning how to enjoy the debugger, and at the moment I'm writing very small files.

It seems that there is only one source file, it will not allow me to debug, but at the moment when I add another, I can. I am using VS.net 2008.

+3
source share
7 answers

He does not want another source file, he needs a project file.

Visual Studio , , . , , boost, - .

: File->New->Project... win32. Application Settings " " "".

, / , ; , .sln, .cpp F5.

+9

, cpp, ? cpp, , ?

cpp,

int main()
{
}

( argv/argc args, ).

+1

, , . Bloodshed Dev++ ++. Visual Studio.

+1

Visaul ++ VS.net 2008 cpp, .

, cpp, , VS.Net 2008 .

0

:

  • , .
  • Visual Studio.
  • F5 ( dll , exe DLL ).
  • Profit!:)

, , , , , - , dll . exe, .

, , ( ) Debug.

0

, . , . , File- > New.

0

, , , - . ++- (blah.cpp):

int main ()
{
    for (int i = 0; i < 100; i++)
        printf ("Hello World ... etc \n");
}

( cmd.exe):

vcvars32

(Zi , blah.pdp ):

cl /Zi blah.cpp

blah.exe, . blah.exe, VS2008 blah.exe . blah.cpp IDE (F5), (F9) (F10, F11).

0

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


All Articles