“Unresolved inclusion” error with Eclipse CDT for C standard library headers

前端 未结 14 2290
甜味超标
甜味超标 2020-11-28 04:18

I set up CDT for eclipse and wrote a simple hello world C program:

#include 

int main(void){
    puts(\"Hello, world.\");
    return 0;
}
         


        
14条回答
  •  孤城傲影
    2020-11-28 05:00

    I found these answers (including the accepted one) somewhat cryptic.

    For me, I had to add the path where stdio.h is located (as @ardnew said). In Eclipse, you open the Properties of your project, expand "C/C++ General" and select "Paths and Symbols".

    Make sure you have added the include dir for each language you are using. (In my case, I needed to just add it to GNU C++.)

    Screenshot of Eclipse

提交回复
热议问题