5

I'm trying to configure Eclipse for developing Linux Kernel Modules under Ubuntu. So far I've added to Properties > Paths and Symbols > Includes > GNU C headers from directory /usr/src/'uname -r'/include but it doesn't remove all the Syntax error from my code.

After that, my code looks like this:

code after headers added to path

What else should I do to develop Kernel modules with pleasure?

7
  • Use emacs not Eclipse for kernel development. Mar 4, 2014 at 9:48
  • possible duplicate of Linux Kernel's build configuration with Eclipse
    – Federico
    Mar 4, 2014 at 12:21
  • 1
    @Federico this is not duplicate. I'm trying to configure Eclipse for Kernel Modules development, while you gave me Eclipse configuration for browsing kernel source code. That's not the same.
    – SP5RFD
    Mar 4, 2014 at 13:57
  • it is a different way to ask the same thing. Anyway, you cannot easily remove all the Eclipse warnings. The main solution to your problems is written in the other question
    – Federico
    Mar 4, 2014 at 16:34
  • @Federico I'm almost sure you are wrong. In my opinion writing modules and browsing kernel source are two totally different things. Please show me why do you think that's the same.
    – SP5RFD
    Mar 5, 2014 at 7:02

2 Answers 2

4

If you're interested, those orange squigglies are actually indexer markers. Turn them off by going to window/preferences/general/editors/text editors/annotations, select c/c++indexer markers and uncheck 'text as'.

Also, this was posted on the Eclipse wiki: http://wiki.eclipse.org/HowTo_use_the_CDT_to_navigate_Linux_kernel_source

0
1

If you are building an Out-of-Tree kernel module, follow the steps in the CDT wiki (linked in @pjenney58's response).

The key difference is at Step 30 (Source Location->expand your project name).

  1. Instead of adding a filter to your own source folder, choose "Link Folder..." to add the kernel source.
  2. Check 'Link to folder in the file system' and select the path to your kernel source.
  3. Click Ok, then follow the instructions for adding the filter (steps 31 & 32 in the wiki) but do it on the kernel source instead of your module folder.

In my project that took care of almost all the indexer markers complaining about syntax errors.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.