#include "afx.h:
#include "stdio.h"
#include "iostream.h"main()
{
.......
}运行第一次OK,
运行第二次就出了三个什么未解决的符号等什么?

解决方案 »

  1.   

    程序就这样也出错
    main()
    { int x=1,y=1;
      cout<<"fdsa"<<x<<y;
    }
    这样也出错把#include "afx.h"删了就不会了
      

  2.   

    #include "afx.h"这句放到最后,即:#include "stdio.h"
    #include "iostream.h"
    #include "afx.h"就好了吧!
      

  3.   

    nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __endthreadex
    nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __beginthreadex
    Debug/phone.exe : fatal error LNK1120: 2 unresolved externals
    老是出现上面这几条错误,请高手救急
      

  4.   

    try
    cl /MD your.cppfor example, testafx.cpp:#include <afx.h>
    #include <stdio.h>
    #include <iostream.h>int main()
    {
     printf("C-Style:hello world!\n");
     cout<<"C++ Style:hello world" << endl;
     ::MessageBox(NULL,"Hello world!","Windows Style",MB_OK);
     return 0;
    }E:\>vcvars32
    E:\>cl /MD testafx.cpp
      

  5.   

    不好意思,我前面发的帖子忘了说楼上这条了,所以你需要结合使用,即:在Visual Studio的 Project/Setting/ c/c++ / code generation中设置debug multithread(对应Debug版本)或者multithread(对应Release版本)。然后顺序按照上面说的即可。
      

  6.   

    我用VC++写的,在"工程"中的"设置"是灰色的,不可以设是DEBUG还是RELEASE
    还有写完为什么要在DOS下写那句vcvars32和cl /md testafx.cpp,有什么用?
    还请大师指点.
      

  7.   

    my example assumes you are doing command-line compilation. vcvars32.bat sets up all the environment variables needed for visual c++ compiler (cl.exe). /MD is a compiler option