Click here to Skip to main content
12,620,909 members (32,441 online)
Rate this:
Please Sign up or sign in to vote.
See more: VS2008 Visual-Studio
Hello there :)
how can i solve this error:
fatal error LNK1561: entry point must be defined
and i need a grant visual studio 2008 professional edittion please :)
Posted 5-Apr-13 5:11am
Language? Application type?
Richard MacCutchan 5-Apr-13 10:18am
Difficult to tell why you get the Link error; you probably forgot to add a public main() function in your code. However, since you have not told us what language you are using that is just a guess. The last part of your question makes no sense; what do you mean by "grant"?
Manar aysar 5-Apr-13 10:51am
sorry for being late :)
im using vc++ ,,for my graduation project
when iam using this code
using namespace std;
int main()
int **a,**b,**c; // variables to store allocated memory
int a_r,a_c,b_r,b_c, nthreads, tid, chunk =10; //variables to input matrix
//size and variables to be used by OpenMP functions
double dif,st,et; //variable to calculate the time difference between the parallelization
int i,j,n,m; // variables to be used in for loops to
//generate matrices
cout<<"\nenter rows and columns for the matrix:";
cout<<"\nenter rows and columns for the mask :";
/* allocate memory for matrix one */
a=(int **) malloc(10*a_r);
for( i=0;i<a_c; i++)="" {="" a[i]="(int" *)="" malloc(10*a_c);="" }="" *="" allocate="" memory="" for="" matrix="" two="" b="(int" **)="" malloc(10*b_r);="" for(="" i="0;i<b_c;" b[i]="(int" malloc(10*b_c);="" sum="" c="(int" malloc(10*a_r);="" a_c;="" c[i]="(int" cout&lt;&lt;"enter="" the="" index="" of="" center="" mask="" :"&lt;&lt;endl;="" cin="">>n;

#pragma omp parallel num_threads(1) shared(a,b,c,nthreads,chunk) private(tid,i,j)
tid = omp_get_thread_num();
if (tid == 0)
nthreads = omp_get_num_threads();
cout<<"Starting matrix multiple example with "<<nthreads<<"threads";
st =omp_get_wtime();
//initializing first matrix
#pragma omp for schedule (static, chunk)
for(i=0;i<a_r; i++)="" {="" for(j="0;j<a_c;" j++)="" a[i][j]="i+j;" }="" initializing="" second="" matrix="" #pragma="" omp="" for="" schedule="" (static,="" chunk)="" for(i="0;i<b_r;" b[i][j]="i*j;" *initialize="" product="" *="" b_c;="" c[i][j]="0;" printf("thread="%d" did="" row="%d\n",tid,i);" if(i-1="">=0&&j-1>=0)

if(i+1<a_r&&j+1<a_c) c[i][j]="c[i][j]+a[i+1][j+1]*b[n+1][m+1];" if(i-1="">=0)

if(i+1<a_r) c[i][j]="c[i][j]+a[i+1][j]*b[n+1][m];" if(i+1<a_r&&j-1="">=0)

if(i-1>=0&&j+1<a_c) c[i][j]="c[i][j]+a[i-1][j+1]*b[n-1][m+1];" if(j-1="">=0)

if(j+1<a_c) c[i][j]="c[i][j]+a[i][j+1]*b[n][m+1];" }="" *****end="" of="" parallel="" region*****="" cout&lt;&lt;"******************************************************\n";="" cout&lt;&lt;"done.\n";="" et="omp_get_wtime();" dif="et-st;" cout&lt;&lt;"parallelization="" took="" "&lt;&lt;dif&lt;&lt;"sec.="" time.\n";="" *free="" memory*="" for(i="0;i<a_r;" i++)="" {="" free(a[i]);="" free(a);="" free(b[i]);="" free(b);="" free(c[i]);="" free(c);="" int="" kkk;cin="">>kkk;

return 0;
i think i have aproblem in visual studio installation??what do you think
Manar aysar 5-Apr-13 10:53am
error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup
fatal error LNK1120: 1 unresolved externals
how can solve them ,,plz help me!!
CPallini 5-Apr-13 11:07am
What kind of project did you choose on Visual Studio 2008? You should select 'Console Application'.
Manar aysar 5-Apr-13 11:10am
yes i choose console app. and give me this errors :
error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup
fatal error LNK1120: 1 unresolved externals
how can i solve them ?

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

It means that the assembly or executable module being built on your project is supposed to be an application, which always requires the definition of the entry point, a function to be called when the application is loaded. By some reason, it is missing.

Please see:[^].

You need to tag appropriate classifiers of your project when asking questions, such as platform, language, application type and other relevant detail.


This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web01 | 2.8.161128.1 | Last Updated 5 Apr 2013
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100