本文介紹了錯誤 LNK2019:未解析的外部符號 _WinMain@16 在函數 ___tmainCRTStartup 中引用的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!
問題描述
當我運行下面的簡單代碼時,我有兩個錯誤如下:
While I am running the simple code as below I have two errors as following:
#include <iostream>
#include <string>
using namespace::std;
template <class Type>
class Stack
{
public:
Stack (int max):stack(new Type[max]), top(-1), maxsize(max){}
~Stack (void) {delete []stack;}
void Push (Type &val);
void Pop (void) {if (top>=0) --top;}
Type& Top (void) {return stack[top];}
//friend ostream& operator<< (ostream&, Stack&);
private:
Type *stack;
int top;
const int maxSize;
};
template <class Type>
void Stack <Type>:: Push (Type &val)
{
if (top+1<maxsize)
stack [++top]=val;
}
錯誤:
MSVCRTD.lib(crtexew.obj) : error LNK2019: 未解析的外部符號 _WinMain@16
引用在函數 ___tmainCRTStartup
MSVCRTD.lib(crtexew.obj) : error LNK2019: unresolved external symbol
_WinMain@16
referenced in function___tmainCRTStartup
我該怎么辦?
推薦答案
那是鏈接器問題.
嘗試更改屬性 -> 鏈接器 -> 系統 -> 子系統(在 Visual Studio 中).
Try to change Properties -> Linker -> System -> SubSystem (in Visual Studio).
從 Windows (/SUBSYSTEM:WINDOWS) 到 控制臺 (/SUBSYSTEM:CONSOLE)
這個一個幫了我
這篇關于錯誤 LNK2019:未解析的外部符號 _WinMain@16 在函數 ___tmainCRTStartup 中引用的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!
【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!