一、无法解析的外部符号 _WinMain@16,该符号在函数 ___tmainCRTStartup 中被引用
这个错误我遇到过几次了,按照《Window核心编程》提供的方法——修改/SUBSYSTEM:CONSOLE或是SUBSYSTEM:WINDOWS——还是没有。确切地说,前阵子有用,后来发现没用了!
如代码:
#include <windows.h>
#include <stdlib.h>
//#include <tchar.h>
#include <strsafe.h>
//#include "../CreateDll/MyLib.h"
int WINAPI _tWinMain( HINSTANCE, HINSTANCE, PTSTR, int)
//int _tmain( int argc, TCHAR *argv[], TCHAR *envp[] )
//int _tmain()
{
int nLeft = 10, nRight = 25;
TCHAR sz[100];
/*
StringCchPrintf( sz, _countof(sz), TEXT("%d + %d = %d"), nLeft, nRight, Add( nLeft, nRigh