Home > Back-end >  Error LNK2019 cannot resolve the external symbol
Error LNK2019 cannot resolve the external symbol

Time:09-23

When writing source program, VS error
#include
# define N 10
Int main (void)
{
Void the sort (int [], int);
Void input (int [], int);
Void the output (int [], int);
The int data [N].
Input (data, N);
The output (data, N);
Sort (data, N);
The output (data, N);
return 0;
}
Void input (int a [], int n)
{
int i;
for(i=0; iThe scanf (" % d ", & amp; A [I]);
}
Void the output (int a [], int n)
{
int i;
for(i=0; iPrintf (" % d ", a [I]);
Printf (" % \ n ");
}
Void the sort (int a [], int n)
{
Int I, j, temp.
for(i=1; ifor(j=0; jIf (a [j] & gt; A [m + 1])
{
Temp=a, [j].
A [j]=a, a + 1 bonus to [j].
A=\ [j + 1];
}
}
Severity code shows the project file line prohibits display status
1 error LNK1120 cannot resolve the external command cry a E: \ \ C language program cry a \ Debug \ a. Exe 1
Severity code shows the project file line prohibits display status
Error LNK2019 _main cannot resolve external symbols, the symbol in the function "int __cdecl invoke_main (void)" (? Invoke_main @ @ YAHXZ) referenced cry a E: \ \ C language program a cry a \ \ MSVCRTD lib (exe_main. Obj) 1
It's almost crazy me
Hope everybody who can answer

CodePudding user response:

Printf (" % \ n "); Remove the % in this sentence, of course not remove also does not affect the operation, but will have a warning
Don't know what's your vs version, I am vs2019, in the first line added
# define _CRT_SECURE_NO_WARNINGS//it is in order to correct the scanf don't
#include
# define N 10
Then run normally and no error
your offer a firm one

CodePudding user response:

reference 1st floor CHXCHXKKK response:
printf (" % \ n "); Remove the % in this sentence, of course not remove also does not affect the operation, but will have a warning
Don't know what's your vs version, I am vs2019, in the first line added
# define _CRT_SECURE_NO_WARNINGS//it is in order to correct the scanf don't
#include
# define N 10
Then run normally and no error
your offer a firm one

I also am, 2019, in accordance with your method tried, or an error,
  • Related