链接错误2019

时间:2014-12-09 12:59:16

标签: c

我正在用c编写一个程序,我用的是函数flushall_ 在2013年的Express express中使用它并且它一直给我错误:

  Error 1   error LNK2019: unresolved external symbol _flushall_ referenced in function _main   C:\Users\Naya123\Desktop\proj1\proj1\q1.obj proj1

我还尝试将代码复制到一个新项目中,我也从代码中删除了函数flushall_但仍然是相同的

代码(仅限主要代码):

#include<stdio.h>
#include<math.h>
#include<string.h>
void main()
{
  char option; int num1, num2, num3,count=0,num,base;
  menue();
  scanf_s("%c",&option);
  while (option != 'Y' || option != 'y')
  {
    switch (option)
    {
    case 'a' :
    case 'A':
        printf("insert first number : "); scanf_s("%d", &num1);
        printf("insert seconde number : "); scanf_s("%d", &num2);
        printf("insert third number : "); scanf_s("%d", &num3);
        printf("the max between these three is %d \n ", max(num1, num2, num3));
        break;
    case 'B' :
    case 'b':
        printf("insert first number : "); scanf_s("%d", &num1);
        printf("insert seconde number : "); scanf_s("%d", &num2);
        printf("insert third number : "); scanf_s("%d", &num3);
        printf("the min \n");
        //printf("the min  between these three is %d \n ", min(num1, num2, num3));
        break;
    case 'C':
    case 'c':
        printf("insert  number : "); scanf_s("%d", &num);
        if (is_positive(num) == ERROR)
        {
            printf("Error back to menue \n");
            break;
        }
        else {
            printf("the oposite of the number is %d \n ", oposite(num));
            break;
        }
    case 'D':
    case 'd':
        printf("insert  number : "); scanf_s("%d", &num);
        if (is_positive(num) == ERROR)
        {
            printf("Error back to menue \n");
            break;
        }
        else {
            printf("the oposite of the number is %d \n ", (is_polendrom(num)== 0) ? "the number isn't a polindrom \n" : "the number is a polindrom \n");
            break;
        }
    case 'E':
    case 'e':
        printf("insert  number : "); scanf_s("%d", &num);
        if (is_positive(num) == ERROR)
        {
            printf("Error back to menue \n");
            break;
        }
        else {
            printf("insert  the base: "); scanf_s("%d", &base);
            printf("the number in a detcimal base is  %d \n ", numByBase10(num,base));
            break;
        }
    case 'F':
    case 'f':
        printf("insert  number : "); scanf_s("%d", &num);
        if (num < 0)
            num = (make_bolindrom(-1 * num))*-1;
        else num = make_bolindrom(num);
        break;
    case 'G':
    case 'g' :
        printf("DoYou Really want to quit? y/n \n");
        option=getchar(); enter=flushall_();
        if (option == 'Y' || option == 'y')
            printf("thx for using the system ! byee \n");
        else 
            menue();
        break;
    }
    if (option != 'Y' || option != 'y')
    {
        menue();
        scanf_s("%c",&option);
    }
  }
}

1 个答案:

答案 0 :(得分:1)

该函数名为_flushall,而不是flushall _。

此外,如果调用未声明的函数,则应启用更高的警告级别以获取警告。这可以帮助您检测问题的原因。