#include <windows.h>
#include <tchar.h>
int WINAPI _tWinMain( HINSTANCE hInstance,HINSTANCE hPrewInstance,LPTSTR lpCmdLine,int nShowCmd)
{
MessageBoxW(NULL,L"Hello world!",L"Title",MB_OK);
return 0;}
Compiling...
dsfk.cpp
Linking...
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/dsfk.exe : fatal error LNK1120: 1 unresolved externals
执行 link.exe 时出错.dsfk.exe - 1 error(s), 0 warning(s)

解决方案 »

  1.   

    你这是控制台项目
    改成WIN32项目或者改成
    int _tmain(int argc, _TCHAR* argv[])
    {
    MessageBoxW(NULL,L"Hello world!",L"Title",MB_OK);
    return 0;
    }
      

  2.   

    你这是控制台项目吧,要改成win32 application
      

  3.   

    打开 。VC 
    FILE->NEW 选择win32 application 就行了。
      

  4.   

    工程建错了,修改工程属性link下的/subsystem:console -> /subsystem:windows,或者除掉不写
      

  5.   

    #include <windows.h>
    #include <tchar.h>//最好在工程属性里改,加上下面这句也是可以的.
    #pragma comment(linker, "/subsystem:windows")