在编译我的代码时,我收到此错误。
1>MSVCRTD.lib(crtexe.obj):错误 LNK2019:函数 ___tmainCRTStartup 中引用了未解析的外部符号 _main 1>C:\Users\Gabe Phelan\Documents\Visual Studio 2013\Projects\PA3 test\Debug\PA3 test.exe : fatal error LNK1120: 1 unresolved externals
#include <iostream>
#include <vector>
using namespace std;
class Heap{
private:
vector<int> heap;
int size;
public:
Heap(bool x);
};
#include "Header.h"
Heap::Heap(bool order){
int dummy = 0;
heap.push_back(dummy);
size = heap.size() - 1;
}
最佳答案
你必须有一个入口点,它是一个叫做 main 的函数。所以你需要这个,
int main(int argv, char* argc[])
{
//your code here
}
你不在这里声明类,而是你希望程序执行什么。
关于c++ - 错误 LNK2019 : unresolved external and LNK1120: 1 unresolved externals,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26921949/