POLINK:错误:未解析的外部符号。佩尔斯C
我是编程新手。我正在使用Pelles C ide编译C,昨天它还在工作,但现在出现了这个错误 以下是该项目的代码:POLINK:错误:未解析的外部符号。佩尔斯C,c,ide,main,pelles-c,C,Ide,Main,Pelles C,我是编程新手。我正在使用Pelles C ide编译C,昨天它还在工作,但现在出现了这个错误 以下是该项目的代码: #include <stdio.h> int main(void) { double operand1; double result; char operator; double operand2; printf("This is a calculator"); printf("Type a simple expression..."); scanf("%lf %
#include <stdio.h>
int main(void)
{
double operand1;
double result;
char operator;
double operand2;
printf("This is a calculator");
printf("Type a simple expression...");
scanf("%lf %s %lf", &operand1, &operator, &operand2);
if(operator == '+')
{
result = operand1 + operand2;
}
else if (operator == '-')
{
result = operand1 + operand2;
}
else if (operator == '*')
{
result = operand1 * operand2;
}
else if (operator == '/')
{
result = operand1 / operand2;
}
else
{
printf("Wrong input. Exiting.");
return 1;
}
printf("The answer is: %lf ", result);
return 0;
#包括
内部主(空)
{
双操作数1;
双重结果;
字符算子;
双操作数2;
printf(“这是一个计算器”);
printf(“键入简单表达式…”);
scanf(“%lf%s%lf”、&operator 1、&operator、&operator 2);
if(运算符=='+')
{
结果=操作数1+操作数2;
}
else if(运算符=='-')
{
结果=操作数1+操作数2;
}
else if(运算符=='*')
{
结果=操作数1*操作数2;
}
else if(运算符=='/'))
{
结果=操作数1/操作数2;
}
其他的
{
printf(“输入错误。正在退出”);
返回1;
}
printf(“答案是:%lf”,结果);
返回0;
}
这个错误的原因是什么
还有这个,我不记得以前有过这个
我从未使用过那个特定的IDE,但您的项目类型似乎是无意中从控制台更改为Windows应用程序。谢谢,一定是这样,我使用了错误的项目模板。我不知道如何检查,但我将代码粘贴到正确的模板中,没有错误。