2013-10-10 58 views
1

我是編程新手。我使用Pelles C IDE來編譯C,它昨天正在工作,但現在有這個錯誤。POLINK:錯誤:無法解析的外部符號。 Pelles C

enter image description here

下面是該項目的代碼:

#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; 

}

,這是什麼錯誤的原因是什麼?

還有這個,我不記得這是有前 enter image description here

回答

1

我從來沒有使用過該IDE,但它看起來像你的項目類型已經在不經意間從控制檯改爲的Windows應用程序

+0

謝謝,一定是這樣,我用錯了項目模板。我不知道如何檢查,但我將代碼粘貼在正確的模板中,沒有錯誤。 – somethingSomething

相關問題