LNK2019 无法解析的外部符号

#include <stdio.h>
#include <math.h>

void mian()
{
	double x, s;
	printf("input number:\n");
	scanf("%lf", &x);
	s = sin(x);
	printf("sin of %lf is %lf\n", x, s);
}

上部代码报错:  LNK2019    无法解析的外部符号 _main,函数 "int __cdecl invoke_main(void)" (?invoke_main@@YAHXZ) 中引用了该符号    

原因:main单词拼写错误。

#include <stdio.h>
#include <math.h>

void main()
{
	double x, s;
	printf("input number:\n");
	scanf("%lf", &x);
	s = sin(x);
	printf("sin of %lf is %lf\n", x, s);
}

Logo

技术共进,成长同行——讯飞AI开发者社区

更多推荐