开发者

Eclipse CDT C/C++ Error

开发者 https://www.devze.com 2023-01-29 23:24 出处:网络
I\'m testing out the CDT package for eclipse. I am trying to compile and run a simple Hello World program in C.

I'm testing out the CDT package for eclipse. I am trying to compile and run a simple Hello World program in C.

 #include <stdio.h>

   int main(void {
    开发者_如何学Cprintf("Hello World");

    system("PAUSE");
    return 0;
   }

But it's giving me the error: unresolved inclusion: How do I fix this?


It depends on your exact context (OS, Eclipse version, CDT version).
It can be:

  • an index issue,

Just recently upgraded to Eclipse Ganymede RC4 with CDT 5 (release from June 17th). I am having some difficulties with "Unresolved Inclusion" warnings (from the Indexer I assume?).

I had the same problem the first time I built my project after changing from Callisto to Ganymede. I changed from the Fast Indexer to the Full Indexer and did a full index, which resolved the problem (I also checked Index All Files, but I don't know if that was essential). I could then change back to the Fast Indexer and everything worked.

  • a preference issue:

I guess this could be solved in the preferences for the project. Under the point c/c++ general -> Paths and symbols. In the tab "includes" under GNU C++, you can add the location of the include files.

  • or, as this thread illustrates, a context issue:

This happens if you use Eclipse/CDT on a windows system with Cygwin or mingw.
When CDT follows the include paths there in no path "asm" in the include directory - just an "asm.lnk" which causes the problem.

0

精彩评论

暂无评论...
验证码 换一张
取 消