新建时选files->c++ sourcefile

解决方案 »

  1.   

    建立一个空的非MFC工程,然后把要调试的cpp文件添加进来
      

  2.   

    选Text文件,存为.cpp,即可调试
      

  3.   

    点左上角的"NEW Text File"图标。
    保存为 *.cpp 不就行了
      

  4.   

    多谢二位
    那karma(无为兄弟
    如何产生一个console应用程序呢?
    是新建时选 projects->Win32 Console Application  是吗?
      

  5.   

    控制台应用程序跟MFC一样复杂
    最常用的方式是files->c++ sourcefile ,编译的时候创建一个工程就行了
      

  6.   

    各位兄弟,你们看看自己是否都被加了5分??(对不起,回答的人太多,每个人都得有点吗)
    我准备再给各位加更多的分
    请各位在给我回答个问题:
    我的步骤:new projects->Win32 Console Application -> A "Hello ,world !" application  工程名为test3
    此时,调试原程序test3.cpp  原代码如下:
    // test3.cpp : Defines the entry point for the console application.
    //#include "stdafx.h"int main(int argc, char* argv[])
    {
    printf("Hello World!\n");
    return 0;
    }结果抱错:
    --------------------Configuration: test3 - Win32 Debug--------------------
    Compiling...
    test3.cpp
    d:\program files\microsoft visual studio\myprojects\test3\test3.cpp(4) : fatal error C1083: Cannot open precompiled header file: 'Debug/test3.pch': No such file or directory
    Error executing cl.exe.test3.obj - 1 error(s), 0 warning(s)
    这是怎么回事,请各位详细说之,谢谢!!