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

前端 未结 14 2153
甜味超标
甜味超标 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:20

    Go to Project > Properties > C/C++ General > Preprocessor Includes > Providers and select both:

    • "CDT GCC Built-in Compiler Settings"
    • "CDT CROSS GCC Built-in Compiler Settings"

    For each one of those also select the sub-entry: "Use global provider shared between projects".

    Tested on Eclipse 4.8.0 in Ubuntu 16.04 with a C and a C++ hello world.

    0 讨论(0)
  • 2020-11-28 05:21
    • Select File>>New Project
    • In the Project Wizard, select C/C++>> C++ Project
    • In "Project type" section, select "Makefile Project>> Hello world C++ Project"
    • In "Toolchains" section, select "Linux GCC"

    It can solve the problem. (Excuse me for bad English)

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