![](/img/trans.png)
[英]visual studio 2013 error LNK1120: 1 unresolved externals and error LNK2019: unresolved external symbol
[英]error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup and Error 2 error LNK1120: 1 unresolved externals
嘗試編譯代碼時出現兩個錯誤。 我已經定義了win32 consile應用程序。 我什至尚未開始編碼。 我的配置如下-鏈接器-子系統-控制台; 鏈接器-高級-入口點-空白。
error LNK2019: unresolved external symbol _main referenced in function
___tmainCRTStartup
Error 2 error LNK1120: 1 unresolved externals
我不知道發生了什么 在一切正常之前,但從今天開始,情況並非如此。 您知道我該如何解決嗎?
到目前為止,我的代碼是
// ConsoleApplication1.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include "tbb/blocked_range.h"
#include "tbb/tbb.h"
#include <stdio.h>
#include <math.h>
#include <iostream>
#include "tbb/parallel_for.h"
#include <sstream>
#include <tbb/task_scheduler_init.h>
using namespace std;
#define PI 3.14159265
using namespace tbb;
// Sequential Execution
class Sequential
{
double * m;
double *n;
public:
Sequential(double n[], double m[]): n(n), m(m){}
void Partition()
{
}
int main(int argc, char** argv)
{
//double a = 5;
//double b = 4;
//Sequential g = Sequential(a,b);
return 0;
}
};
謝謝
main
功能必須在全局名稱空間中。 C ++不是C#/ Java,其中所有功能都必須在類內部。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.