Eclipse C/C function 'printf' could not be resolved

前端 未结 2 952
刺人心
刺人心 2021-01-21 01:46

I\'m trying to set up a C/C++ development environment on Eclipse.

I installed the following Eclipse plugins:

  • C/C++ development tools SDK
  • Library A
相关标签:
2条回答
  • 2021-01-21 02:03

    You must include

    C:\MinGW\include 
    

    to the include directory for using C functions.

    0 讨论(0)
  • 2021-01-21 02:16

    You must include <stdio.h> above your main(). This should solve it:

    #include <stdio.h>
    int main() {
        printf("Hello World!!!");
        return 0;
    }
    

    Sometimes, Eclipse's parser gets stupid. You can try reparsing the project. Right click on your project then → IndexRebuild. After rebuild, most likely the symbols will be recognized.

    0 讨论(0)
提交回复
热议问题